On the diffusion of test smells and their relationship with test code quality of Java']Java projects

被引:5
|
作者
Martins, Luana [1 ]
Costa, Heitor [2 ]
Machado, Ivan [1 ]
机构
[1] Univ Fed Bahia, Inst Comp, Salvador, BA, Brazil
[2] Univ Fed Lavras, Dept Comp Sci, Lavras, Brazil
关键词
Dataset; Replication study; Structural metrics; Test smells; METRICS;
D O I
10.1002/smr.2532
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Test smells are considered bad practices that can reduce the test code quality, thus harming software testing goals and maintenance activities. Prior studies have investigated the diffusion of test smells and their impact on test code maintainability. However, we cannot directly compare the outcomes of the studies as most of them use customized datasets. In response, we introduced the TSSM (Test Smells and Structural Metrics) dataset, containing test smells detected using the JNose Test tool and structural metrics (test code and production code) calculated with the CK metrics tool of 13,703 open-source Java systems from GitHub. In addition, we perform an empirical study to investigate the relationship between test smells and structural metrics of test code and the relationship between test smells on a large-scale dataset. We split the projects into three clusters to analyze the distribution of test smells, the co-occurrences among test smells, and the correlation of test smells and structural metrics of test code. The ratio of smelly test classes with a specific test smell is similar among the clusters, but we could observe a significant difference in the number of test smells among them. The test smells Sleepy Test, Mystery Guest, and Resource Optimism rarely occur in the three clusters, and the last two are strongly correlated, indicating that those test smells are more severe than others. Our results point out that most test smells have a moderate correlation with high complexity, large size, and coupling of the test code, indicating that they can also negatively affect its quality. To support further studies, we made our dataset publicly available.
引用
收藏
页数:20
相关论文
共 50 条
  • [1] Java']Java quality assurance by detecting code smells
    van Emden, E
    Moonen, L
    NINTH WORKING CONFERENCE ON REVERSE ENGINEERING, PROCEEDINGS, 2002, : 97 - 106
  • [2] A multi-label classification approach for detecting test smells over java']java projects
    Hadj-Kacem, Mouna
    Bouassida, Nadia
    JOURNAL OF KING SAUD UNIVERSITY-COMPUTER AND INFORMATION SCIENCES, 2022, 34 (10) : 8692 - 8701
  • [3] An Empirical Study of Code Smells in Java']JavaScript Projects
    Saboury, Amir
    Musavi, Pooya
    Khomh, Foutse
    Antoniol, Giulio
    2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2017, : 294 - 305
  • [4] Java']Java Code Coverage Test Technology Based on EMMA
    Liu, Yanyun
    Hu, Bin
    Rao, Liping
    Pan, Lin
    MODERN TECHNOLOGIES IN MATERIALS, MECHANICS AND INTELLIGENT SYSTEMS, 2014, 1049 : 2069 - 2072
  • [5] JTeC: A Large Collection of Java']Java Test Classes for Test Code Analysis and Processing
    Coro, Federico
    Verdecchia, Roberto
    Cruciani, Emilio
    Miranda, Breno
    Bertolino, Antonia
    2020 IEEE/ACM 17TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2020, : 578 - 582
  • [6] Dependency Smells in Java']JavaScript Projects
    Jafari, Abbas Javan
    Costa, Diego Elias
    Abdalkareem, Rabe
    Shihab, Emad
    Tsantalis, Nikolaos
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (10) : 3790 - 3807
  • [7] A Systematic Literature Review: Code Bad Smells in Java']Java Source Code
    Gupta, Aakanshi
    Suri, Bharti
    Misra, Sanjay
    COMPUTATIONAL SCIENCE AND ITS APPLICATIONS - ICCSA 2017, PT V, 2017, 10408 : 665 - 682
  • [8] A large-scale empirical study of code smells in Java']JavaScript projects
    Johannes, David
    Khomh, Foutse
    Antoniol, Giuliano
    SOFTWARE QUALITY JOURNAL, 2019, 27 (03) : 1271 - 1314
  • [9] A comprehensive catalog of refactoring strategies to handle test smells in Java']Java-based systems
    Martins, Luana
    Ghaleb, Taher A.
    Costa, Heitor
    Machado, Ivan
    SOFTWARE QUALITY JOURNAL, 2024, 32 (02) : 641 - 679
  • [10] A Catalog of Object-Relational Mapping Code Smells for Java']Java
    Loli, Samuel
    Teixeira, Leopoldo
    Cartaxo, Bruno
    34TH BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING, SBES 2020, 2020, : 82 - 91