Studying Test Annotation Maintenance in the Wild
Dong Jae Kim, Nikolaos Tsantalis, Tse-Hsun Peter Chen, Jinqiu Yang
Abstract
Since the introduction of annotations in Java 5, the majority of testing frameworks, such as JUnit, TestNG, and Mockito, have adopted annotations in their core design. This adoption affected the testing practices in every step of the test life-cycle, from fixture setup and test execution to fixture teardown. Despite the importance of test annotations, most research on test maintenance has mainly focused on test code quality and test assertions. As a result, there is little empirical evidence on the evolution and maintenance of test annotations. To fill this gap, we perform the first fine-grained empirical study on annotation changes. We developed a tool to mine 82,810 commits and detect 23,936 instances of test annotation changes from 12 open-source Java projects. Our main findings are: (1) Test annotation changes are more frequent than rename and type change refactorings. (2) We recover various migration efforts within the same testing framework or between different frameworks by analyzing common annotation replacement patterns. (3) We create a taxonomy by manually inspecting and classifying a sample of 368 test annotation changes and documenting the motivations driving these changes. Finally, we present a list of actionable implications for developers, researchers, and framework designers.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6bcd2097-fb98-4b02-91a4-2c95df852f81Cited by top-tier papers4
- Understanding Solidity Event Logging Practices in the WildLantian Li, Yejian Liang, Zhihao Liu, Zhongxing YuFSE 2023 · 13 citations
- How disabled tests manifest in test maintainability challenges?Dong Jae Kim, Bo Yang, Jinqiu Yang, Tse-Hsun (Peter) ChenFSE 2021 · 9 citations
- Understanding and Detecting Annotation-Induced Faults of Static AnalyzersHuaien Zhang, Yu Pei, Shuyun Liang, Shin Hwei TanFSE 2024 · 4 citations
- A First Look at the Inheritance-Induced Redundant Test ExecutionDong Jae Kim, Jinqiu Yang, Tse-Hsun ChenICSE 2024 · 2 citations
Builds on1
Related papers
- An automatic refactoring framework for replacing test-production inheritance by mocking mechanismXiao Wang, Lu Xiao, Tingting Yu, Anne Woepse et al.FSE 2021 · 15 citations
- The evolution of type annotations in python: an empirical studyLuca Di Grazia, Michael PradelFSE 2022 · 29 citations
- Testability Refactoring in Pull Requests: Patterns and TrendsPavel Reich, Walid MaalejICSE 2023 · 4 citations
- A large-scale empirical study on Java library migrations: prevalence, trends, and rationalesHao He, Runzhi He, Haiqiao Gu, Minghui ZhouFSE 2021 · 47 citations
- A Comprehensive Study on Quality Assurance Tools for JavaHan Liu, Sen Chen, Ruitao Feng, Chengwei Liu et al.ISSTA 2023 · 12 citations
