Studying the impact of early test termination due to assertion failure on code coverage and spectrum-based fault localization

dc.contributor.authorUddin, Md. Ashraf
dc.contributor.examiningcommitteeThulasiraman, Parimala (Computer Science)
dc.contributor.examiningcommitteeRouhani, Sara (Computer Science)
dc.contributor.supervisorWang, Shaowei
dc.date.accessioned2023-08-28T16:01:56Z
dc.date.available2023-08-28T16:01:56Z
dc.date.issued2023-08-15
dc.date.submitted2023-08-21T01:54:21Zen_US
dc.degree.disciplineComputer Scienceen_US
dc.degree.levelMaster of Science (M.Sc.)
dc.description.abstractAn assertion is commonly used to validate the expected program’s behavior (e.g., if the returned value of a method equals an expected value) in software testing. Although it is a recommended practice to use only one assertion in a single test to avoid code smell (e.g., Assertion Roulette), we observe that it is common to have multiple assertions in a single test. One issue with tests that have multiple assertions is that when the test fails at an early assertion, the test will terminate at that point, and the remaining testing code will not be executed. This, in turn, can potentially reduce the code coverage and the performance of techniques that rely on code coverage information (e.g., spectrum-based fault localization). We refer to such a scenario as early test termination. Understanding the impact of early test termination on test coverage is important for software testing and debugging, particularly for the techniques that rely on coverage information obtained from the testing. In this study, we investigated 207 versions of 6 open-source projects. We found that a non-negligible portion of the failed tests (19.1%) is early terminated due to assertion failure, which leads to the skipping of 15.3% to 60.5% of the test code on average, and a negative impact on testing coverage. To mitigate early test termination, we propose two approaches, i.e., Trycatch (adding a try-catch block surrounding an assertion) and Slicing (slicing a test into a set of independent sub-tests, in which only one assertion and its dependent code are contained). After applying our approaches, the line/branch coverage get improved in 55% of the studied versions. Moreover, Slicing improves the performance of SBFL by 15.1% and 10.66% in terms of Mean First Rank (MFR) for Ochiai and Tarantula, respectively. We also provide actionable suggestions to prevent early test termination, and approaches to mitigate early test termination if it already exists in their project.
dc.description.noteOctober 2023
dc.identifier.urihttp://hdl.handle.net/1993/37498
dc.language.isoeng
dc.rightsopen accessen_US
dc.subjectCoverage
dc.subjectFault Localization
dc.subjectAssertion Failure
dc.subjectEarly Test Termination
dc.titleStudying the impact of early test termination due to assertion failure on code coverage and spectrum-based fault localization
dc.typemaster thesisen_US
local.subject.manitobano
oaire.awardNumberRGPIN-2021-03354
oaire.awardTitleNSERC – Discovery Grants
oaire.awardURIhttps://www.nserc-crsng.gc.ca/ase-oro/Details-Detailles_eng.asp?id=742509
project.funder.identifierNSERC: https://doi.org/10.13039/501100000038
project.funder.nameNatural Sciences and Engineering Research Council of Canada
Files
Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Thesis_UddinAshraf.pdf
Size:
582.14 KB
Format:
Adobe Portable Document Format
Description:
License bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
770 B
Format:
Item-specific license agreed to upon submission
Description: