StackPractices

testing

Practical resources about testing for software engineers.

79 results

Testing Strategies That Ship with Confidence

Testing is not just about catching bugs — it is about shipping faster, refactoring without fear, and documenting behavior through executable specs. A well-tested codebase reduces incident response time and onboarding friction for new developers.

Explore recipes for unit testing with mocks, integration testing with real dependencies, end-to-end testing with Playwright, and load testing with k6. Each pattern includes setup instructions, assertion strategies, and CI/CD integration tips.

advanced

Property-Based Testing with Hypothesis

How to use Hypothesis for property-based testing in Python, generating hundreds of test cases...

intermediate

Mock External APIs with responses Library

How to mock HTTP API calls in Python tests using the responses library, including status codes,...

intermediate

Pytest Fixtures and Parametrize

How to use pytest fixtures and @pytest.mark.parametrize to write data-driven tests with reusable...

beginner

Set Up Test Fixtures (pytest, Jest, JUnit)

How to create, scope, and clean up test fixtures with pytest fixtures, Jest hooks, and JUnit 5...

beginner

Unit Testing

How to write fast, deterministic unit tests with mocks and assertions in Python, JavaScript, and...

beginner

Write Unit Tests with Mocks and Stubs

How to isolate code under test using mock objects, stubs, and spies to replace external...

advanced

Contract Testing: Verify Consumer-Producer API Contracts

How to use contract testing to verify that API producers and consumers agree on request and...

beginner

Fixture Setup/Teardown: Reusable Test Context Lifecycle

How to use setup and teardown fixtures to create reusable test context. Covers beforeEach, factory...

advanced

Golden Master Testing: Characterize Legacy Code Safely

How to use golden master testing to characterize legacy code behavior before refactoring. Covers...

intermediate

Mock Server: Stand Up a Mock Server for Integration Test

How to use mock servers to isolate integration tests from external dependencies. Covers WireMock,...

testing wiremock msw integration-tests
beginner

Parameterized Test: Run the Same Logic Across Multiple

How to write parameterized tests to verify the same logic across multiple inputs. Covers pytest...

testing parameterized data-driven test-case
intermediate

Snapshot Testing: Capture and Compare Serialized Output

How to use snapshot testing to detect unintended changes in serialized output. Covers Jest...

intermediate

Test Double: Replace Dependencies with Stubs, Spies, Fakes

How to use test doubles to isolate units under test. Covers stubs, spies, fakes, mocks, and dummy...

intermediate

Test Pyramid: Balance Unit, Integration and E2E Tests

How to structure a test suite using the test pyramid. Covers unit, integration, and E2E test...

testing test-strategy ci-cd quality
intermediate

Data Quality Rules Template: SQL, dbt & Great Expectations

A copy-paste template for defining data validation rules per dataset and column, with severity...

intermediate

ETL Job Runbook Template

A runbook for operating, monitoring, and troubleshooting ETL jobs: startup, shutdown, health...

beginner

Code Review Checklist Template

A structured checklist template for conducting consistent, thorough code reviews that catch bugs,...

code-review checklist quality-assurance team-process
intermediate

Helm Chart Review Checklist

A checklist for reviewing Helm charts covering values, templates, security, resource limits,...

intermediate

Penetration Test Scope Template

A template for defining the boundaries, targets, rules, and deliverables for a penetration testing...

intermediate

Terraform State Management Policy

A policy for managing Terraform state files: backend configuration, locking, isolation, access...

No results found.