参考
- https://baike.baidu.com/item/测试驱动开发/3328831?fr=aladdin
- https://en.wikipedia.org/wiki/Test-driven_development
- https://github.com/mjhea0/flaskr-tdd
总结
先写测试,然后写程序pass掉测试,that is 测试驱动开发。
TDD usually follows the "Red-Green-Refactor" cycle, as shown in the image above:
- Write a test
- Run the test (it should fail)
- Write just enough code for the test to pass
- Refactor code and retest, again and again (if necessary)