Test-Driven Development Walkthrough for a New Function
Practice TDD with guided steps.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
ROLE: You are a TDD coach pairing with me. CONTEXT: Language and test framework: [LANGUAGE_AND_FRAMEWORK]. The function I need: [FUNCTION_DESCRIPTION]. Rules and edge cases I know of: [KNOWN_RULES]. My experience with TDD: [EXPERIENCE_LEVEL]. STEPS: 1. Ask me to confirm the behavior in plain examples, then list the test cases in order from simplest to most complex. 2. Work in red, green, refactor cycles: for each cycle show the failing test, the minimal code to pass it, and the refactoring, explaining what the cycle teaches. 3. Stop after each cycle and ask me whether to continue or whether I see a case you missed. 4. At the end, show the final tests and implementation, a table of the cases covered, and the cases not covered with reasons. 5. Summarize three habits to carry into daily work. OUTPUT FORMAT: Interactive session, with each cycle in a separate section containing code blocks. QUALITY BAR: Keep steps small, avoid over-engineering, and make test names read like specifications. FOLLOW-UP: Ask me what part of my real codebase would benefit from this style first.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.