Investigating the Developer’s Perceptions of Unit Testing and Its Practice
Resumo
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.
Referências
de Mello, R., da Silva, P., and Travassos, G. (2014a). Agilidade em processos de software: Evidências sobre caracteristicas de agilidade e práticas Ágeis. In "Anais do XIII Simpósio Brasileiro de Qualidade de Software", pages 151–165, Porto Alegre, RS, Brasil. SBC.
de Mello, R. M., da Silva, P. C., and Travassos, G. H. (2014b). Agilidade em processos de software: Evidencias sobre características de agilidade e práticas ágeis. In Anais do XIII Simpósio Brasileiro de Qualidade de Software, pages 151–165. SBC.
de O. Passos, A. F., de Freitas Farias, M. A., de Mendonça Neto, M. G., and Spínola, R. O. (2018). A study on identification of documentation and requirement technical debt through code comment analysis. In Proceedings of the XVII Brazilian Symposium on Software Quality, pages 21–30
de Souza, A., dos Santos, F., dos Santos, L., Belém, P., da Silva, S., Vivacqua, A., and de Mello, R. (2023). Investigando a percepção de feedback em times de desenvolvimento de software: Um estudo inicial. In Anais do VIII Workshop sobre Aspectos Sociais, Humanos e Econômicos de Software, pages 91–100. SBC.
Garousi, V. and Mäntylä, M. V. (2016). A systematic literature review of literature reviews in software testing. Information and Software Technology, 80:195–216.
Hogg, M. A. and Vaughan, G. M. (1995). Social psychology: An introduction. Harvester Wheatsheaf.
Lappalainen, V., Itkonen, J., Isomöttönen, V., and Kollanus, S. (2010). Comtest: a tool to impart tdd and unit testing to introductory level programming. In Proceedings of the fifteenth annual conference on Innovation and technology in computer science education, pages 63–67.
Li, J., Conradi, R., Slyngstad, O. P., Torchiano, M., Morisio, M., and Bunse, C. (2008). A state-of-the-practice survey of risk management in development with off-the-shelf software components. IEEE Transactions on software Engineering, 34(2):271–286.
Linaker, J., Sulaman, S. M., Host, M., and de Mello, R. M. (2015). Guidelines for conducting surveys in software engineering v. 1.1. Lund University, 50.
Martins, T. F. R. and Braga, T. F. (2016). Framework para geração de teste unitário.
Moscovici, S. (1988). Notes towards a description of social representations. European journal of social psychology, 18(3):211–250.
Prado, M. P. and Vincenzi, A. M. R. (2018). Towards cognitive support for unit testing: A qualitative study with practitioners. Journal of Systems and Software, 141:66–84.
Rana, I., Goswami, P., and Maheshwari, H. (2019). A review of tools and techniques used in software testing. Int. J. Emerg. Technol. Innovative Res, 6(4):262–266.
Runeson, P. (2006). A survey of unit testing practices. IEEE software, v. 23, n. 4, p. 22-29.
Saloum, R. (2019). The impact of gamification in unit testing. Department of Computer Science and Engineering - University of Gothenburg.
Torchiano, M., Fernandez, D. M., Travassos, G. H., and de Mello, R. M. (2017). Lessons learnt in conducting survey research. In 2017 IEEE/ACM 5th International Workshop on Conducting Empirical Studies in Industry (CESI), pages 33–39. IEEE.
Virgínio, T. G. A. and Machado, I. (2021). Avalição empírica da geração automatizada de testes de software sob a perspectiva de test smells. In Anais Estendidos do XII Congresso Brasileiro de Software: Teoria e Prática, pages 112–126. SBC.
Xie, T., Tillmann, N., and Lakshman, P. (2016). Advances in unit testing: theory and practice. In Proceedings of the 38th international conference on software engineering companion, pages 904–905.