An empirical evaluation of evolutionary algorithms for unit test suite generation

被引:68
作者
Campos, Jose [1 ]
Ge, Yan [1 ]
Albunian, Nasser [1 ]
Fraser, Gordon [1 ,2 ]
Eler, Marcelo [3 ]
Arcuri, Andrea [4 ,5 ]
机构
[1] Univ Sheffield, Dept Comp Sci, Sheffield, S Yorkshire, England
[2] Univ Passau, Chair Software Engn 2, Passau, Germany
[3] Univ Sao Paulo, Sao Paulo, SP, Brazil
[4] Kristiania Univ Coll, Oslo, Norway
[5] Univ Luxembourg, Luxembourg, Luxembourg
基金
英国工程与自然科学研究理事会; 巴西圣保罗研究基金会; 欧洲研究理事会;
关键词
Evolutionary algorithms; Test suite generation; Empirical study; OPTIMIZATION; BONFERRONI;
D O I
10.1016/j.infsof.2018.08.010
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context Evolutionary algorithms have been shown to be effective at generating unit test suites optimised for code coverage. While many specific aspects of these algorithms have been evaluated in detail (e.g., test length and different kinds of techniques aimed at improving performance, like seeding), the influence of the choice of evolutionary algorithm has to date seen less attention in the literature. Objective: Since it is theoretically impossible to design an algorithm that is the best on all possible problems, a common approach in software engineering problems is to first try the most common algorithm, a genetic algorithm, and only afterwards try to refine it or compare it with other algorithms to see if any of them is more suited for the addressed problem. The objective of this paper is to perform this analysis, in order to shed light on the influence of the search algorithm applied for unit test generation. Method: We empirically evaluate thirteen different evolutionary algorithms and two random approaches on a selection of non-trivial open source classes. All algorithms are implemented in the Evosuite test generation tool, which includes recent optimisations such as the use of an archive during the search and optimisation for multiple coverage criteria. Results: Our study shows that the use of a test archive makes evolutionary algorithms clearly better than random testing, and it confirms that the DynaMOSA many-objective search algorithm is the most effective algorithm for unit test generation. Conclusion: Our results show that the choice of algorithm can have a substantial influence on the performance of whole test suite optimisation. Although we can make a recommendation on which algorithm to use in practice, no algorithm is clearly superior in all cases, suggesting future work on improved search algorithms for unit test generation.
引用
收藏
页码:207 / 235
页数:29
相关论文
共 54 条
[1]  
Agrawal A.P., 2018, Data engineering and intelligent computing, P397, DOI DOI 10.1007/978-981-10-3223-3_38
[2]   Analysing the fitness landscape of search-based software testing problems [J].
Aleti, Aldeida ;
Moser, I. ;
Grunske, Lars .
AUTOMATED SOFTWARE ENGINEERING, 2017, 24 (03) :603-621
[3]  
[Anonymous], 1978, SIMULATIONSMETHODEN, DOI 10.1007/978-3-642-81283-5_8
[4]  
[Anonymous], 2016, 2016 IEEE HIGH PERF, DOI DOI 10.1109/HPEC.2016.7761649
[5]  
[Anonymous], LIPS VS MOSA REPLICA
[6]  
[Anonymous], EVOLUTIONARY ALGORIT
[7]  
[Anonymous], OPERATIONS RES COMPU
[8]  
[Anonymous], 2007, INT S SOFTW TEST AN, DOI DOI 10.1145/1273463.1273475
[9]  
[Anonymous], MANY INDEPENDENT OBJ
[10]  
Arcuri Andrea, 2010, Proceedings of the Third IEEE International Conference on Software Testing, Verification and Validation (ICST 2010), P205, DOI 10.1109/ICST.2010.17