Reconstructing Objects for Software Testing
ACM Transactions on Software Engineering and Methodology · 2026-11-20
DOI: 10.1145/3864372 ↗At a glance
Journal article in ACM Transactions on Software Engineering and Methodology, published online on 2026-11-20. Written by Ketai Qiu and 4 co-authors. 68 references.
Abstract (original language)
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.
Cite
APA
Qiu, K., Grazia, L. D., Gambi, A., Fazzini, M., & Pezzè, M. (2026). Reconstructing Objects for Software Testing. ACM Transactions on Software Engineering and Methodology. https://doi.org/10.1145/3864372
Vancouver
Qiu K, Grazia LD, Gambi A, Fazzini M, Pezzè M. Reconstructing Objects for Software Testing. ACM Transactions on Software Engineering and Methodology. 2026. doi:10.1145/3864372
BibTeX
@article{Qiu2026,
author = {Qiu, Ketai and Grazia, Luca Di and Gambi, Alessio and Fazzini, Mattia and Pezzè, Mauro},
title = {Reconstructing Objects for Software Testing},
journal = {ACM Transactions on Software Engineering and Methodology},
year = {2026},
doi = {10.1145/3864372}
}
EUVIMED