TDD
TDD 的理解开始 错了了
TDD(测试驱动开发)-Test-Driven Development。 先写测试用例在开发。
先用 junit 写测试,然后再写代码;
写完代码,运行测试,如果测试失败,修改代码,运行测试……直到测试成功。
如果以后对程序进行修改,重构 ( refactoring ),只要再运行测试代码。如果所有的测试都成功,则代码修改完成。
TDD life-cycle:
- Write the test
- Run the test (there is no implementation code, test does not pass)
- Write just enough implementation code to make the test pass
- Run all tests (tests pass)
- Refactor
- Repeat
- Test-driven development is not about testing. Test-driven development is about development (and design), specifically improving the quality and design of code. The resulting unit tests are just an extremely useful by-product.
more please refer to this page :https://technologyconversations.com/2013/12/24/test-driven-development-tdd-best-practices-using-java-examples-2/
要爱上写总结,不断的总结。
不断地反省、提升、改变自己。
简单、专注、持久。