Reconstructing Objects for Software Testing

Software testing requires developers to build nontrivial object states to thoroughly exercise programs that process data structures. Manually building these test cases is an effort-demanding activity. The execution of software in production is an enormous source of program states, which can be serialized to synthesize test inputs. Unfortunately, most serialization approaches prioritize performance over transparency, making it difficult to generate useful and maintainable test cases. We present X2J , an approach that captures objects from runtime and automatically generates human-readable code that reconstructs those objects. X2J leverages Large Language Models, enhanced with an AST-aware Retrieval-Augmented Generation component, and an iterative Validation-Driven Repair pipeline that seamlessly aligns the generated code with the captured state. We evaluated X2J across two benchmarks that include 10,794 objects from 21 Java projects, achieving \(80.7\%\) reconstruction accuracy, that significantly outperforms ProDJ , the closest approach based on program analysis, and six LLM baselines. We further validated X2J on a closed-source industrial application, and X2J achieved \(89.5\%\) accuracy, which confirms the results obtained using open-source software and supports the practical applicability of the approach. Overall, our evaluation shows that X2J successfully transforms production objects into maintainable test cases, thereby enhancing the efficiency and effectiveness of software testing.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-11-20
DOI
https://doi.org/10.1145/3864372
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

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

Reconstructing Objects for Software Testing

Luca Di Grazia, Mattia Fazzini, Mauro Pezzè, Alessio Gambi et al.
1 links
ACM Transactions on Software Engineering and Methodology
Software Testing and Debugging Techniques
article

Reconstructing Objects for Software Testing

Luca Di Grazia, Mattia Fazzini, Mauro Pezzè, Alessio Gambi, Ketai Qiu
article en

Abstract

Software testing requires developers to build nontrivial object states to thoroughly exercise programs that process data structures. Manually building these test cases is an effort-demanding activity. The execution of software in production is an enormous source of program states, which can be serialized to synthesize test inputs. Unfortunately, most serialization approaches prioritize performance over transparency, making it difficult to generate useful and maintainable test cases. We present X2J , an approach that captures objects from runtime and automatically generates human-readable code that reconstructs those objects. X2J leverages Large Language Models, enhanced with an AST-aware Retrieval-Augmented Generation component, and an iterative Validation-Driven Repair pipeline that seamlessly aligns the generated code with the captured state. We evaluated X2J across two benchmarks that include 10,794 objects from 21 Java projects, achieving \(80.7\%\) reconstruction accuracy, that significantly outperforms ProDJ , the closest approach based on program analysis, and six LLM baselines. We further validated X2J on a closed-source industrial application, and X2J achieved \(89.5\%\) accuracy, which confirms the results obtained using open-source software and supports the practical applicability of the approach. Overall, our evaluation shows that X2J successfully transforms production objects into maintainable test cases, thereby enhancing the efficiency and effectiveness of software testing.

ACM Transactions on Software Engineering and Methodology
University of Minnesota (US), AIT Austrian Institute of Technology GmbH (AT), University of St.Gallen (CH), The Italian Institute of Artificial Intelligence (IT), Università della Svizzera italiana (CH), University of Milano-Bicocca (IT)
National Science Foundation, European Commission, Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung
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.

Laika access coming soon