Basic block coverage for search-based unit testing and crash reproduction

被引:0
|
作者
Derakhshanfar, Pouria [1 ]
Devroey, Xavier [2 ]
Zaidman, Andy [1 ]
机构
[1] Delft Univ Technol, Postbus 5, NL-2600 AA Delft, Netherlands
[2] Univ Namur, Namur Digital Inst, Rue Bruxelles 61, B-5000 Namur, Belgium
关键词
Automated crash reproduction; Search-based software testing; Evolutionary algorithm; Secondary objective; EMPIRICAL-EVALUATION; GENERATION; ALGORITHMS;
D O I
10.1007/s10664-022-10155-0
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Search-based techniques have been widely used for white-box test generation. Many of these approaches rely on the approach level and branch distance heuristics to guide the search process and generate test cases with high line and branch coverage. Despite the positive results achieved by these two heuristics, they only use the information related to the coverage of explicit branches (e.g., indicated by conditional and loop statements), but ignore potential implicit branchings within basic blocks of code. If such implicit branching happens at runtime (e.g., if an exception is thrown in a branchless-method), the existing fitness functions cannot guide the search process. To address this issue, we introduce a new secondary objective, called Basic Block Coverage (BBC), which takes into account the coverage level of relevant basic blocks in the control flow graph. We evaluated the impact of BBC on search-based unit test generation (using the DvsTAMOSA algorithm) and search-based crash reproduction (using the STDistance and WeightedSum fitness functions). Our results show that for unit test generation, BBC improves the branch coverage of the generated tests. Although small (similar to 1.5%), this improvement in the branch coverage is systematic and leads to an increase of the output domain coverage and implicit runtime exception coverage, and of the diversity of runtime states. In terms of crash reproduction, in the combination of STDistance and WeightedSum, BBC helps in reproducing 3 new crashes for each fitness function. BBC significantly decreases the time required to reproduce 43.5% and 45.1% of the crashes using STDistance and WeightedSum, respectively. For these crashes, BBC reduces the consumed time by 71.7% (for STDistance) and 68.7% (for WeightedSum) on average.
引用
收藏
页数:41
相关论文
共 50 条
  • [1] Basic block coverage for search-based unit testing and crash reproduction
    Pouria Derakhshanfar
    Xavier Devroey
    Andy Zaidman
    [J]. Empirical Software Engineering, 2022, 27
  • [2] Search-Based Crash Reproduction and Its Impact on Debugging
    Soltani, Mozhan
    Panichella, Annibale
    van Deursen, Arie
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2020, 46 (12) : 1294 - 1317
  • [3] A benchmark-based evaluation of search-based crash reproduction
    Mozhan Soltani
    Pouria Derakhshanfar
    Xavier Devroey
    Arie van Deursen
    [J]. Empirical Software Engineering, 2020, 25 : 96 - 138
  • [4] A benchmark-based evaluation of search-based crash reproduction
    Soltani, Mozhan
    Derakhshanfar, Pouria
    Devroey, Xavier
    Van Deursen, Arie
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (01) : 96 - 138
  • [5] Botsing, a Search-based Crash Reproduction Framework for Java']Java
    Derakhshanfar, Pouria
    Devroey, Xavier
    Panichella, Annibale
    Zaidman, Andy
    van Deursen, Arie
    [J]. 2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, : 1278 - 1282
  • [6] Search-based crash reproduction using behavioural model seeding
    Derakhshanfar, Pouria
    Devroey, Xavier
    Perrouin, Gilles
    Zaidman, Andy
    van Deursen, Arie
    [J]. SOFTWARE TESTING VERIFICATION & RELIABILITY, 2020, 30 (03):
  • [7] Search-based reduction model for unit testing
    Fernandez-Oliva, Perla Beatriz
    Guemes-Esperon, Alejandro Miguel
    Delgado-Dapena, Martha Dunia
    Rosete, Alejandro
    [J]. REVISTA FACULTAD DE INGENIERIA-UNIVERSIDAD DE ANTIOQUIA, 2023, (109): : 35 - 47
  • [8] Summary of Search-based Crash Reproduction using Behavioral Model Seeding
    Derakhshanfar, Pouria
    Devroey, Xavier
    Perrouin, Gilles
    Zaidman, Andy
    van Deursen, Arie
    [J]. 2021 14TH IEEE CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST 2021), 2021, : 281 - 281
  • [9] Good Things Come In Threes: Improving Search-based Crash Reproduction With Helper Objectives
    Derakhshanfar, Pouria
    Devroey, Xavier
    Zaidman, Andy
    van Deursen, Arie
    Panichella, Annibale
    [J]. 2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, : 211 - 223
  • [10] Selectively Combining Multiple Coverage Goals in Search-Based Unit Test Generation
    Zhou, Zhichao
    Zhou, Yuming
    Fang, Chunrong
    Chen, Zhenyu
    Tang, Yutian
    [J]. PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,