Skip to content
StackPractices

Tag: unit-tests

Browse 11 practical software engineering resources tagged with "unit-tests". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving unit-tests.

Load Testing APIs with k6 and Threshold-Based Assertions

How to write and run load tests with k6 to measure API performance, validate SLOs, and identify bottlenecks before production deployment

Test API Contracts with Consumer-Driven Contracts

How to prevent breaking changes between microservices using consumer-driven contract testing with Pact and OpenAPI validators.

API Mocking for Testing

Build reliable tests by mocking external APIs with WireMock, MockServer, and MSW to eliminate flakiness and test edge cases.

Write Integration Tests

How to test multiple components working together using real databases, HTTP clients, and message queues in Python, JavaScript, and Java.

Design Effective Integration Tests for Reliable Systems

How to write integration tests that verify component interactions using test containers, API contracts, consumer-driven contracts, and contract testing in Java, TypeScript, and Python.

Snapshot Testing React Components with Jest

How to use Jest snapshot testing to catch unintended UI regressions in React components and prevent visual bugs from reaching production

Perform Load Testing on APIs

How to simulate realistic traffic, measure response times, and identify bottlenecks using k6 and JMeter for APIs and web services.

Unit Testing

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

Write Unit Tests with Mocks and Stubs

How to isolate code under test using mock objects, stubs, and spies to replace external dependencies like databases, APIs, and file systems.

Test Pyramid: Balance Unit, Integration

How to structure a test suite using the test pyramid. Covers unit, integration, and E2E test proportions, the testing trophy, and ice cream cone anti-pattern.

Software Testing Strategy Guide

A practical guide to building a layered testing strategy with unit, integration, and end-to-end tests.