# On the Relation Between Unit Testing and Code Quality

**Authors:** Lucas Gren, Vard Antinyan

arXiv: 1904.04748 · 2019-04-10

## TL;DR

This study investigates the relationship between unit testing practices and software quality, finding weak or no correlation, and highlights the need for further research on testing effectiveness.

## Contribution

It provides empirical data from surveys and a case study showing limited correlation between unit testing and code quality, challenging assumptions about their direct relationship.

## Key findings

- Weak correlation between unit test coverage and defects
- Practitioners' perception of quality not strongly linked to testing practices
- Calls for more research on testing effectiveness

## Abstract

Unit testing has been considered as having a key role in building high quality software, and therefore it has been widely used in practice. However, data on the relationship between unit testing and aspects of software quality remain scarce. A survey study with 235 survey responses from seven organizations was conducted in order to understand the correlation between practitioners' perception of code quality and unit testing practices. In addition, we conducted a case study in one of these organizations to investigate the correlation between unit test coverage and post-unit test defects. In both cases none or weak correlations were found. We recommend further research on the effectiveness of different testing practices in order to help practitioners to understand how to best allocate their resources to the testing chain.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1904.04748/full.md

## Figures

1 figure with captions in the complete paper: https://tomesphere.com/paper/1904.04748/full.md

## References

18 references — full list in the complete paper: https://tomesphere.com/paper/1904.04748/full.md

---
Source: https://tomesphere.com/paper/1904.04748