2 Days: Beyond Contract Testing - Contract Driven Development
GOTO Copenhagen 2024

2 Days: Beyond Contract Testing - Contract Driven Development

Monday Sep 30
09:00 –
17:00
Tuesday Oct 1
09:00 –
17:00
11,000.00 DKK

In this masterclass, Naresh Jain (co-author of Specmatic) will give you an in depth, hands-on introduction to Contract Driven Development (CDD). You will learn how to use OpenAPI specifications as executable contracts to achieve parallel development and independent deployment of your microservices & micro-frontends. In this process, you’ll learn how to shift-left the identification of integration issues to achieve quicker time to market. This masterclass is hand-crafted to provide Developers, Architects and Quality Engineers the essential techniques to foster a collaborative API Design first culture in their teams.

The masterclass will cover:

  1. The need to “Shift Left” - Why is integration testing ineffective? How you can leverage contract testing and service virtualisation to validate your services conformance to API Specs to identify integration issues early.
  2. API Design First Approach - How to collaboratively evolve API design and avoid rework.
  3. Backward Compatibility Testing - Via a PR process, ensure backward breaking changes are prevented during API design rather than catching them during integration testing.
  4. Generative Contract Testing - Building secure and resilient MicroServices by achieving higher API Coverage with Generative Tests (inspired by Property Based and Mutation Testing).
  5. Intelligent Service Virtualization - Cheap, Fast, Reliable Tests in a controlled environment using dependency-emulation & fault-injection.
  6. AI Test Data Management - Instantly generate domain specific test data by using the context in your API spec with GenAI.
  7. Service Dependency Visualization - make informed architectural decisions based on deep integration insights.
  8. Fix API Spec and Implementation conformance mismatches - Run tests locally and as hard-gates in CI pipeline to ensure API Conformance.
  9. Measure Progress - Metrics to track CDD adoption and outcomes.

Agenda:

Day 1

  1. Introductions
  2. Why is microservices architecture not yielding the expected results?
  3. Quick review of Test Pyramid and various types of tests
  4. Sneak-peek into Contract Driven Development in action
  5. Leveraging API Specifications as Contract Tests - Using OpenAPI specs to generate contract tests in seconds without writing code
    a. Hands-on Lab 1
  6. API Coverage Report - Identify mismatch between your spec and implementation
  7. Understanding the difference between Contract Test and API Tests
  8. Types of contract testing and their mechanics - Consumer Driven, Provider Driven, Bi-directional. Understanding their pros and cons.
  9. How Contract Driven Development differs and also addresses the issues with traditional contract testing.
  10. Using OpenAPI Examples as Test Data
    a. Hands-on Lab 2

Lunch Break

  1. Generating context aware domain relevant OpenAPI examples with Generative AI
    a. Hands-on Lab 3
  2. Generative Tests - ensure Testing boundary conditions of your API specification
    a. Hands-on Lab 4
  3. Externalising test data
    a. Hands-on Lab 5
  4. Central Contract Repo - Single source of truth for your API specifications, pre-merge checks on central contract repository - API Spec Linting
  5. No code backward compatibility Testing and API Versioning Strategies to prevent backward breaking changes at API design stage
    a.Hands-on Lab 6
  6. Why Doc Gen (generating API spec from code) and Code Gen (generating code from API spec) does not guarantee that the API spec adheres to the code and vice versa
  7. Q & A

Day 2

  1. Recap of Day 1
  2. Using API Specifications for Intelligent Service Virtualization to isolate dependencies
    a. Hands-on Lab 7
  3. OpenAPI Examples as Stub Data
    a. Hands-on Lab 8
  4. Recording API specifications and stub response
    a. Hands-on Lab 9
  5. Mocking other dependencies such as databases
    a. Demo
  6. Externalizing stub data

Lunch Break

  1. Fault Injection testing - Delay simulation, error and empty responses and more
    a. Hands-on Lab 10
  2. Running contract tests in CI pipelines
    a. Hands-on Lab 11
  3. Visualizing your architectural dependencies - Detecting integration risks, deprecation candidates and more
  4. CDD Metrics - Tracking health, value and outcome of your CDD adoption journey
  5. Developer workflow with CDD - Contract tests to drive development of a new API implementation followed by GenAI to write your unit tests
  6. Starting CDD adoption in your organization and anit-patterns to watch out for
  7. Q & A

Prerequisites

This masterclass involves hands-on coding labs and group exercises. Bring your laptop. The labs will involve basic Java, Python or TS projects. Familiarity with API specifications such as OpenAPI / Swagger, AsyncAPI will be helpful, but not mandatory. Experience building and deploying microservices/micro-frontends will help you appreciate these labs.

More Masterclasses

See all masterclasses