TestAXE: Automatically Refactoring Test Smells Using JUnit 5 Features

  • Estevan Alexander de Paula UnB
  • Rodrigo Bonifácio UnB

Resumo


Test smells have been proven to deteriorate the quality of the test suite of a system, to the point where several different tools have been devised with the objective of detecting or sometimes even fixing these smells. Have been extensively studied in more recent years, these smells have been cataloged and researchers have proposed a series of source code transformations capable of eliminating these smells. Our goal in this paper is to present TESTAXE, a tool to refactor test smells using the latest features of JUnit 5. We present an empirical assessment of TESTAXE accuracy and highlight its current limitations.

Referências

Aljedaani, W., Peruma, A., Aljohani, A., Alotaibi, M., Mkaouer, M. W., Ouni, A., Newman, C. D., Ghallab, A., and Ludi, S. (2021). Test smell detection tools: A systematic mapping study. In Evaluation and Assessment in Software Engineering, EASE 2021, page 170-180, New York, NY, USA. Association for Computing Machinery.

Bavota, G., Qusef, A., Oliveto, R., Lucia, A. D., and Binkley, D. W. (2015). Are test smells really harmful? an empirical study. Empir. Softw. Eng., 20(4):1052-1094.

de Silva, L. and Balasubramaniam, D. (2012). Controlling software architecture erosion: A survey. Journal of Systems and Software, 85(1):132-151. Dynamic Analysis and Testing of Embedded Software.

Eick, S., Graves, T., Karr, A., Marron, J., and Mockus, A. (2001). Does code decay? assessing the evidence from change management data. IEEE Transactions on Software Engineering, 27(1):1-12.

Garousi, V. and Küçük, B. (2018). Smells in software test code: A survey of knowledge in industry and academia. J. Syst. Softw., 138:52-81.

Huo, C. and Clause, J. (2014). Improving oracle quality by detecting brittle assertions and unused inputs in tests. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2014, page 621-631, New York, NY, USA. Association for Computing Machinery.

Izurieta, C. and Bieman, J. M. (2007). How software designs decay: A pilot study of pattern evolution. In First International Symposium on Empirical Software Engineering and Measurement (ESEM 2007), pages 449-451.

Kim, D. J., Chen, T. P., and Yang, J. (2021). The secret life of test smells an empirical study on test smell evolution and maintenance. Empir. Softw. Eng., 26(5):100.

Klint, P., van der Storm, T., and Vinju, J. J. (2009). RASCAL: A domain specific language for source code analysis and manipulation. In Ninth IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2009, Edmonton, Alberta, Canada, September 20-21, 2009, pages 168-177. IEEE Computer Society.

Lambiase, S., Cupito, A., Pecorelli, F., De Lucia, A., and Palomba, F. (2020). Just-in-time test smell detection and refactoring: The darts project. In Proceedings of the 28th International Conference on Program Comprehension, ICPC '20, page 441-445, New York, NY, USA. Association for Computing Machinery.

Palomba, F., Zaidman, A., and De Lucia, A. (2018). Automatic test smell detection using information retrieval techniques. In 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 311-322.

Parnas, D. (1994). Software aging. In Proceedings of 16th International Conference on Software Engineering, pages 279-287.

Peruma, A., Almalki, K., Newman, C. D., Mkaouer, M. W., Ouni, A., and Palomba, F. (2020). Tsdetect: An open source test smells detection tool. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2020, page 1650-1654, New York, NY, USA. Association for Computing Machinery.

Pizzini, A. (2022). Behavior-based test smells refactoring : Toward an automatic approach to refactoring eager test and lazy test smells. In 2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), pages 261-263.

Santana, R., Martins, L. A., Rocha, L., Virgínio, T., Cruz, A., Costa, H. A. X., and Machado, I. (2020). RAIDE: a tool for assertion roulette and duplicate assert identification and refactoring. In 34th Brazilian Symposium on Software Engineering, SBES 2020, Natal, Brazil, October 19-23, 2020, pages 374-379. ACM.

Sjoberg, D. I., Yamashita, A., Anda, B. C., Mockus, A., and Dybå, T. (2013). Quantifying the effect of code smells on maintenance effort. IEEE Transactions on Software Engineering, 39(8):1144-1156.

Soares, E., Ribeiro, M., Gheyi, R., Amaral, G., and Santos, A. M. (2022). Refactoring test smells with junit 5: Why should developers keep up-to-date. IEEE Transactions on Software Engineering, pages 1-1.

Spadini, D., Palomba, F., Zaidman, A., Bruntink, M., and Bacchelli, A. (2018). On the relation of test smells to software code quality. In 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 1-12.

Tufano, M., Palomba, F., Bavota, G., Di Penta, M., Oliveto, R., De Lucia, A., and Poshyvanyk, D. (2016). An empirical investigation into the nature of test smells. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, ASE 2016, page 4-15, New York, NY, USA. Association for Computing Machinery.

Virgínio, T., Martins, L., Rocha, L., Santana, R., Cruz, A., Costa, H., and Machado, I. (2020). Jnose: Java test smell detector. In Proceedings of the 34th Brazilian Symposium on Software Engineering, SBES '20, page 564-569, New York, NY, USA. Association for Computing Machinery.

Virgínio, T., Santana, R., Martins, L. A., Soares, L. R., Costa, H., and Machado, I. (2019). On the influence of test smells on test coverage. In Proceedings of the XXXIII Brazilian Symposium on Software Engineering, SBES 2019, page 467-471, New York, NY, USA. Association for Computing Machinery.

Wu, H., Yin, R., Gao, J., Huang, Z., and Huang, H. (2022). To what extent can code quality be improved by eliminating test smells? In 2022 International Conference on Code Quality (ICCQ), pages 19-26.
Publicado
03/10/2022
PAULA, Estevan Alexander de; BONIFÁCIO, Rodrigo. TestAXE: Automatically Refactoring Test Smells Using JUnit 5 Features. In: CONCURSO DE TRABALHOS DE INICIAÇÃO CIENTÍFICA EM ENGENHARIA DE SOFTWARE(CTIC-ES) - CONGRESSO BRASILEIRO DE SOFTWARE: TEORIA E PRÁTICA (CBSOFT), 13. , 2022, Uberlândia/MG. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2022 . p. 89-98. DOI: https://doi.org/10.5753/cbsoft_estendido.2022.227655.