Basic Block Coverage for Search-based Unit Testing and Crash Reproduction

03/04/2022
by   Pouria Derakhshanfar, et al.
0

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 (around 1.5 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 For these crashes, BBC reduces the consumed time by 71.7 68.7

READ FULL TEXT
research
05/12/2021

Towards exhaustive branch coverage with PathCrawler

Branch coverage of source code is a very widely used test criterion. Mor...
research
02/09/2021

Learning How to Search: Generating Effective Test Cases Through Adaptive Fitness Function Selection

Search-based test generation is guided by feedback from one or more fitn...
research
08/29/2022

Minimum Coverage Instrumentation

Modern compilers leverage block coverage profile data to carry out downs...
research
01/13/2020

Towards Integration-Level Test Case Generation Using Call Site Information

Search-based approaches have been used in the literature to automate the...
research
12/28/2020

A Comprehensive Empirical Evaluation of Generating Test Suites for Mobile Applications with Diversity

Context: In search-based software engineering we often use popular heuri...
research
08/11/2021

Hybrid Multi-level Crossover for Unit Test Case Generation

State-of-the-art search-based approaches for test case generation work a...
research
02/23/2023

Sequence-Based Incremental Concolic Testing of RTL Models

Concolic testing is a scalable solution for automated generation of dire...

Please sign up or login with your details

Forgot password? Click here to reset