Штучний інтелект

Науковий журнал

ISSN 2710-1673

ONLINE: ISSN 2710-1681

Виберіть свою мову


Орієнтоване на споживача контрактне тестування розподілених систем із штучним інтелектом

Гарасимчук О.І.1
1 Національний університет «Львівська політехніка»
oleh.ih.harasymchuk@lpnu.ua

Повний текст (PDF)

УДК: 004.93
Мова публікації: Англійська
Stuc. intelekt. 2024; 29; (4):195-206

Анотація: This article explores the case of the usage of artificial intelligence (AI) for optimizing the process of covering distributed systems with consumer-driven contract test, analyzing the pros and cons of this approach. Considering the complexity of development of modern distributed systems, like microservices, and the need to ensure the system components interactions keep reliable as long as the system keeps evolving this study is focused on finding the most effective way to introduce the contact testing into such systems to maximize the contracts tests coverage while minimizing development costs. The contract testing has its challenges: steep learning curve, impact on the delivery lifecycle, spreading the approach consistently across the organization. These challenges often lead to teams sacrificing the benefits of the approach and using more traditional ways of testing, like end-to-end (E2E) testing, which however does not fit well into distrusted system. The described methodology includes generating (by AI platform) the contract between the parties (consumer and provider), generating the consumer test to verify the provider is compatible with the expectations the consumer has of it. It is proposed to use following inputs for AI as the source for generation: request-response pairs, OpenApi specification, consumer codebase. The research employs Pact as a tool that allows to define a contract between a consumer and a provider as well as verify that both sides adhere to this contract. NodeJS is used as a framework for consumer and provider development. PactFlow platform with its HaloAI executes contracts and tests generation. The proposed approach simplifies the road to introduce the contact testing into the distributed systems, increases the development team effectiveness in system implementation and a confidence in its stability.

Ключові слова: contract testing, artificial intelligence, pact, distributed systems, microservices, consumer, provider

Посилання:

  1. Lehvä, J., Mäkitalo, N. & Mikkonen (2019). Consumer-Driven Contract Tests for Microservices: A Case Study. https://doi.org/10.1007/978-3-030-35333-9_35
  2. Marie Cruz & Lewis Prescott. Contract Testing in Action
  3. Robinson. I.: Consumer-Driven Contracts: A Service Evolution Pattern. Available:https://martinfowler.com/articles/consumerDrivenContracts.html
  4. Matt Fellows. What is contract testing and why should I try. Available: https://pactflow.io/blog/what-is-contract-testing/
  5. Elliott Murray. Proving E2E tests are a scam. [Online] Available: https://elliottmurray.medium.com/proving-e2e-tests-are-a-scam-21d39e88913
  6. Thomas Shipley. Contract Testing with Pact in Net Core. Available:https://tomdriven.dev/.net%20core/c%23/contract%20testing/pact/test/2018/03/13/contract-testing-with-pact-in-net-core.html
  7. Just Say No More to End-to-End Test. [Online] Available: https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html
  8. Yousaf Nabi. Unpacking GenAI’s Role in Contract Testing. Available: https://pactflow.io/blog/ai-automation-part-2
  9. Pactflow [Online]. Available: https://docs.pactflow.io/
  10. Manuel Simosa; Frank Siqueira, Contract Testing in Microservices-Based Systems: A Survey. doi:10.1109/ICSESS58500.2023.10293058

Переглянути повний текст статті (PDF)