Unit and Integration Testing
Unit tests check a small piece of code in isolation. Integration tests check that real parts of a system, such as an application and its database, work together across a boundary.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Unit and Integration Testing
Automated tests give you evidence about behavior before a change reaches users. They do not prove that a system is correct. They make specific promises executable, repeatable, and visible in a build.
A unit test exercises a unit of work under your control without real infrastructure. The exact boundary varies by design, but the useful property is fast, local feedback. Keep databases, file systems, network calls, clocks, and remote services outside that boundary unless they are the thing you intend to test.
An integration test crosses a real boundary between components. It can prove that an application speaks to its database, serialization matches an HTTP contract, or a message reaches the next component. It is broader and usually costs more to set up and run.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://learn.microsoft.com/en-us/dotnet/core/testing/
Supports
- Unit tests exercise individual components or units of work under developer control without infrastructure concerns
- Integration tests exercise two or more components working together and often include infrastructure concerns
- Test platforms execute tests while frameworks supply author-facing attributes and APIs
- https://docs.junit.org/current/user-guide/
Supports
- JUnit Jupiter provides a programming model for writing tests and an extension model
- JUnit documentation covers assertions, parameterized tests, lifecycle, execution, and build-tool support
- https://martinfowler.com/articles/practical-test-pyramid.html
Supports
- The test pyramid groups tests by granularity and guides a balanced test portfolio
- Unit tests, integration tests, contract tests, end-to-end tests, and deployment pipelines address different feedback needs
- Test doubles and interaction testing need deliberate use
- https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests
Supports
- Official ASP.NET Core integration-testing guidance for web applications
- https://github.com/TheJambo/awesome-testing
Supports
- Curated discovery of testing tools including Testcontainers, Pact, and Playwright
