Recovering fitness gradients for interprocedural Boolean flags in search-based testing

In Search-based Software Testing (SBST), test generation is guided by fitness functions that estimate how close a test case is to reach an uncovered test goal (e.g., branch). A popular fitness function estimates how close conditional statements are to evaluating to true or false, i.e., the branch di...

Full description

Saved in:
Bibliographic Details
Main Authors: LIN, Yun, SUN, Jun, FRASER, Gordon, XIU, Ziheng, LIU, Ting, DONG, Jin Song
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2020
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/5960
https://ink.library.smu.edu.sg/context/sis_research/article/6963/viewcontent/issta20.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-6963
record_format dspace
spelling sg-smu-ink.sis_research-69632021-05-24T08:08:25Z Recovering fitness gradients for interprocedural Boolean flags in search-based testing LIN, Yun SUN, Jun FRASER, Gordon XIU, Ziheng LIU, Ting DONG, Jin Song In Search-based Software Testing (SBST), test generation is guided by fitness functions that estimate how close a test case is to reach an uncovered test goal (e.g., branch). A popular fitness function estimates how close conditional statements are to evaluating to true or false, i.e., the branch distance. However, when conditions read Boolean variables (e.g., if(x && y)), the branch distance provides no gradient for the search, since a Boolean can either be true or false. This flag problem can be addressed by transforming individual procedures such that Boolean flags are replaced with numeric comparisons that provide better guidance for the search. Unfortunately, defining a semantics-preserving transformation that is applicable in an interprocedural case, where Boolean flags are passed around as parameters and return values, is a daunting task. Thus, it is not yet supported by modern test generators. This work is based on the insight that fitness gradients can be recovered by using runtime information: Given an uncovered interprocedural flag branch, our approach (1) calculates context-sensitive branch distance for all control flows potentially returning the required flag in the called method, and (2) recursively aggregates these distances into a continuous value. We implemented our approach on top of the EvoSuite framework for Java, and empirically compared it with state-of-the-art testability transformations on 807 non-trivial methods suffering from interprocedural flag problems, sampled from 150 open source Java projects. Our experiment demonstrates that our approach achieves higher coverage on the subject methods with statistical significance and acceptable runtime overheads. 2020-07-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/5960 info:doi/10.1145/3395363.3397358 https://ink.library.smu.edu.sg/context/sis_research/article/6963/viewcontent/issta20.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Program analysis search-based testability testing Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Program analysis
search-based
testability
testing
Software Engineering
spellingShingle Program analysis
search-based
testability
testing
Software Engineering
LIN, Yun
SUN, Jun
FRASER, Gordon
XIU, Ziheng
LIU, Ting
DONG, Jin Song
Recovering fitness gradients for interprocedural Boolean flags in search-based testing
description In Search-based Software Testing (SBST), test generation is guided by fitness functions that estimate how close a test case is to reach an uncovered test goal (e.g., branch). A popular fitness function estimates how close conditional statements are to evaluating to true or false, i.e., the branch distance. However, when conditions read Boolean variables (e.g., if(x && y)), the branch distance provides no gradient for the search, since a Boolean can either be true or false. This flag problem can be addressed by transforming individual procedures such that Boolean flags are replaced with numeric comparisons that provide better guidance for the search. Unfortunately, defining a semantics-preserving transformation that is applicable in an interprocedural case, where Boolean flags are passed around as parameters and return values, is a daunting task. Thus, it is not yet supported by modern test generators. This work is based on the insight that fitness gradients can be recovered by using runtime information: Given an uncovered interprocedural flag branch, our approach (1) calculates context-sensitive branch distance for all control flows potentially returning the required flag in the called method, and (2) recursively aggregates these distances into a continuous value. We implemented our approach on top of the EvoSuite framework for Java, and empirically compared it with state-of-the-art testability transformations on 807 non-trivial methods suffering from interprocedural flag problems, sampled from 150 open source Java projects. Our experiment demonstrates that our approach achieves higher coverage on the subject methods with statistical significance and acceptable runtime overheads.
format text
author LIN, Yun
SUN, Jun
FRASER, Gordon
XIU, Ziheng
LIU, Ting
DONG, Jin Song
author_facet LIN, Yun
SUN, Jun
FRASER, Gordon
XIU, Ziheng
LIU, Ting
DONG, Jin Song
author_sort LIN, Yun
title Recovering fitness gradients for interprocedural Boolean flags in search-based testing
title_short Recovering fitness gradients for interprocedural Boolean flags in search-based testing
title_full Recovering fitness gradients for interprocedural Boolean flags in search-based testing
title_fullStr Recovering fitness gradients for interprocedural Boolean flags in search-based testing
title_full_unstemmed Recovering fitness gradients for interprocedural Boolean flags in search-based testing
title_sort recovering fitness gradients for interprocedural boolean flags in search-based testing
publisher Institutional Knowledge at Singapore Management University
publishDate 2020
url https://ink.library.smu.edu.sg/sis_research/5960
https://ink.library.smu.edu.sg/context/sis_research/article/6963/viewcontent/issta20.pdf
_version_ 1770575705601474560