Automated Validation of Large-Scale Java Bytecode Models
Abstract
Java bytecode is an important target for program analysis and transformation, but its compact binary format is difficult to manipulate directly. ModBEAM represents Java class files as Ecore models, providing higher-level abstractions for model-based analysis and transformation while retaining the information required to regenerate equivalent bytecode. However, validating such models is challenging, as conformance to the metamodel alone does not ensure that a model accurately represents the original class files. We present an automated, large-scale round-trip validation approach that translates class files into ModBEAM models and back, and then compares the regenerated bytecode with the originals. We evaluated the approach on around three million class files from diverse real-world projects and test suites spanning Java 1.1 to Java 25. ModBEAM successfully regenerates all valid class files in the corpus, while the complete validation runs in under four minutes. The framework is integrated into ModBEAM’s development workflow, enabling continuous detection of fidelity and performance regressions during metamodel and tooling evolution, and providing a substantial corpus for model-driven engineering research.