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
Tests must produce the same result every time when code hasn't changed. Non-deterministic tests erode trust and get ignored.
Incorrect (non-deterministic tests):
test('generates unique order id', () => {
const order = createOrder()
// Depends on current time - flaky around midnight
expect(order.id).toMatch(/^ORD-2024-/)
})
test('token expires in future', () => {
const token = generateToken()
// Race condition: might fail if test runs at exact boundary
expect(token.expiresAt.getTime()).toBeGreaterThan(Date.now())
})
test('shuffles items randomly', () => {
const items = [1, 2, 3, 4, 5]
const shuffled = shuffle(items)
// Non-deterministic: might be same order by chance
expect(shuffled).not.toEqual(items)
})Correct (deterministic tests):
test('generates unique order id with date prefix', () => {
// Inject fixed clock
const fixedDate = new Date('2024-06-15T10:30:00Z')
jest.useFakeTimers().setSystemTime(fixedDate)
const order = createOrder()
expect(order.id).toMatch(/^ORD-2024-06-15-/)
jest.useRealTimers()
})
test('token expires 1 hour after creation', () => {
const fixedNow = new Date('2024-06-15T10:00:00Z')
jest.useFakeTimers().setSystemTime(fixedNow)
const token = generateToken()
const expectedExpiry = new Date('2024-06-15T11:00:00Z')
expect(token.expiresAt).toEqual(expectedExpiry)
jest.useRealTimers()
})
test('shuffle changes element positions', () => {
// Seed random number generator for reproducibility
const shuffler = createShuffler({ seed: 12345 })
const items = [1, 2, 3, 4, 5]
const shuffled = shuffler.shuffle(items)
// Deterministic with seeded RNG
expect(shuffled).toEqual([3, 1, 5, 2, 4])
})Sources of non-determinism to control:
Reference: Flaky Tests - Datadog
Install with Tessl CLI
npx tessl i pantheon-ai/test-driven-developmentevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
references