Based on the adjoint system equations with two-class of independent variables, sensitivity analysis of shape optimization for objective or constrained functional defined on a variable boundary is carried out. The shape optimization method for pure-boundary value problems is proposed.