Tracets4J: A Traceable Unit Test Generation Dataset

Automated test case generation enhances the efficiency and quality of software testing. Learning-based test case generation methods require an understanding of the relationships between test cases and focal methods. Accurate traceability links between test cases and focal methods provide a clear relational model, facilitating more effective training of test case generation models. However, existing techniques frequently struggle to provide precise traceability links. We conduct an empirical study on the Methods2Test dataset, which includes a wide range of test cases and corresponding focal methods, to identify the limitations of current techniques. The causes of inaccurate traceability links are divided into two categories: incorrect extraction and missed extraction. The incorrect extraction category includes method overloading errors, name matching failures, and constructor ignorance. The missed extraction category involves constructor ignorance, similar but non-identical names, and difficulties in locating test classes involving subclasses. Based on the insights from this study, we propose Coach(Combine trACe Heuristics), an automated approach for establishing test-to-code traceability links. Coach establishes file-level and class-level links as a foundation, integrates multiple heuristics, and defines their scopes to build method-level links, improving both applicability and precision. We evaluate Coach against the M2T method (used in Methods2Test), the NC and LCBA baselines. Experimental results show that Coach outperforms other methods in terms of precision, coverage, and efficiency. In addition, we apply Coach to 19,518 real-world Java projects, creating a novel large-scale dataset called Tracets4J (TRACE TeSt for Java). Models fine-tuned on Tracets4J outperform those trained on the Methods2Test dataset, as shown by BLEU-4 and CodeBLEU. This demonstrates the superiority of Tracets4J and the effectiveness of Coach in improving test case generation.

Authors

Institutions

Publication Details

Published
2025-03-04
DOI
https://doi.org/10.1109/saner64311.2025.00077
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Tracets4J: A Traceable Unit Test Generation Dataset

Xin Tao Xia, Xing Hu, Junwei Zhang, Xuancheng Jin et al.
Software Testing and Debugging Techniques
article

Tracets4J: A Traceable Unit Test Generation Dataset

Xin Tao Xia, Xing Hu, Junwei Zhang, Xuancheng Jin, Zhuang Liu
article en

Abstract

Automated test case generation enhances the efficiency and quality of software testing. Learning-based test case generation methods require an understanding of the relationships between test cases and focal methods. Accurate traceability links between test cases and focal methods provide a clear relational model, facilitating more effective training of test case generation models. However, existing techniques frequently struggle to provide precise traceability links. We conduct an empirical study on the Methods2Test dataset, which includes a wide range of test cases and corresponding focal methods, to identify the limitations of current techniques. The causes of inaccurate traceability links are divided into two categories: incorrect extraction and missed extraction. The incorrect extraction category includes method overloading errors, name matching failures, and constructor ignorance. The missed extraction category involves constructor ignorance, similar but non-identical names, and difficulties in locating test classes involving subclasses. Based on the insights from this study, we propose Coach(Combine trACe Heuristics), an automated approach for establishing test-to-code traceability links. Coach establishes file-level and class-level links as a foundation, integrates multiple heuristics, and defines their scopes to build method-level links, improving both applicability and precision. We evaluate Coach against the M2T method (used in Methods2Test), the NC and LCBA baselines. Experimental results show that Coach outperforms other methods in terms of precision, coverage, and efficiency. In addition, we apply Coach to 19,518 real-world Java projects, creating a novel large-scale dataset called Tracets4J (TRACE TeSt for Java). Models fine-tuned on Tracets4J outperform those trained on the Methods2Test dataset, as shown by BLEU-4 and CodeBLEU. This demonstrates the superiority of Tracets4J and the effectiveness of Coach in improving test case generation.

Ningbo University (CN), Zhejiang University of Science and Technology (CN), Zhejiang University (CN)
Openalex Percentile: Top 90%
Software Testing and Debugging Techniques
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.