Formal methods contribute to the fundamental improvement of software quality and reliability, but this methodology is often very expensive. A compromise is to select and apply formal methods to only a subset of key components of the software system. However, currently there are few effective approaches for such selection process. This paper proposes a 0-1 constrained programming model for selecting key components for formal development, which enables the use of metaheuristic search methods to effectively solve the selection problem. The paper also designs a discrete water wave optimization(WWO) algorithm for the problem. The application to a large-scale software system validates the effectiveness of the proposed problem model, and demonstrates that the WWO algorithm outperforms some other typical metaheuristic search methods.