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

被引:0
作者
Pouria Derakhshanfar
Xavier Devroey
Andy Zaidman
机构
[1] Delft University of Technology,Namur Digital Institute
[2] University of Namur,undefined
来源
Empirical Software Engineering | 2022年 / 27卷
关键词
Automated crash reproduction; Search-based software testing; Evolutionary algorithm; Secondary objective;
D O I
暂无
中图分类号
学科分类号
摘要
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 DynaMOSA 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 (∼\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$\sim $\end{document}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.
引用
收藏
相关论文
共 50 条
  • [1] Allen FE(1970)Control flow analysis ACM SIGPLAN Notices 5 1-19
  • [2] Arcuri A(2019)RESTful API automated test case generation with evomaster ACM Trans Softw Eng Methodol (TOSEM) 28 1-37
  • [3] Arcuri A(2014)A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering Softw Test Verif Reliab 24 219-250
  • [4] Briand L(2013)Parameter tuning or default values? An empirical investigation in search-based software engineering Empir Softw Eng 18 594-623
  • [5] Arcuri A(2018)An empirical evaluation of evolutionary algorithms for unit test suite generation Inf Softw Technol 104 207-235
  • [6] Fraser G(2015)STAR: Stack trace based automatic crash reproduction via symbolic execution IEEE Trans Softw Eng 41 198-220
  • [7] Campos J(2020)Search-based crash reproduction using behavioural model seeding STVR 30 e1733-291
  • [8] Ge Y(2013)Whole test suite generation IEEE Trans Softw Eng 39 276-42
  • [9] Albunian N(2014)A large-scale evaluation of automated unit test generation using EvoSuite ACM Trans Softw Eng Methodol 24 1-639
  • [10] Fraser G(2015)1600 faults in 100 projects: Automatically finding faults while achieving high coverage with evosuite Empir Softw Eng 20 611-812