CONTRACT-ORIENTED DIGITAL TWIN OF A MICROSERVICE SYSTEM: MODEL, METAMODEL, OPENAPI/ASYNCAPI ARTIFACTS
DOI:
https://doi.org/10.32689/maup.it.2025.3.16Keywords:
contract-oriented modelling, information system, digital twin, microservice architecture, API contract, modelling, automationAbstract
The study aims to develop a contract-oriented digital twin of a microservice-based system, grounded in a modeland meta-model of service interactions defined by their API contracts.Methodology. The study adopts an API-first approach: formal service interface specifications (OpenAPI for REST APIsand AsyncAPI for event-driven APIs) are used as artifacts to automatically construct the digital twin model. Additionally, a comparative analysis with existing approaches was conducted.Scientific novelty. The concept of a «contract-oriented» digital twin is proposed, focusing the virtual model of the system on its API contracts; this approach is novel in enabling automated generation and updating of the twin from OpenAPI/AsyncAPIartifacts. This effectively merges the API documentation process with the maintenance of a live system model.Conclusions. The contract-oriented approach ensures the digital twin remains up-to-date as microservices evolve, andit simplifies compatibility testing and behavioral analysis of the system without impacting the production environment.The proposed approach was validated on a simplified microservice scenario; the results confirm the feasibility of automatictwin generation and its effectiveness for integration testing of new service versions. The outcomes can be applied in DevOpspractice to automate regression testing of microservices and ensure that their implementations conform to specified contracts.Overall, using a contract-oriented twin helps improve the quality and reliability of microservice-based software systems andreduces the time required for integration testing. A simplified prototype of the digital twin was implemented to demonstratethe approach, which showed its viability in a realistic scenario.
References
AsyncAPI Initiative. AsyncAPI Specification (Version 2.3.0), 2022. URL: https://www.asyncapi.com (дата звернення: 24.09.2025).
Bellavista P., Bicocchi N., Fogli M., Giannelli C., Mamei M., Picone M. Exploiting microservices and serverless for Digital Twins in the cloud-to-edge continuum. Future Generation Computer Systems, 2024, pp. 275–287. DOI: 10.1016/j.future.2024.03.052.
Bhardwaj A., Benson T.A. KubeKlone: A Digital Twin for Simulating Edge and Cloud Microservices. In: Proc. 6th Asia- Pacific Workshop on Networking (APNet 2022), ACM, 2022, 7 p. DOI: 10.1145/3542637.3542642.
Grieves M. Digital Twin: Manufacturing Excellence through Virtual Factory Replication. White Paper, 2014, 7 p.
Kritzinger W., Karner M., Traar G., Henjes J., Sihn W. Digital Twin in manufacturing: A categorical literature review and classification. IFAC-PapersOnLine, 2018, 51(11), pp. 1016–1022. DOI: 10.1016/j.ifacol.2018.08.474.
Лобода П. П., Старовіт І. С. Розробка архітектури програмного забезпечення прогнозування і управління термогазодинамічними процесами і радіаційним станом нового безпечного конфайнменту ЧАЕС на основі технології цифрових двійників. Вісник ХНТУ, 2022, № 4(83), c. 67–73. DOI: 10.35546/kntu2078-4481.2022.4.9.
Minerva R., Lee G. M., Crespi N. Digital Twin in the IoT Context: A Survey on Technical Features, Scenarios, and Architectural Models. Proceedings of the IEEE, 2020, 108(6), pp. 1785–1824. DOI: 10.1109/JPROC.2020.2998530.
OpenAPI Initiative. OpenAPI Specification (Version 3.1.0), 2021. URL: https://spec.openapis.org/oas/v3.1.0 (дата звернення: 24.09.2025).
Raghunandan A., Kalasapura D., Caesar M. Digital Twinning for Microservice Architectures. In: Proc. IEEE Int. Conf. on Communications (ICC 2023), 2023, pp. 3018–3023. DOI: 10.1109/ICC45041.2023.10279802.
Rasheed A., San O., Kvamsdal T. Digital Twin: Values, Challenges and Enablers from a Modeling Perspective. IEEE Access, 2020, 8, pp. 21980–22012. DOI: 10.1109/ACCESS.2020.2970143.






