Master Test-Driven Development with deterministic red-green-refactor workflows, test-first feature delivery, bug reproduction through failing tests, behavior-focused assertions, and refactoring safety; use when implementing new functions, changing APIs, fixing regressions, or restructuring code under test.
Does it follow best practices?
Evaluation — 86%
↑ 1.05xAgent success when using this tile
Validation for skill structure
Replace external systems (databases, APIs, file systems) with test doubles. This makes tests fast, deterministic, and independent of external state.
Incorrect (using real external dependencies):
test('sends welcome email to new user', async () => {
const user = await userService.register({
email: 'test@example.com',
name: 'Alice'
})
// Actually sends email - slow, unreliable, costs money
// Fails if email server is down
// Clutters real inbox or spam folder
const emails = await checkEmailInbox('test@example.com')
expect(emails).toContainEqual(expect.objectContaining({
subject: 'Welcome to our platform!'
}))
})Correct (mock external dependency):
test('sends welcome email to new user', async () => {
// Arrange
const mockEmailService = {
send: jest.fn().mockResolvedValue({ success: true })
}
const userService = new UserService({ emailService: mockEmailService })
// Act
await userService.register({
email: 'test@example.com',
name: 'Alice'
})
// Assert
expect(mockEmailService.send).toHaveBeenCalledWith({
to: 'test@example.com',
subject: 'Welcome to our platform!',
body: expect.stringContaining('Alice')
})
})What to mock:
What NOT to mock:
Reference: Isolating Dependencies - Code Magazine
Install with Tessl CLI
npx tessl i pantheon-ai/test-driven-developmentevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
references