What problem does it solve?
Scientific code often harbors subtle bugs due to a lack of rigorous testing, leading to reproducibility issues, unreliable results, and time-consuming debugging. This Skill provides a structured, pragmatic Test-Driven Development (TDD) approach tailored for scientific projects, ensuring your code is correct and robust from the start.
Core Features & Use Cases
- Test-First Development: Write tests before implementation for new features and complex algorithms, guaranteeing desired behavior.
- Bug Fix Verification: Quickly write tests to confirm simple bug fixes, preventing regressions.
- Numerical Validation Integration: Seamlessly integrate with numerical validation processes to ensure mathematical correctness.
- Use Case: When implementing a new Bayesian inference model for neural data, use this Skill to define expected outputs and edge cases with tests before writing the model, ensuring its mathematical integrity and preventing costly errors.
Quick Start
Follow the TDD checklist for your next feature:
1. Understand existing behavior
2. Write a failing test (RED)
3. Run test to confirm RED
4. Implement minimal code to pass test
5. Run test to confirm GREEN
6. Run full test suite
7. Run numerical validation (if applicable)
8. Refactor if needed
9. Commit with descriptive message