Library · practice

Automated testing

Write fast unit tests and focused integration tests that catch real bugs, use test doubles for slow dependencies, and read coverage for what it does and does not tell you.

Automated testing appeared in 32% of the Software Engineer job descriptions we read, and it is assumed in almost every code review. The examples use pytest, and the same ideas apply to JUnit, Go's testing package and node:test, which appear on the Java, Go and TypeScript shelves.

  1. 1Tests that catch bugsUnit tests with pytest that find real bugs4 min read
  2. 2Tests that catch bugsIntegration tests against a real database, and what coverage means4 min read

Automated testing lessons

Loading lessons…