Search⌘ K
AI Features

FIR[S]T: [S]elf-Validating

Explore how to create self-validating unit tests that eliminate manual verification, ensuring automated and reliable test outcomes. Understand the importance of automating test setup and execution using tools like Infinitest and continuous integration servers, enhancing unit test effectiveness and system health.

Self-validation in writing unit tests is the most important part of the FIRST principle. This principle states that the tests should be written such that the developer won’t need to check them manually, regardless of whether they passed or not.

Below is a dialogue between a recently recruited developer and his manager:

Automating the tests

Tests aren’t tests unless they assert that things went as expected. We write unit tests to save time, not take more of our time. Manually verifying ...