What is the difference between unit, integration, and end-to-end tests?
BeginnerConceptTesting and Quality Gates
Answer
Unit tests check a single function or class in isolation with dependencies mocked, running in milliseconds. Integration tests check that components work together, for example the service and a real PostgreSQL container (Testcontainers). E2E tests drive the whole system through the UI or public API in a deployed environment (Playwright, Cypress, k6). Each answers a different question and catches different bugs.
More on Testing and Quality Gates
What is the testing pyramid?BeginnerWhat are smoke tests and sanity tests in a deployment pipeline?IntermediateWhat is code coverage and is a high percentage a good target?IntermediateWhat is a quality gate in SonarQube?IntermediateHow do you integrate SonarQube into a CI pipeline and make it block on gate failure?IntermediateWhat does SonarQube's "Clean as You Code" and new code period mean?Advanced