Harmony search-based test data generation for branch coverage in software structural testing

被引:18
|
作者
Mao, Chengying [1 ]
机构
[1] Jiangxi Univ Finance & Econ, Sch Software & Commun Engn, Nanchang 330013, Peoples R China
来源
NEURAL COMPUTING & APPLICATIONS | 2014年 / 25卷 / 01期
基金
中国国家自然科学基金;
关键词
Test data generation; Harmony search; Fitness function; Branch coverage; Branch weight; EVOLUTIONARY ALGORITHMS; OPTIMIZATION;
D O I
10.1007/s00521-013-1474-z
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Test data generation is always a key task in the field of software testing. In recent years, meta-heuristic search techniques have been considered as an effective way to assist test data generation in software structural testing. In this way, some representative test cases with high-coverage capability can be picked out from program input space. Harmony search (HS) is a recently developed algorithm and has been vigorously applied to various optimization problems. In the paper, we attempt to apply harmony search algorithm to generate test data satisfying branch coverage. At the preprocessing stage, the probes used for gathering coverage information are inserted into all branches via program static analysis. At the same time, the encoding and decoding styles between a test case and a harmony are also determined in advance. At the stage of test data searching, the subset of test data that has much stronger covering ability is stored in harmony memory. During the evolution process, one part of test suite is selected and adjusted from the harmony memory, and the other part is randomly generated from input space. Once a test suite is yielded after one-round search, its coverage can be measured by fitness function in our search algorithm. In our work, a new fitness function for branch coverage is constructed by comprehensively considering branch distance and branch weight. Here, the branch weight is determined by branch information in program, that is, the nesting level of a specific branch and the predicate types in it. Subsequently, the computed coverage metric is used for updating the test suite in the next round of searching. In order to validate the effectiveness of our proposed method, eight well-known programs are used for experimental evaluation. Experimental results show that the coverage of HS-based method is usually higher than those of other search algorithms, such as simulated annealing (SA) and genetic algorithm (GA). Meanwhile, HS demonstrates greater stability than SA and GA when varying the population size or performing repeated trials. That is to say, music-inspired HS algorithm is more suitable to generate test data for branch coverage in software structural testing.
引用
收藏
页码:199 / 216
页数:18
相关论文
共 50 条
  • [1] Harmony search-based test data generation for branch coverage in software structural testing
    Chengying Mao
    Neural Computing and Applications, 2014, 25 : 199 - 216
  • [2] Search-based Software Testing and Test Data Generation for a Dynamic Programming Language
    Mairhofer, Stefan
    Feldt, Robert
    Torkar, Richard
    GECCO-2011: PROCEEDINGS OF THE 13TH ANNUAL GENETIC AND EVOLUTIONARY COMPUTATION CONFERENCE, 2011, : 1859 - 1866
  • [3] Search-based software test data generation: a survey
    McMinn, P
    SOFTWARE TESTING VERIFICATION & RELIABILITY, 2004, 14 (02): : 105 - 156
  • [4] Improved Evolutionary Generation of Test Data for Multiple Paths in Search-based Software Testing
    Zhu, Ziming
    Xu, Xiong
    Jiao, Li
    2017 IEEE CONGRESS ON EVOLUTIONARY COMPUTATION (CEC), 2017, : 612 - 620
  • [5] Search-Based Software Test Data Generation for Path Coverage Based on a Feedback-Directed Mechanism
    Semujju S.D.
    Huang H.
    Liu F.
    Xiang Y.
    Hao Z.
    Complex System Modeling and Simulation, 2023, 3 (01): : 12 - 31
  • [6] A New Method of Test Data Generation for Branch Coverage in Software Testing Based on EPDG and Genetic Algorithm
    Chen, Ciyong
    Xu, Xiaofeng
    Chen, Yan
    Li, Xiaochao
    Guo, Donghui
    PROCEEDINGS OF THE 3RD INTERNATIONAL CONFERENCE ON ANTI-COUNTERFEITING, SECURITY, AND IDENTIFICATION IN COMMUNICATION, 2009, : 307 - +
  • [7] FinHunter: Improved Search-Based Test Generation for Structural Testing of FinTech Systems
    Ding, Xuanwen
    Wang, Qingshun
    Liu, Dan
    Xu, Lihua
    Xiao, Jun
    Zhang, Bojun
    Li, Xue
    Dou, Liang
    He, Liang
    Xie, Tao
    COMPANION PROCEEDINGS OF THE 32ND ACM INTERNATIONAL CONFERENCE ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, FSE COMPANION 2024, 2024, : 10 - 20
  • [8] Dynamic stopping criteria for search-based test data generation for path testing
    Hermadi, I.
    Lokan, C.
    Sarker, R.
    INFORMATION AND SOFTWARE TECHNOLOGY, 2014, 56 (04) : 395 - 407
  • [9] An Improved Crow Search Algorithm for Test Data Generation Using Search-Based Mutation Testing
    Nishtha Jatana
    Bharti Suri
    Neural Processing Letters, 2020, 52 : 767 - 784
  • [10] An Improved Crow Search Algorithm for Test Data Generation Using Search-Based Mutation Testing
    Jatana, Nishtha
    Suri, Bharti
    NEURAL PROCESSING LETTERS, 2020, 52 (01) : 767 - 784