Toward a Language-Agnostic Approach to Detect Test Smells

Tests play a crucial role in software development by ensuring code quality. However, test code can suffer from “smells” — poor implementation choices that hinder maintainability and evolution. Numerous studies have addressed test smells in various programming languages, proposing tools for detecting them in Java, C++, Scala, and others. These tools employ techniques such as information retrieval, metrics analysis, and abstract syntax tree (AST) parsing. However, their focus on specific languages limits their generalizability and applicability to other languages and test frameworks. This challenge is similar to issues found in code smell detection and static code analysis. Therefore, this work proposes a language-agnostic approach to detect test smells. Our approach leverages AST parsing to extract relevant information from the test code, followed by test smell detection based on this extracted data. This method aims to facilitate the detection of test smells across various programming languages and test frameworks, enhancing the tool’s generalizability and usability. To check the viability of our approach, we created a proof of concept using two test smells and two different languages.

Authors

Institutions

Publication Details

Published
2024-09-30
DOI
https://doi.org/10.5753/sbes.2024.3647
Citations
2
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.97

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Toward a Language-Agnostic Approach to Detect Test Smells

Carla Bezerra, Públio Silva, Ivan Machado
2 citations
Software Testing and Debugging Techniques
0.97
article

Toward a Language-Agnostic Approach to Detect Test Smells

Carla Bezerra, Públio Silva, Ivan Machado
article en
2 citations

Abstract

Tests play a crucial role in software development by ensuring code quality. However, test code can suffer from “smells” — poor implementation choices that hinder maintainability and evolution. Numerous studies have addressed test smells in various programming languages, proposing tools for detecting them in Java, C++, Scala, and others. These tools employ techniques such as information retrieval, metrics analysis, and abstract syntax tree (AST) parsing. However, their focus on specific languages limits their generalizability and applicability to other languages and test frameworks. This challenge is similar to issues found in code smell detection and static code analysis. Therefore, this work proposes a language-agnostic approach to detect test smells. Our approach leverages AST parsing to extract relevant information from the test code, followed by test smell detection based on this extracted data. This method aims to facilitate the detection of test smells across various programming languages and test frameworks, enhancing the tool’s generalizability and usability. To check the viability of our approach, we created a proof of concept using two test smells and two different languages.

United Food and Commercial Workers (US)
Coordenação de Aperfeiçoamento de Pessoal de Nível Superior, Conselho Nacional de Desenvolvimento Científico e Tecnológico, Fundação de Amparo à Pesquisa do Estado da Bahia
Openalex Percentile: Top 21%
Software Testing and Debugging Techniques
0.97
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.