EquivTrace: AI-Driven Behavioural Equivalence Testing for Mainframe-to-Cloud Migration Using Production Transaction Traces
DOI:
https://doi.org/10.63282/3050-922X.IJERET-V7I3P108Keywords:
Behavioural Equivalence, Differential Testing, Metamorphic Testing, Mainframe Migration, Transaction Traces, Test OracleAbstract
The largest issue is not about converting code for a mainframe to the cloud, but about proving that the new system behaves identically to its predecessor. In the industry, we refer to this process as achieving behavioural test parity. Most companies are unable to achieve this level of parity, primarily because most teams struggle to migrate their systems. This article describes EquivTrace, a tool that captures trace records of each production transaction performed in a legacy batch processing environment. These traces are then replayed through the newly developed (modernised) system, and the resulting transaction records are compared on a field-by-field basis. Legacy behaviour serves as a "derived oracle" for determining whether or not a difference in the resulting records represents a functional failure (a regression), or simply represents one form of representational divergence relative to another. Most field differences in records generated by migrated systems will be examples of what we refer to as "benign representational divergence," and include differences related to formatting fields (e.g., padded fixed width, packed decimal, etc.), differences in the order of fields within records, differences in date/time formats used, and differences in rules governing collation. EquivTrace employs both metamorphic relationships and a machine learning-based classifier to differentiate between true behavioural failures and representational divergence. Additionally, EquivTrace allows for clustering of those differences that do not result in a behavioural failure, thereby reducing the number of potential root cause analyses required by human engineers from examining individual field-by-field differences to evaluating root causes based upon relatively few groups/clusters of differences.
References
[1] "Translation of Low-Resource COBOL to Logically Correct and Readable Java leveraging High-Resource Java Refinement," in Proc. LLM4Code Workshop, Int'l Conf. on Software Engineering (ICSE), 2024.
[2] "Code Reborn: AI-Driven Legacy Systems Modernisation from COBOL to Java," arXiv:2504.11335, 2025.
[3] T. Y. Chen et al., "Metamorphic Testing: A Review of Challenges and Opportunities," ACM Computing Surveys, vol. 51, no. 1, 2018. doi:10.1145/3143561.
[4] "A Survey of Modern Compiler Fuzzing," arXiv:2306.06884, 2023.
[5] "Compiler Optimisation Testing Based on Optimisation-Guided Equivalence Transformations," in Proc. ACM Int'l Conf. on the Foundations of Software Engineering (FSE), 2025. doi:10.1145/3696630.3728528.
[6] AREX, "A Real Automated Regression Testing Platform with Recording and Replay Testing," open-source project documentation, 2023. [Online].
[7] Speedscale, "API Traffic Replay Testing: A Practitioner's Guide," 2024. [Online].
[8] W. M. McKeeman, "Differential Testing for Software," Digital Technical Journal, vol. 10, no. 1, pp. 100-107, 1998.
[9] "Migration challenges of legacy software to the cloud: a socio-technical perspective," Cogent Business and Management, 2025. doi:10.1080/23311975.2025.2503421.
[10] "Legacy Mainframe Application Modernisation: Transformative Strategies and Organizational Outcomes," Int'l J. Computational and Experimental Science and Engineering, 2025.
[11] "Migrating Code at Scale with LLMs at Google," arXiv:2504.09691, 2025.
[12] E. T. Barr, M. Harman, P. McMinn, M. Shahbaz, and S. Yoo, "The Oracle Problem in Software Testing: A Survey," IEEE Trans. Software Engineering, vol. 41, no. 5, pp. 507-525, 2015. doi:10.1109/TSE.2014.2372785.
[13] M. A. Nabith et al., "SECCODEPLT: A Unified Evaluation Platform for Code GenAI Security Risks," in Proc. ETTIS 2025, Lecture Notes in Networks and Systems, Springer, 2025. doi:10.1007/978-981-95-0681-1_9.