black-box optimization problems, for example, assigning people to tasks (a typical combinatorial optimization problem).
white-box problems where operations on source code need to be considered.[2]
Definition
SBSE converts a software engineering problem into a computational search problem that can be tackled with a metaheuristic. This involves defining a search space, or the set of possible solutions. This space is typically too large to be explored exhaustively, suggesting a metaheuristic approach. A metric[3] (also called a fitness function, cost function, objective function or quality measure) is then used to measure the quality of potential solutions. Many software engineering problems can be reformulated as a computational search problem.[4]
One of the earliest attempts to apply optimization to a software engineering problem was reported by Webb Miller and David Spooner in 1976 in the area of software testing.[5] In 1992, S. Xanthakis and his colleagues applied a search technique to a software engineering problem for the first time.[6] The term SBSE was first used in 2001 by Harman and Jones.[7] The research community grew to include more than 800 authors by 2013, spanning approximately 270 institutions in 40 countries.[8]
Requirements engineering is the process by which the needs of a software's users and environment are determined and managed. Search-based methods have been used for requirements selection and optimisation with the goal of finding the best possible subset of requirements that matches user requests amid constraints such as limited resources and interdependencies between requirements. This problem is often tackled as a multiple-criteria decision-making problem and, generally involves presenting the decision maker with a set of good compromises between cost and user satisfaction as well as the requirements risk.[17][18][19][20]
Debugging and maintenance
Identifying a software bug (or a code smell) and then debugging (or refactoring) the software is largely a manual and labor-intensive endeavor, though the process is tool-supported. One objective of SBSE is to automatically identify and fix bugs (for example via mutation testing).
Genetic programming, a biologically-inspired technique that involves evolving programs through the use of crossover and mutation, has been used to search for repairs to programs by altering a few lines of source code. The GenProg Evolutionary Program Repair software repaired 55 out of 105 bugs for approximately $8 each in one test.[21]
Coevolution adopts a "predator and prey" metaphor in which a suite of programs and a suite of unit tests evolve together and influence each other.[22]
Testing
Search-based software engineering has been applied to software testing, including the automatic generation of test cases (test data), test case minimization and test case prioritization.[23]Regression testing has also received some attention.
Optimizing software
The use of SBSE in program optimization, or modifying a piece of software to make it more efficient in terms of speed and resource use, has been the object of successful research.[24] In one instance, a 50,000 line program was genetically improved, resulting in a program 70 times faster on average.[25]
A recent work by Basios et al. shows that by optimising the data structure, Google Guava found a 9% improvement in execution time, 13% improvement in memory consumption and 4% improvement in CPU usage separately.[26]
Project management
A number of decisions that are normally made by a project manager can be done automatically, for example, project scheduling.[27]
Tools
Tools available for SBSE include OpenPAT,[28]EvoSuite,[29] and Coverage, a code coverage measurement tool for Python.[30]
Methods and techniques
A number of methods and techniques are available, including:
As a relatively new area of research, SBSE does not yet experience broad industry acceptance.
Successful applications of SBSE in the industry can mostly be found within software testing, where the capability to automatically generate random test inputs for uncovering bugs at a big scale is attractive to companies. In 2017, Facebook acquired the software startup Majicke Limited that developed Sapienz, a search-based bug finding app.[32]
In other application scenarios, software engineers may be reluctant to adopt tools over which they have little control or that generate solutions that are unlike those that humans produce.[33] In the context of SBSE use in fixing or improving programs, developers need to be confident that any automatically produced modification does not generate unexpected behavior outside the scope of a system's requirements and testing environment. Considering that fully automated programming has yet to be achieved, a desirable property of such modifications would be that they need to be easily understood by humans to support maintenance activities.[34]
Another concern is that SBSE might make the software engineer redundant. Supporters claim that the motivation for SBSE is to enhance the relationship between the engineer and the program.[35]
^
Harman, Mark (2010). "Why Source Code Analysis and Manipulation Will Always be Important". 10th IEEE Working Conference on Source Code Analysis and Manipulation (SCAM 2010). 10th IEEE Working Conference on Source Code Analysis and Manipulation (SCAM 2010). pp. 7–19. doi:10.1109/SCAM.2010.28.
^
Harman, Mark; John A. Clark (2004). "Metrics are fitness functions too". Proceedings of the 10th International Symposium on Software Metrics, 2004. 10th International Symposium on Software Metrics, 2004. pp. 58–69. doi:10.1109/METRIC.2004.1357891.
^Clark, John A.; Dolado, José Javier; Harman, Mark; Hierons, Robert M.; Jones, Bryan F.; Lumkin, M.; Mitchell, Brian S.; Mancoridis, Spiros; Rees, K.; Roper, Marc; Shepperd, Martin J. (2003). "Reformulating software engineering as a search problem". IEE Proceedings - Software. 150 (3): 161–175. CiteSeerX10.1.1.144.3059. doi:10.1049/ip-sen:20030559 (inactive 7 December 2024). ISSN1462-5970.{{cite journal}}: CS1 maint: DOI inactive as of December 2024 (link)
^
Miller, Webb; Spooner, David L. (1976). "Automatic Generation of Floating-Point Test Data". IEEE Transactions on Software Engineering. SE-2 (3): 223–226. doi:10.1109/TSE.1976.233818. ISSN0098-5589. S2CID18875300.
^S. Xanthakis, C. Ellis, C. Skourlas, A. Le Gall, S. Katsikas and K. Karapoulios, "Application of genetic algorithms to software testing," in Proceedings of the 5th International Conference on Software Engineering and its Applications, Toulouse, France, 1992, pp. 625–636
^Mariani, Thainá; Vergilio, Silvia Regina (1 March 2017). "A systematic review on search-based refactoring". Information and Software Technology. 83: 14–34. doi:10.1016/j.infsof.2016.11.009. ISSN0950-5849.
^
Antoniol, Giuliano; Di Penta, Massimiliano; Harman, Mark (2005). "Search-based techniques applied to optimization of project planning for a massive maintenance project". Proceedings of the 21st IEEE International Conference on Software Maintenance, 2005. ICSM'05. Proceedings of the 21st IEEE International Conference on Software Maintenance, 2005. ICSM'05. pp. 240–249. CiteSeerX10.1.1.63.8069. doi:10.1109/ICSM.2005.79.
^Le Goues, Claire; Dewey-Vogt, Michael; Forrest, Stephanie; Weimer, Westley (2012). "A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each". 2012 34th International Conference on Software Engineering (ICSE). 2012 34th International Conference on Software Engineering (ICSE). pp. 3–13. doi:10.1109/ICSE.2012.6227211.
^Arcuri, Andrea; Yao, Xin (2008). "A novel co-evolutionary approach to automatic software bug fixing". IEEE Congress on Evolutionary Computation, 2008. CEC 2008. (IEEE World Congress on Computational Intelligence). IEEE Congress on Evolutionary Computation, 2008. CEC 2008. (IEEE World Congress on Computational Intelligence). pp. 162–168. CiteSeerX10.1.1.159.7991. doi:10.1109/CEC.2008.4630793.
^Harman, Mark; Jia, Yue; Zhang, Yuanyuan (April 2015). "Achievements, Open Problems and Challenges for Search Based Software Testing". 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST). Graz, Austria: IEEE. pp. 1–12. CiteSeerX10.1.1.686.7418. doi:10.1109/ICST.2015.7102580. ISBN978-1-4799-7125-1. S2CID15272060.
^
Minku, Leandro L.; Sudholt, Dirk; Yao, Xin (2012). "Evolutionary algorithms for the project scheduling problem: runtime analysis and improved design". Proceedings of the fourteenth international conference on Genetic and evolutionary computation conference. GECCO '12. New York, NY, USA: ACM. pp. 1221–1228. doi:10.1145/2330163.2330332. ISBN978-1-4503-1177-9.
^
Simons, Christopher L. (May 2013). Whither (away) software engineers in SBSE?. First International Workshop on Combining Modelling with Search-Based Software Engineering, First International Workshop on Combining Modelling with Search-Based Software Engineering. San Francisco, USA: IEEE Press. pp. 49–50. Retrieved 31 October 2013.