test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
Security Assessment
About test-driven-development
The 'test-driven-development' skill is designed to guide developers in implementing features or bug fixes using the principles of Test-Driven Development (TDD). This skill addresses the common pitfalls in software development where code is often written without first creating the corresponding tests, leading to untested and potentially faulty implementations. By emphasizing the importance of writing tests before code, this skill aims to enhance the reliability and maintainability of software projects.
FAQ
When should I use this skill?
You should use this skill when implementing new features, fixing bugs, refactoring code, or making behavior changes.
Are there any exceptions to using TDD?
Yes, exceptions include throwaway prototypes, generated code, and configuration files. It's advisable to consult with a human partner in these cases.
What if my tests pass but I think I need to change the code?
If your tests pass, you should not change the tests. Instead, ensure that the tests are correctly verifying the expected behavior.
Can I use mocks in my tests?
Mocks should only be used if unavoidable. Your tests should focus on real code and behavior.
What happens if I write code before writing a test?
You must delete that code and start over, as TDD emphasizes writing code only after creating a failing test.
Install test-driven-development
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
davila7/claude-code-templates