# 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 อื่นๆเข้าไปได้ง่ายและรวดเร็ว


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.saladpuk.com/software-testing/tdd101/mantra-of-tdd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
