Handling Test Smells in Python: Results from a Mixed-Method Study - Fernandes, Daniel; Machado, Ivan; Maciel, Rita (Anais do Simpósio Brasileiro de Engenharia de Software (SBES); 2021: Anais do XXXV Simpósio Brasileiro de Engenharia de Software, 2021)
Software testing is an activity in the software development process that looks for defects. Automated testing is composed of code that allows run software testing scenarios more quickly, avoiding manual rework. However, testers are likely to employ practices that might negatively impact test quality regarding maintainability, understandability, and effectiveness when writing test code. Such bad practices are also known as test smells. Although test smells are a language-independent concept, different programming languages could present different occurrence standards. Therefore, studies in one programming language may not be generalizable. This study aims to investigate how test smells occurrence in Python test files. Python became the most widely used programming language globally in 2020. However, most research on test code quality only considers the Java language. To accomplish our goals, we built a dataset with 5,303 test files from 90 Python projects collected from GitHub repositories to understand and analyze strategies for handling test smells in Python. This analysis allowed us to propose four new test smells, discussing their potential problems. We carried out a preliminary evaluation with 40 Python developers to validate their thoughts on the proposed test smells. These results are part of an ongoing research project aiming to propose a foundation to better support automation tests in Python.