1. 程式人生 > >軟件工程 - Test-Driven Development (TDD),測試驅動開發

軟件工程 - Test-Driven Development (TDD),測試驅動開發

hat mage ssa com ask png TP aid ima

參考

  1. https://baike.baidu.com/item/%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91/3328831?fr=aladdin
  2. https://en.wikipedia.org/wiki/Test-driven_development
  3. https://github.com/mjhea0/flaskr-tdd

總結

先寫測試,然後寫程序pass掉測試,that is 測試驅動開發。

技術分享圖片
TDD usually follows the "Red-Green-Refactor" cycle, as shown in the image above:

  1. Write a test
  2. Run the test (it should fail)
  3. Write just enough code for the test to pass
  4. Refactor code and retest, again and again (if necessary)

軟件工程 - Test-Driven Development (TDD),測試驅動開發