Investigating the Developer’s Perceptions of Unit Testing and Its Practice

Lidvaldo José dos Santos, Fernanda Izabele Nascimento dos Santos, Renan Parreira, Rafael de Mello · 2023

Unit testing is an important and largely disseminated software engineering activity, contributing to the prevention of defects in source code elements before running more comprehensive tests. However, developers typically perform unit tests ad-hoc, lacking in coverage and quality. Consequently, the unit testing practice remains informal and strongly influenced by developers’ initiative. We report in this paper an opinion survey on the developers’ perceptions of unit testing and its practice. We conducted the survey with 32 developers from two Brazilian companies. The survey findings revealed that developers from both companies tend to share positive beliefs about the relevance of unit testing. However, they also tend to share negative perceptions about its practice in their working environments. Besides, we found a positive moderate correlation between the developers’ motivation and their perceptions about the training, frequency, and time allocated for unit testing. The survey results reveal the dissonance between the developers’ beliefs about unit testing and their practice, influenced by issues in their working environments. This dissonance may lead to a lack of commitment and internal conflicts.

Read the paper · More papers on PaperTik