JUnit 5 Tutorial: Writing Clean, Modern Java Tests
A complete introduction to JUnit 5. Learn the new architecture, lifecycle, parameterized tests, assertions, and patterns that keep your test suite fast and readable.
68 posts · page 2 of 2
A complete introduction to JUnit 5. Learn the new architecture, lifecycle, parameterized tests, assertions, and patterns that keep your test suite fast and readable.
Learn how to use Mockito to write fast, focused unit tests. Understand mocks, stubs, spies, argument captors, and how to avoid over-mocking.
How to build evaluation loops for prompts so you can iterate with evidence instead of vibes. Covers datasets, graders, regressions, and how to make eval cheap enough to run often.
Practical guidance for writing maintainable, user-focused tests with React Testing Library, including queries, async patterns, and smart mocking.
Stop writing one example per test. Property-based testing generates inputs for you and finds the edge cases you would never think to write.
Understand consumer-driven contract testing, how it differs from integration tests, and how tools like Pact prevent breaking API changes between services.
Line, branch, and mutation coverage explained. Learn what each metric tells you, what it hides, and how to use coverage without gaming it.
Learn how to write reliable end-to-end tests with Playwright, including selectors, fixtures, auto-waiting, and patterns that avoid flakiness.
Diagnose and eliminate flaky tests caused by timing, ordering, shared state, and the network. Build a culture that stops flakes at the source.
A practical introduction to k6 for load testing HTTP services. Covers scripting, stages, thresholds, and how to read the results without fooling yourself.
Pick the right test double for the job. Compare mocks, stubs, fakes, and spies, and learn when to skip them entirely.
What the testing pyramid actually means in modern apps, when to deviate, and how to keep each layer giving you the value it is supposed to.
Learn how snapshot tests work, when they shine, and how to keep them maintainable instead of letting them rot into noise.
Stop drowning in fixture noise. Learn the Test Data Builder pattern to create clear, intention-revealing test data that survives schema changes.
A practical guide to Vitest, the testing framework built for modern JavaScript projects. Setup, syntax, mocking, coverage, and how it differs from Jest in ways that matter.
A practical look at integration testing alongside unit tests, covering fixtures, real databases in tests, and the right balance with examples in pytest and vitest.
The test-double vocabulary cleared up — mocks vs stubs vs fakes vs spies, when to mock at boundaries, when over-mocking ruins tests, with Python and JavaScript examples.
A practical introduction to pytest — installation, test discovery, the assert statement, parametrize, fixtures, and the command-line flags you will use every day.
A practical introduction to Vitest — why it exists, installation, describe and it, expect matchers, watch mode, and a small mock example for testing modern JavaScript.
An honest introduction to automated testing — unit, integration, and end-to-end tests, the testing pyramid, why tests pay back over time, and common excuses for skipping them.