Jonatan Matajonmatum.com
conceptsnotesexperimentsessays
© 2026 Jonatan Mata. All rights reserved.v2.1.1
Concepts

Testing Strategies

Approaches and testing levels for validating software works correctly, from unit tests to end-to-end tests and testing in production.

seed#testing#unit-tests#integration#e2e#tdd#quality

What it is

Testing strategies define what types of tests to write, how many, and how to organize them to maximize code confidence with the lowest maintenance cost.

Testing pyramid

        /\        E2E (few, slow, fragile)
       /  \
      /----\      Integration (some)
     /      \
    /--------\    Unit (many, fast, stable)

Test types

TypeWhat it testsSpeedFragility
UnitIsolated function/classVery fastLow
IntegrationComponents togetherMediumMedium
E2EComplete user flowSlowHigh
ContractAPIs between servicesFastLow

Approaches

ApproachMechanismWhen to use
TDDWrite test before codeBusiness logic, algorithms
BDDTests as behavior specificationsUser requirements, acceptance
Property-basedGenerate random inputs, verify invariantsParsers, serialization, edge cases
SnapshotCompare output with saved versionUI components, API responses

Testing in production

  • Feature flags for gradual rollout
  • Canary deployments
  • Observability to detect problems

Why it matters

An effective testing strategy balances speed, coverage, and confidence. Too many unit tests without integration give false security. Too many e2e tests are slow and brittle. The testing pyramid provides the framework for finding the right balance.

References

  • Testing Trophy — Kent C. Dodds.
  • The Practical Test Pyramid — Ham Vocke, 2018. Practical guide to the testing pyramid.
  • Testing Library — Testing Library, 2024. User-centered testing tools.

Related content

  • CI/CD

    Continuous Integration and Continuous Delivery/Deployment — practices that automate code integration, testing, and delivery to production. Foundation of modern software engineering.

  • Code Quality

    Practices, tools, and metrics for maintaining readable, maintainable, testable, and defect-free code over time.

  • Accessibility

    Practice of designing and developing digital products usable by all people, including those with visual, auditory, motor, or cognitive disabilities.

  • Pipenv Pytest Example

    Python project example with Pipenv, Pytest, pre-commit hooks, CI/CD with GitHub Actions, and badge generation.

  • Chaos Engineering

    Discipline of experimenting on production systems to discover weaknesses before they cause incidents, by injecting controlled failures.

Concepts