Is Unit Testing Immune to Coincidental Correctness?

08/28/2018
by   Rawad Abou Assi, et al.
0

Researchers have previously shown that Coincidental Correctness (CC) is prevalent; however, the benchmarks they used are considered inadequate nowadays. They have also recognized the negative impact of CC on the effectiveness of fault localization and testing. The aim of this paper is to study Coincidental Correctness, using more realistic code, mainly from the perspective of unit testing. This stems from the fact that the practice of unit testing has grown tremendously in recent years due to the wide adoption of software development processes, such as Test-Driven Development. We quantified the presence of CC in unit testing using the Defects4J benchmark. This entailed manually injecting two code checkers for each of the 395 defects in Defects4J: 1) a weak checker that detects weak CC tests by monitoring whether the defect was reached; and 2) a strong checker that detects strong CC tests by monitoring whether the defect was reached and the program has transitioned into an infectious state. We also conducted preliminary experiments (using Defects4J, NanoXML and JTidy) to assess the pervasiveness of CC at the unit testing level in comparison to that at the integration and system levels. Our study showed that unit testing is not immune to CC, as it exhibited 7.2x more strong CC tests than failing tests and 8.3x more weak CC tests than failing tests. However, our preliminary results suggested that it might be less prone to CC than integration testing and system testing.

READ FULL TEXT
research
08/28/2018

Does the Testing Level affect the Prevalence of Coincidental Correctness?

Researchers have previously shown that Coincidental Correctness (CC) is ...
research
07/11/2023

Tests4Py: A Benchmark for System Testing

Benchmarks are among the main drivers of progress in software engineerin...
research
04/05/2019

On the Relation Between Unit Testing and Code Quality

Unit testing has been considered as having a key role in building high q...
research
09/19/2023

Revisiting and Improving Retrieval-Augmented Deep Assertion Generation

Unit testing validates the correctness of the unit under test and has be...
research
06/04/2022

Fault-Aware Neural Code Rankers

Large language models (LLMs) have demonstrated an impressive ability to ...
research
02/13/2023

Adaptive Test Generation Using a Large Language Model

Unit tests play a key role in ensuring the correctness of software. Howe...
research
11/02/2020

Reframing the Test Pyramid for Digitally Transformed Organizations

The test pyramid is a conceptual model that describes how quality checks...

Please sign up or login with your details

Forgot password? Click here to reset