Résumé : In swarm robotics, the design problem is one of the most pressing issues of today's research. Robots in a swarm must be autonomous and are usually individually programmed. However, the collective behavior of the swarm, which is expected to emerge from the interactions between the robots and between the robots and their environment, is best described at the level of the swarm. A great deal of effort has been devoted in an attempt to find suitable solutions to create control software for individual robots so that they achieve a particular collective behavior. One solution is automatic design, in which control software is generated automatically by an optimization process that configures a certain control software architecture. Traditionally, automatic design is accomplished through neuroevolution, that is, training a neural network in a simulated environment using an evolutionary algorithm, directly on the mission to tackle. Neuroevolutionary approaches have shown to be very effective, and work quite well when control software is designed and assessed in a simulated environment. However, they have been shown to be susceptible to the reality gap, the intrinsic and unavoidable difference between reality and the simulation environment used to generate the control software. In recent years, another approach has been proposed: modular design. In modular design, the control software is composed of modules that can be created once and for all and re-used for multiple missions. Restricting the space of possible behaviors, by limiting the control software to a combination of existing modules, effectively increases the robustness to the reality gap of modular methods in comparison to neuroevolutionary ones. However, modular methods require human expertise in swarm robotics in order to create the modules, making them more challenging to implement than neuroevolutionary methods. The objective of this thesis is to combine the advantages of neuroevolution and modular methods: the ease of implementation of neuroevolution, which requires minimal human expertise and domain knowledge, and the robustness to the reality gap of modular methods. Is it possible to create an automatic design method that is both as robust as a hand-crafted modular method, and as versatile as a purely neuroevolutionary method? In this thesis, we present our experimental work on the robustness of automatic design methods to the reality gap, in a thorough comparison of the most classical neuroevolutionary methods and the most classical modular ones. We show that the presented neuroevolutionary approaches are all greatly affected by the reality gap and outperformed by the modular method. Then, in the form of two methods, Arlequin and Nata, we present our advances in modular automatic design. These methods use neural networks as modules of the control software architecture and require less human expertise than their predecessors. We show that they outperform the neuroevolutionary method, and are able to generate control software that crosses the reality gap relatively better than neuroevolutionary methods.