NobleBlocks

Research indexJournal article

Reconstructing Objects for Software Testing

Qiu, Di Grazia, Gambi and 2 others

ACM Transactions on Software Engineering and Methodology20 Nov 2026

NobleIDark:/48914/w1/20261121/1E2C6A52DOI10.1145/3864372

Paywalled

The full text is at the publisher

You can read the abstract here, or open it at the publisher.

Read at the publisher

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.

Discussion

Citations

More

Suggest a correction or report