Skip to content

Chapter 7 of 7

Specialized Testing and CI/CD

Beyond the unit/integration/E2E tiers, several specialized testing strategies target specific risks. Regression testing re-runs existing suites after changes to catch unintended side effects and is often automated in CI/CD pipelines. It can be performed as a full regression, running every test; as a selective regression, running only tests related to the modified code; or as a risk-based regression, prioritizing tests for the most critical features. Smoke testing, also called build verification testing, is a quick, shallow check that the most critical functions still work, answering the question of whether the build even boots before deeper testing begins. Sanity testing is a narrower, deeper check performed after a specific change to confirm that a particular bug fix or feature behaves correctly. Smoke is therefore broad and shallow, while sanity is narrow and deep.

Performance testing evaluates how a system behaves under various conditions. Load testing simulates expected concurrent users or requests to verify the system meets its performance baselines in response time, throughput, and error rates. Stress testing pushes the system beyond its normal capacity, while spike testing introduces sudden large load increases. Endurance testing, sometimes called soak testing, applies sustained load over an extended period to expose issues like memory leaks. Tools such as JMeter, k6, Gatling, and Locust enable these scenarios.

Flaky tests are a persistent operational headache. They pass or fail intermittently without any change to the code, often because of shared mutable state, timing or race conditions in async code, external dependency failures, or order-dependent assertions. CI/CD teams handle flaky tests by quarantining them into separate suites that do not block deployments, configuring retries for transient failures, tracking their history to find patterns, and ultimately fixing root causes rather than masking them with retries. A coherent CI/CD testing strategy runs the fastest tests first: pre-commit hooks perform linting and unit tests for immediate developer feedback; the CI build runs unit and integration tests; staging executes E2E and smoke tests; pre-deploy runs contract tests and security scans; and post-deploy uses smoke tests and synthetic monitoring. The underlying principle, often called shift left, is to catch bugs as early as possible because a defect found in development costs roughly an order of magnitude less to fix than one discovered in production.

All chapters
  1. 1Test Types and Strategy
  2. 2TDD and BDD
  3. 3Test Doubles
  4. 4Writing and Structuring Tests
  5. 5Test Infrastructure and Frameworks
  6. 6Measuring Test Quality
  7. 7Specialized Testing and CI/CD

Drill it

Reading is not remembering. These come from the Testing Tdd deck:

Q

What is a unit test?

A unit test verifies the behavior of a single, isolated piece of code (e.g., a function or method). Key characteristics:Tests one logical unit in isolationDepen...

Q

What is an integration test?

An integration test verifies that multiple components work correctly together. Unlike unit tests, it exercises real interactions:Tests communication between mod...

Q

What is an end-to-end (E2E) test?

An E2E test simulates real user workflows through the entire application stack. It validates the system from the user's perspective:Uses tools like Playwright,...

Q

What is the Test Pyramid?

The Test Pyramid is a testing strategy that recommends:Base (most): Unit tests — fast, cheap, numerousMiddle: Integration tests — moderate speed and countTop (f...