This report describes the formulation of an aerodynamic shape design methodology using a compressible viscous flow model based on the Reynolds-Averaged Navier-Stokes equations. The aerodynamic shape is described by a set of geometrical design variables. The design problem is formulated as an optimization problem stated in terms of an aerodynamic objective functional which has to be minimized. The design scheme employs a gradient-based optimization algorithm in order to obtain the optimum values of the design variables. The gradient of the aerodynamic functional with respect to the design variables is computed by means of the variational method, which requires the solution of an adjoint problem. The formulation of the adjoint problem is described which leads to a set of adjoint equations and boundary conditions. Using the flow variables and the adjoint variables, an expression for the gradient has been constructed. Computational results are presented for an inverse problem of an airfoil. It will be shown that, starting from an initial geometry of the NACA 0012 airfoil, the target pressure distribution and geometry of a best-fit of the RAE 2822 airfoil in a transonic flow condition has been reconstructed successfully.