Thermodynamic Aspects of Bulk and Surface Defects–First-Principle Calculations -