Exam project for the 2025 Software Integration course.
This repository contains a TaskBoard software system implemented as a microservice-based .NET solution.
The project focuses on how testing strategies can be applied in a distributed system, with particular emphasis on:
- Consumer-Driven Contract Testing (CDC)
- End-to-End Testing (E2E)
The purpose of the project is to demonstrate how these two test approaches can be combined to validate both service-to-service communication in isolation and complete workflows across multiple microservices.
The system consists of three microservices:
UserServiceProjectServiceAssignmentService
Each service is responsible for its own bounded area of the domain and communicates with other services over HTTP.
A typical workflow in the system is:
- A user is created in
UserService - A project is created in
ProjectServicewith that user as owner - An assignment is created in
AssignmentServicefor that project - The assignment is retrieved again and validated
This workflow forms the basis of the project’s end-to-end testing strategy.
This project is centered around testing in a microservice architecture, where different test types provide different forms of confidence.
CDC is used to verify service interactions in isolation.
In this approach, the consumer defines its expectations of a provider’s API in the form of a contract, and the provider verifies that its implementation satisfies that contract. This helps reduce the risk of breaking changes between independently developed services.
AssignmentService(consumer) →ProjectService(provider)ProjectService(consumer) →UserService(provider)
This project uses PactNet for contract testing.
For each service interaction, there are separate test projects for:
- consumer contract tests
- provider verification tests
The consumer tests:
- define expected HTTP interactions
- execute the real consumer client code against a Pact mock server
- generate Pact files that document the agreed contract
The provider verification tests:
- load the generated Pact files
- run verification against the real provider API
- prepare provider state before verification through a
ProviderStatesController
This allows service contracts to be validated without requiring the full system to be started.
E2E testing is used to verify the system as a whole.
Where CDC focuses on isolated service interactions, E2E testing validates that the full workflow works correctly when all services, databases, and network communication are running together.
This project uses xUnit together with Testcontainers to provision an isolated Docker-based test environment.
The E2E test setup provisions:
- a dedicated Docker network
- three SQL Server containers
- three microservice containers:
UserServiceProjectServiceAssignmentService
The environment is started in dependency order so that databases are available before the services start.
Before the test runs, the fixture waits until each service responds successfully on its /health endpoint.
The end-to-end test validates a complete user journey across the system:
- Create a user
- Create a project for that user
- Create an assignment for that project
- Retrieve the assignment and verify the persisted data
This gives stronger confidence that the services work correctly together across service boundaries.
A central part of the project is not only implementing tests, but also evaluating the trade-offs of the chosen strategy.
End-to-end tests provide high realism and strong confidence because they run against real services, databases, and network communication.
However, this comes at a cost:
- slower feedback
- more infrastructure setup
- greater fragility
- weaker scalability as the number of services grows
In other words, E2E tests are valuable for validating important workflows, but they are less suitable as the primary feedback mechanism in larger microservice systems.
CDC tests provide faster feedback and make it easier to detect integration issues between services early.
They also support a higher degree of independent development and deployment, because services can be verified against contracts without running the full environment.
However, CDC does not prove that the complete system works end-to-end.
For that reason, CDC and E2E should be seen as complementary rather than competing approaches.
- .NET
- xUnit
- Testcontainers
- PactNet
- Docker
- SQL Server
The project shows that an effective testing strategy for microservices should not rely on a single test type.
Instead, the repository demonstrates a balanced approach where:
- E2E tests are used selectively to validate important system workflows
- CDC tests are used to validate service interactions in isolation
Together, these approaches provide a better balance between:
- confidence
- feedback speed
- isolation
- deployability
- .NET SDK
- Docker
- Docker Compose
Before running the application or the test suite, create the required .env files with the following values.
Create a .env file in the repository root:
DB_HOST=host.docker.internal
DB_PORT=1433
DB_USER=sa
DB_PASSWORD=your-chosen-password
DB_PLATFORM=linux/amd64
DB_IMAGE=mcr.microsoft.com/mssql/server:2022-latestTEST_SQL_PASSWORD=your-chosen-passwordSA_USERNAME=sa
SA_PASSWORD=your-chosen-passwordTEST_SQL_PASSWORD=your-chosen-passworddocker compose up --build
dotnet test