PyNose: A Test Smell Detector For Python
Tongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li, Timofey Bryksin, and Iftekhar Ahmed
November, 2021. Published in the proceedings of ASE'21 (A*).
Abstract. Similarly to production code, code smells also occur in test code, where they are called test smells. Test smells have a detrimental effect not only on test code but also on the production code that is being tested. To date, the majority of the research on test smells has been focusing on programming languages such as Java and Scala. However, there are no available automated tools to support the identification of test smells for Python, despite its rapid growth in popularity in recent years. In this paper, we strive to extend the research to Python, build a tool for detecting test smells in this language, and conduct an empirical analysis of test smells in Python projects.
We started by gathering a list of test smells from existing research and selecting test smells that can be considered language-agnostic or have similar functionality in Python's standard Unittest framework. In total, we identified 17 diverse test smells. Additionally, we searched for Python-specific test smells by mining frequent code change patterns that can be considered as either fixing or introducing test smells. Based on these changes, we proposed our own test smell called Suboptimal assert. To detect all these test smells, we developed a tool called PyNose in the form of a plugin to PyCharm, a popular Python IDE. Finally, we conducted a large-scale empirical investigation aimed at analyzing the prevalence of test smells in Python code. Our results show that 98% of the projects and 84% of the test suites in the studied dataset contain at least one test smell. Our proposed Suboptimal assert smell was detected in as much as 70.6% of the projects, making it a valuable addition to the list.
Paper Pre-print Data Tool VideoCiting publications
- Towards a Multidimensional Diagnostic Framework for Automated Test Quality Assessment
Victor Alves, Carla Bezerra, Marcio Delamaro · SBES Innovative Ideas track (author-reported acceptance) · 2026 - ОБУЧЕНИЕ С ПОДКРЕПЛЕНИЕМ В ЗАДАЧЕ ГЕНЕРАЦИИ ЮНИТ-ТЕСТОВ БОЛЬШИМИ ЯЗЫКОВЫМИ МОДЕЛЯМИ
ДО Киселев, ИГ Головин · ББК 22.18 Л75 · 2026 - Python テストスメルが被テストコードのバグ潜在性に及ぼす影響に関する定量分析
伏原裕生, 阿萬裕久, 川原稔 · コンピュータ ソフトウェア · 2026 - Understanding platform-specific code
R de Sousa Job · 2026 - Extender: A Multi-agent System for Code Extensibility Review
J Chen, J Shen · Proceedings of the 1st International Workshop on … · 2026 - TestMiner: Software Testing Analysis for GitHub Repositories
A Hora, JM Rojas, R Robbes · arXiv preprint arXiv:2607.12223 · 2026 - When Testing Meets Refactoring: Catalogue, Detection, and Recommendation
V Guerra Veloso · Proceedings of the 34th ACM International … · 2026 - Exploring test smells across programming languages: A systematic mapping study
P Silva, C Bezerra, I Machado, M Ribeiro · Journal of Systems and Software · 2026 - More than one million test smells: how are Dart projects and their sentiments?
T Virgínio, M Ribeiro, I Machado · Journal of Software … · 2026 - Test Smell Refactoring with Agentic LLMs: An Empirical Study of Gemini-2.5-Pro
RIE de Melo · Proceedings of the 2026 IEEE/ACM 48th International … · 2026 - Deep learning-based test smell prediction using hybrid AST sequence representations
NK Huynh, TB Dang, TB Nguyen · Journal of Systems and Software · 2026 - Hamster: A Large-Scale Study and Characterization of Developer-Written Tests
R Pan, T Stennett, R Pavuluri, N Levin, A Orso · Proceedings of the … · 2026 - CodeCureAgent: Automatic Classification and Repair of Static Analysis Warnings
P Joos, I Bouzenia, M Pradel · Proceedings of the ACM on Software … · 2026 - Delving into History: Retrieve Less but Augment More on Commit Message Generation
P Lan, J Liu, X Zhong, N Gui, L Bao, D Lo · ACM Transactions on … · 2026 - AgNose: A Framework-Agnostic Test Smell Detection Tool
A Cardoso, D Vieira, E Soares · Encontro Nacional de Computação … · 2025 - An Empirical Study of Test Utility Methods in Java and Python Projects
FF Kendemah · 2025 - AromaLIA: a language-independent approach to detect test smells
PBT Silva · 2025 - DNose: Dart Test Smell Detector
T Virgínio, M Ribeiro, I Machado · Simpósio Brasileiro de Engenharia … · 2025 - Enhancing Test Smell Prediction with Stacking Ensemble Learning
KN Huynh, BT Dang, BT Nguyen · Conference on Information Technology … · 2025 - On the prevalence of test smells in mobile development
T Virgínio, M Ribeiro, I Machado · Simpósio Brasileiro de Testes de … · 2025 - Decoding Python Smells: An Object-Oriented Metrics-Based Learning Model
A Goyal, P Bhutani · International Conference on Artificial Intelligence and … · 2025 - Ensemble Machine Learning-Based Test Smell Prediction
KH Ngoc, HT Nhat · International Conference on Intelligence of Things · 2025 - Identifying and Addressing Test Smells in JavaScript: A Developer-Centric Study
J Oliveira, L Mateus, G Amaral, T Virgínio · Simpósio Brasileiro de … · 2025 - Using Dynamic and Static Techniques to Establish Traceability Links Between Production Code and Test Code on Python Projects: A Replication Study
Z Chen, C Jia, Y Li, L Chen · Journal of Software: Evolution … · 2025 - Understanding and Identifying Technical Debt in the Co-Evolution of Production and Test Code
Y Guo, Z Chen, L Xiao, L Chen, Y Li · IEEE Transactions on … · 2025 - Aromadr: a language-independent tool for detecting test smells
P Silva, C Bezerra, I Machado · Simpósio Brasileiro de … · 2025 - Improving javascript test quality with large language models: lessons from test smell refactoring
G Amaral, H Gomes, E Figueiredo · Simpósio Brasileiro de … · 2025 - On the Implementation of OS-Specific Tests: The CPython Case
R Job, A Hora · Simpósio Brasileiro de Testes de Software … · 2025 - VRTestSniffer: Test Smell Detector for Virtual Reality (VR) Software Projects
F Gurramkonda, A Chakroborty · 2025 40th IEEE/ACM … · 2025 - Understanding Test Deletion in Java Applications
S Bhatta, F Kendemah, AK Jha · 2025 IEEE/ACM 22nd … · 2025 - Prioritizing test smells: An empirical evaluation of quality metrics and developer perceptions
MA Hasan, T Ahammed · 2025 IEEE International Conference … · 2025 - Evaluating llms effectiveness in detecting and correcting test smells: An empirical study
EG Santana Jr, JPS Junior, EP Almeida · arXiv preprint arXiv … · 2025 - DPy: Code Smells Detection Tool for Python
A Boloori, T Sharma · 2025 IEEE/ACM 22nd International … · 2025 - Test smell: A parasitic energy consumer in software testing
MRH Misu, J Li, A Bhattiprolu, Y Liu · Information and … · 2025 - Quality assessment of Python tests generated by large language models
V Alves, C Bezerra, I Machado, L Rocha · Proceedings of the 29th … · 2025 - How and why developers implement OS-specific tests
R Job, A Hora · Empirical Software Engineering · 2025 - Agentic LMs: Hunting Down Test Smells
R Melo, P Simões, R Gheyi, M d'Amorim · IEEE … · 2025 - DyLin: A dynamic linter for Python
A Eghbali, F Burk, M Pradel · Proceedings of the ACM on Software … · 2025 - Automated unit test refactoring
Y Gao, X Hu, X Yang, X Xia · Proceedings of the ACM on Software … · 2025 - Detecting Test Smells in Python Test Code Generated by LLM: An Empirical Study with GitHub Copilot
Victor Anthony Alves, Cristiano Santos, Carla Bezerra, Ivan Machado · Simpósio Brasileiro de Engenharia de Software (SBES) · 2024 - Python テストスメルのバグ予測子としての有用性に関する定量的分析
伏原裕生, 阿萬裕久, 川原稔 · ソフトウェア工学の基礎ワークショップ … · 2024 - SENTINEL: PROCESSO PARA REMOÇÃO AUTOMÁTICA DE TEST SMELLS
A PIZZINI · 2024 - Automated Software Quality Enhancement: Unit Testing in Python
H Wang · 2024 - A multimethod study of test smells: Cataloging removal and new types
E Soares, M Ribeiro, A Santos · … of the XXIII Brazilian Symposium on … · 2024 - Software Development Practices and Tools for University-Industry R&D projects
DT Cruz, EP Almeida, JP Santos, FSA Paixão · Proceedings of the XXIII … · 2024 - Toward a language-agnostic approach to detect test smells
PBT Silva, C Bezerra, I Machado · Simpósio Brasileiro de Engenharia … · 2024 - Enhancing software quality: Python code smell detection using machine learning techniques and refactoring long methods using extract method algorithm
MS Uddin, KZQ Knobo, J Ferdoshi, S Abdullah · Proceedings of the … · 2024 - Understanding the prevalence of test smells in open-source and industrial software: An empirical study on python projects
MA Hasan, T Ahammed · 12th International Workshop on Quantitative … · 2024 - Evaluating test quality of Python libraries for IoT applications at the network edge
Z Chen, C Jia, L Chen · Wireless Networks · 2024 - A road to find them all: Towards an agnostic strategy for test smell detection
G Lopes, D Romão, E Soares, M Ribeiro · Proceedings of the XXIII … · 2024 - SNUTS. js: Sniffing Nasty Unit Test Smells in Javascript
J Oliveira, L Mateus, T Virgínio, L Rocha · Simpósio Brasileiro de … · 2024 - Fault-proneness of python programs tested by smelled test code
Y Fushihara, H Aman, S Amasaki · 2024 50th Euromicro … · 2024 - xNose: A Test Smell Detector for C
PP Paul, MT Akanda, MR Ullah, D Mondal · arXiv preprint arXiv … · 2024 - “No Free Lunch” when using Large Language Models to Verify Self-Generated Programs
S Zilberman, HCB Cheng · 2024 IEEE International … · 2024 - Chat-like asserts prediction with the support of large language model
H Wang, H Hu, C Chen, B Turhan · arXiv preprint arXiv:2407.21429 · 2024 - Development of code evaluation system based on abstract syntax tree
ATP Nguyen, VD Hoang · Journal of Technical Education Science · 2024 - The lost world: Characterizing and detecting undiscovered test smells
Y Yang, X Hu, X Xia, X Yang · ACM Transactions on Software … · 2024 - Beyond accuracy: An empirical study on unit testing in open-source deep learning projects
H Wang, S Yu, C Chen, B Turhan, X Zhu · ACM Transactions on … · 2024 - Machine learning-based test smell detection
V Pontillo, D Amoroso d'Aragona, F Pecorelli · Empirical Software … · 2024 - Unprecedented code change automation: The fusion of llms and transformation by example
M Dilhara, A Bellur, T Bryksin, D Dig · Proceedings of the ACM on … · 2024 - Python テストコードの連続変更コミットにおけるテストスメルの変化動向
伏原裕生, 阿萬裕久, 川原稔 · ソフトウェア工学の基礎ワークショップ … · 2023 - Exploration of the Feasibility and Applicability of Domain Adaptation in Machine Learning-Based Code Smell Detection
P Sukkasem, C Soomlek · International Conference on Data Science and … · 2023 - A trend analysis of test smells in python test code over commit history
Y Fushihara, H Aman, S Amasaki · 2023 49th Euromicro … · 2023 - Automating data analysis with Python: A comparative study of popular libraries and their application
P Bhardwaj, C Choudhury · 2023 3rd International … · 2023 - Pyevolve: Automating frequent code changes in python ml systems
M Dilhara, D Dig, A Ketkar · 2023 IEEE/ACM 45th International … · 2023 - The smelly eight: An empirical study on the prevalence of code smells in quantum computing
Q Chen, R Câmara, J Campos · 2023 IEEE/ACM 45th … · 2023 - Python code smells detection using conventional machine learning models
R Sandouka, H Aljamaan · PeerJ Computer Science · 2023 - From commit message generation to history-aware commit message completion
A Eliseeva, Y Sokolov, E Bogomolov · 2023 38th IEEE/ACM … · 2023 - Identificação e Caracterização de Test Smells em JavaScript
AC Silva · Instituto de Ciencias Exatas e Informática-Pontifícia … · 2022 - Students vs. professionals: improving the learning of software testing
Z Chen · Proceedings of the ACM/IEEE 44th International … · 2022 - Efficiently and precisely searching for code changes with DiffSearch
L Di Grazia · Proceedings of the ACM/IEEE 44th International … · 2022 - TEMPY: Test smell detector for Python
D Fernandes, I Machado, R Maciel · Proceedings of the XXXVI Brazilian … · 2022 - Pytest-Smell: a smell detection tool for Python unit tests
A Bodea · Proceedings of the 31st ACM SIGSOFT international … · 2022 - Static test flakiness prediction: How far can we go?
V Pontillo, F Palomba, F Ferrucci · Empirical Software Engineering · 2022 - Python code smell detection using machine learning
N Vatanapakorn, C Soomlek · … Computer Science and … · 2022 - DynaPyt: a dynamic analysis framework for Python
A Eghbali, M Pradel · Proceedings of the 30th ACM Joint European … · 2022
