DANTES: Automating Detection and Refactoring of Test Smells
Resumo
Test smells affect software quality and hinder code maintenance. Refactoring test code is the main way to address these problems. However, manually refactoring is not a simple task and is usually tedious and error-prone. This study aims to present dantes, a tool for automatically detecting and refactoring eleven different types of test smells. We introduce eleven original refactoring algorithms. We conducted a study to evaluate the tool from the perspective of perceived usefulness and ease of use. Results show that dantes is well received by professionals and academics in the field. Demo video: https://youtu.be/uc5G6JMXtBs
Referências
Wajdi Aljedaani, Anthony Peruma, Ahmed Aljohani, Mazen Alotaibi, Mohamed Wiem Mkaouer, Ali Ouni, Christian D. Newman, Abdullatif Ghallab, and Stephanie Ludi. 2021. Test Smell Detection Tools: A Systematic Mapping Study. In Proceedings of the 25th International Conference on Evaluation and Assessment in Software Engineering (Trondheim, Norway) (EASE ’21). Association for Computing Machinery, New York, NY, USA, 170–180. DOI: 10.1145/3463274.3463335
Muhammad Ali Babar, Dietmar Winkler, and Stefan Biffl. 2007. Evaluating the Usefulness and Ease of Use of a Groupware Tool for the Software Architecture Evaluation Process. In First International Symposium on Empirical Software Engineering and Measurement (ESEM 2007). IEEE, Madrid, Spain, 430–439. DOI: 10.1109/ESEM.2007.48
Paul Baker, Dominic Evans, Jens Grabowski, Helmut Neukirchen, and Benjamin Zeiss. 2006. TRex - The Refactoring and Metrics Tool for TTCN-3 Test Specifications.. In Testing: Academic & Industrial Conference - Practice And Research Techniques (TAIC PART’06). IEEE, Windsor, UK, 90–94. DOI: 10.1109/TAICPART.2006.35
Fred D. Davis. 1989. Perceived Usefulness, Perceived Ease of Use, and User Acceptance of Information Technology. MIS Quarterly 13, 3 (1989), 319–340. [link]
Martin Fowler. 2018. Refactoring. Addison-Wesley Professional, Boston.
Innovation Graph. 2025. Programming Languages - Global Metrics. [link]
Muhammad Abid Jamil, Muhammad Arif, Normi Sham Awang Abubakar, and Akhlaq Ahmad. 2016. Software Testing Techniques: A Literature Review. In 2016 6th International Conference on Information and Communication Technology for The Muslim World (ICT4M). IEEE, Jakarta, Indonesia, 177–182. DOI: 10. 1109/ICT4M.2016.045
Vladimir Khorikov. 2020. Unit Testing Principles, Practices, and Patterns. Manning Publications, New York.
Guilherme Lacerda, Fabio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc. 2020. Code smells and refactoring: A tertiary systematic review of challenges and observations. Journal of Systems and Software 167 (2020), 110610.
Stefano Lambiase, Andrea Cupito, Fabiano Pecorelli, Andrea De Lucia, and Fabio Palomba. 2020. Just-In-Time Test Smell Detection and Refactoring: The DARTS Project. In Proceedings of the 28th International Conference on Program Comprehension (Seoul, Republic of Korea) (ICPC ’20). Association for Computing Machinery, New York, NY, USA, 441–445. DOI: 10.1145/3387904.3389296
Luana Martins, Denivan Campos, Railana Santana, Joselito Mota Junior, Heitor Costa, and Ivan Machado. 2023. Hearing the voice of experts: Unveiling Stack Exchange communities’ knowledge of test smells. In 2023 IEEE/ACM 16th International Conference on Cooperative and Human Aspects of Software Engineering (CHASE). IEEE, 80–91.
Alok Mishra and Ziadoon Otaiwi. 2020. DevOps and software quality: A systematic mapping. Computer Science Review 38 (2020), 100308.
Sanjay Misra, Adewole Adewumi, Rytis Maskeli¯unas, Robertas Damaševičius, and Ferid Cafer. 2018. Unit testing in global software development environment. In Data Science and Analytics: 4th International Conference on Recent Developments in Science, Engineering and Technology, REDSET 2017, Gurgaon, India, October 13-14, 2017, Revised Selected Papers 4. Springer, Springer, Singapore, 309–317.
Priyadarshi Naik, Kshirasagar e Tripathy. 2016. Software testing and quality assurance (2 ed.). John Wiley & Sons, Nashville, TN.
Padmalata Nistala, Kesav Vithal Nori, and Raghu Reddy. 2019. Software Quality Models: A Systematic Mapping Study. In 2019 IEEE/ACM International Conference on Software and System Processes (ICSSP). IEEE, Montreal, QC, Canada, 125–134. DOI: 10.1109/ICSSP.2019.00025
Tauhida Parveen, Scott Tilley, Nigel Daley, and Pedro Morales. 2009. Towards a distributed execution framework for JUnit test cases. In 2009 IEEE International Conference on Software Maintenance. IEEE, Edmonton, AB, Canada, 425–428. DOI: 10.1109/ICSM.2009.5306292
Zedong Peng, Xuanyi Lin, and Nan Niu. 2020. Unit tests of scientific software: A study on SWMM. In Computational Science–ICCS 2020: 20th International Conference, Amsterdam, The Netherlands, June 3–5, 2020, Proceedings, Part VII 20. Springer, Springer, Amsterdam, 413–427.
Anthony Peruma, Khalid Almalki, Christian D. Newman, Mohamed Wiem Mkaouer, Ali Ouni, and Fabio Palomba. 2019. On the Distribution of Test Smells in Open Source Android Applications: An Exploratory Study. In 29th Annual International Conference on Computer Science and Software Engineering (Toronto, Ontario, Canada) (CASCON ’19). IBM Corp., USA, 193–202.
Anthony Peruma, Khalid Almalki, Christian D. Newman, Mohamed Wiem Mkaouer, Ali Ouni, and Fabio Palomba. 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 (Virtual Event, USA) (ESEC/FSE 2020). Association for Computing Machinery, New York, NY, USA, 1650–1654. DOI: 10.1145/3368089.3417921
Railana Santana, Daniel Fernandes, Denivan Campos, Larissa Soares, Rita Maciel, and Ivan Machado. 2021. Understanding Practitioners’ Strategies to Handle Test Smells: A Multi-Method Study. ACM, New York, NY, USA, 49–53.
Railana Santana, Luana Martins, Larissa Rocha, Tássio Virgínio, Adriana Cruz, Heitor Costa, and Ivan Machado. 2020. RAIDE: A Tool for Assertion Roulette and Duplicate Assert Identification and Refactoring. In Proceedings of the XXXIV Brazilian Symposium on Software Engineering (Natal, Brazil) (SBES ’20). Association for Computing Machinery, New York, NY, USA, 374–379. DOI: 10.1145/3422392.3422510
Railana Santana, Luana Martins, Tássio Virgínio, Larissa Rocha, Heitor Costa, and Ivan Machado. 2024. An empirical evaluation of RAIDE: A semi-automated approach for test smells detection and refactoring. Science of Computer Programming 231 (2024), 103013.
Railana Santana, Luana Martins, Tássio Virgínio, Larissa Soares, Heitor Costa, and Ivan Machado. 2022. Refactoring Assertion Roulette and Duplicate Assert test smells: a controlled experiment. In Anais do XXV Congresso Ibero-Americano em Engenharia de Software (Córdoba). SBC, Porto Alegre, RS, Brasil, 263–277. DOI: 10.5753/cibse.2022.20977
Elvys Soares, Márcio Ribeiro, Rohit Gheyi, Guilherme Amaral, and André Santos. 2023. Refactoring Test Smells With JUnit 5: Why Should Developers Keep Up-to-Date? IEEE Transactions on Software Engineering 49, 3 (2023), 1152–1170. DOI: 10.1109/TSE.2022.3172654
Daniel Toll and Tobias Olsson. 2012. Why is Unit-testing in Computer Games Difficult?. In 2012 16th European Conference on Software Maintenance and Reengineering. IEEE, Szeged, Hungary, 373–378. DOI: 10.1109/CSMR.2012.46
Arie Van Deursen, Leon Moonen, Alex Van Den Bergh, and Gerard Kok. 2001. Refactoring test code. In Proceedings of the 2nd international conference on extreme programming and flexible processes in software engineering (XP2001). Citeseer, CWI (Centre for Mathematics and Computer Science), Amsterdam, The Netherlands, The Netherlands, 92–95.
Tássio Virgínio, Luana Martins, Larissa Rocha, Railana Santana, Adriana Cruz, Heitor Costa, and Ivan Machado. 2020. JNose: Java Test Smell Detector. In Proceedings of the XXXIV Brazilian Symposium on Software Engineering (Natal, Brazil) (SBES ’20). Association for Computing Machinery, New York, NY, USA, 564–569. DOI: 10.1145/3422392.3422499
Tássio Virgínio, Luana Martins, Larissa Rocha, Railana Santana, Adriana Cruz, Heitor Costa, and Ivan Machado. 2020. JNose: Java Test Smell Detector. In Proceedings of the XXXIV Brazilian Symposium on Software Engineering - Tools Track (Virtual Conference) (SBES 2020). ACM, New York, NY, USA, 6 pages.
Tássio Virgínio, Luana Martins, Railana Santana, Adriana Cruz, Larissa Rocha, Heitor Costa, and Ivan Machado. 2021. On the test smells detection: an empirical study on the jnose test accuracy. Journal of Software Engineering Research and Development 9 (2021), 8–1.
Tássio Virgínio, Railana Santana, Luana Almeida Martins, Larissa Rocha Soares, Heitor Costa, and Ivan Machado. 2019. On the influence of Test Smells on Test Coverage. In Proceedings of the XXXIII Brazilian Symposium on Software Engineering (Salvador, Brazil) (SBES ’19). Association for Computing Machinery, New York, NY, USA, 467–471. DOI: 10.1145/3350768.3350775
