Membrane computing is a recently developed research field, whose models, P systems, are bio-inspired computational models, abstracted from the structure and the functioning of living cells. Their applications are various and have been reported in biology, bio-medicine, economics, approximate optimization and computer graphics. However, it is a difficult task to design a P system which solves a given problem, especially because of their characteristics, such as nondeterminism, parallelism, possible presence of active membranes. In this paper we propose an approach to P systems automatic design, which uses genetic algorithms and model checking. More precisely, we use a type of fitness function which performs several simulations of the P system, in order to assess its adequacy to realize the given task, complemented by formal verification of the model.