Overview
Testing has become essential when working with AI coding agents. The simple prompt “First run the tests” is a powerful pattern that transforms how agents understand and work with codebases. This four-word command serves multiple purposes beyond just running tests.
Key Points
- AI agents can quickly write and maintain tests, eliminating the traditional excuse that tests are too time-consuming during rapid development - agents remove the friction that previously made testing optional
- Tests are vital for validating AI-generated code since untested code may not work in production - you can’t trust AI code that has never been executed
- The “First run the tests” prompt forces agents to discover and understand the existing test suite - this makes agents naturally run tests for future changes
- Starting sessions with test runs puts agents in a testing mindset and helps them gauge project complexity - agents become testing-aware rather than just code-aware
- This simple pattern encapsulates substantial software engineering discipline that’s already built into AI models - four words unlock professional development practices