> For the complete documentation index, see [llms.txt](https://www.saladpuk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.saladpuk.com/software-testing/tdd101/mantra-of-tdd.md).

# 6.Mantra of TDD

💬 ลองมาเปรียบเทียบว่า การเขียนโปรแกรมแบบปรกติ กับการเขียนโปรแกรมโดยยึดหลัก TDD มันต่างกันยังไงบ้างนะครับ

{% embed url="<https://www.youtube.com/watch?v=o7BG3Fd0JGA&list=PLUjAn8nwWniiL3ToFK8PfmAo8U6IoGAkg&index=8>" %}

## 🎯 สรุปสั้นๆ

### 👨‍🚀 ข้อดีในการใช้ TDD

1. นักพัฒนาสามารถมองเห็นข้อผิดพลาดของโปรแกรมได้ก่อนที่จะเขียนโปรแกรม
2. bug น้อยลง และการแก้ bug ง่ายขึ้น
3. ระบบมีการทดสอบตลอดเวลา และ ทดสอบได้เร็วไม่ต้องรอผลเป็นวัน
4. นักพัฒนาจะส่งมอบ features ช้าในตอนแรก แต่ในระยะยาวจะเร็วกว่านักพัฒนาที่ไม่ใช้ TDD
5. ตัวระบบสามารถเพิ่ม features อื่นๆเข้าไปได้ง่ายและรวดเร็ว
