Concept and collection of practices for testing Java applications across unit, integration, and end-to-end tests.
Java testing covers methods and practices for designing, executing, and automating tests for Java applications. It includes unit, integration, and end-to-end tests, along with test frameworks, mocking, and test data strategies. Best practices and CI-based automation provide fast feedback and help detect regressions early.
Percentage of code or execution paths covered by tests.
Average duration for running full test suite in CI.
Share of tests that fail intermittently without code changes.
A microservice uses JUnit 5 for isolated unit tests and Mockito for mocking dependencies.
Integration tests start a temporary database via Testcontainers to reliably validate repository logic.
Automated end-to-end suite verifies critical user journeys in staging before release.
Define basic test architecture, map the test pyramid and plan CI integration.
Write unit tests, use mocks and ensure local execution.
Introduce integration tests with Testcontainers and integrate into CI.