Measuring and Maintaining Population Diversity in Search-Based Unit Test Generation

被引:3
作者
Albunian, Nasser [1 ]
Fraser, Gordon [2 ]
Sudholt, Dirk [1 ]
机构
[1] Univ Sheffield, Sheffield, S Yorkshire, England
[2] Univ Passau, Passau, Germany
来源
SEARCH-BASED SOFTWARE ENGINEERING, SSBSE 2020 | 2020年 / 12420卷
关键词
Search-based test generation; Population diversity; GENETIC ALGORITHM;
D O I
10.1007/978-3-030-59762-7_11
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Genetic algorithms (GAs) have been demonstrated to be effective at generating unit tests. However, GAs often suffer from a loss of population diversity, which causes the search to prematurely converge, thus negatively affecting the resulting code coverage. One way to prevent premature convergence is to maintain and increase population diversity. Although the impact of population diversity on the performance of GAs is well-studied in the literature, little attention has been given to population diversity in unit test generation. We study how maintaining population diversity influences the Many-Objective Sorting Algorithm (MOSA), a state-of-the-art evolutionary search algorithm for generating unit tests. We define three diversity measures based on fitness entropy, test executions (phenotypic diversity), and Java statements (genotypic diversity). To improve diversity, we apply common methods that fall into two groups: niching (such as fitness sharing and clearing) and non-niching (such as diverse initial populations). Our results suggest that increasing diversity does not have a beneficial effect on coverage in general, but it may improve coverage once the search stagnates.
引用
收藏
页码:153 / 168
页数:16
相关论文
共 28 条
[1]   Diversity Management in Evolutionary Many-Objective Optimization [J].
Adra, Salem F. ;
Fleming, Peter J. .
IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, 2011, 15 (02) :183-195
[2]   Diversity in Search-Based Unit Test Suite Generation [J].
Albunian, Nasser M. .
SEARCH BASED SOFTWARE ENGINEERING, SSBSE 2017, 2017, 10452 :183-189
[3]   An empirical evaluation of evolutionary algorithms for unit test suite generation [J].
Campos, Jose ;
Ge, Yan ;
Albunian, Nasser ;
Fraser, Gordon ;
Eler, Marcelo ;
Arcuri, Andrea .
INFORMATION AND SOFTWARE TECHNOLOGY, 2018, 104 :207-235
[4]   Effects of diversity control in single-objective and multi-objective genetic algorithms [J].
Chaiyaratana, Nachol ;
Piroonratana, Theera ;
Sangkawelert, Nuntapon .
JOURNAL OF HEURISTICS, 2007, 13 (01) :1-34
[5]   Exploration and Exploitation in Evolutionary Algorithms: A Survey [J].
Crepinsek, Matej ;
Liu, Shih-Hsi ;
Mernik, Marjan .
ACM COMPUTING SURVEYS, 2013, 45 (03)
[6]  
Diaz-Gomez Pedro A., 2007, Proceedings of the 2007 International Conference on Artificial Intelligence and Pattern Recognition (AIPR-07), P334
[7]   Test Set Diameter: Quantifying the Diversity of Sets of Test Cases [J].
Feldt, Robert ;
Poulding, Simon ;
Clark, David ;
Yoo, Shin .
2016 9TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST), 2016, :223-233
[8]   Whole Test Suite Generation [J].
Fraser, Gordon ;
Arcuri, Andrea .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2013, 39 (02) :276-291
[9]  
Freitag McPhee N., 1999, Proceedings of the 1999 Congress on Evolutionary Computation-CEC99 (Cat. No. 99TH8406), P1377, DOI 10.1109/CEC.1999.782643
[10]  
Jackson D, 2010, LECT NOTES COMPUT SC, V6239, P472, DOI 10.1007/978-3-642-15871-1_48