
淺談驅動開發
驅動代表由某件事情引導或者決定。在軟體開發的過程中,每一步都需要有明確的規範,去引導所有的參與者,而非讓每個人以自己的方式去開發。
Discuss about driven development
“Driven” means being guided or directed by something. In software development, every step needs to be guided by clear standards and rules that provide a consistent direction for all developers, rather than allowing everyone to develop in their own way.
演進
每一個驅動開發,都有其原因的發展依具。我想簡單整理出一些廣為人知的驅動開發,了解他們的演進。
Evolution
Each driven development approach is the solution around a specific question. I would like to provide a brief overview of some most well-known approaches.

瀑布式開發
核心的思想是先理解需求,完成設計後,開始寫程式。優缺點明顯
優點
- 流程清晰
- 每個階段有明確的交付結果
但缺點也很明顯
- 沒有彈性,需求在早期被固定
- 若問題到後期被發現,修正成本高
- 跨組溝通困難,開發,測試和業務之間理解不同
如何改進 – 讓測試提前介
Waterfall development
The core idea is to understand the requirements first, then complete the deign before implementation.
Advantages
- Clear and structured development process
- Each step has clearly defined deliverables
Disadvantages
- Less flexibility, the requirements are often fixed early in the development process
- High cost of fixing issues when they are discovered in later stages
- Communication gaps between cross-teams. All participates might be not in the same page.
How to improve – introduce testing in earlier stages

測試驅動開發
最常見的開發,霸榜驅動開發多年。顧名思義,先寫測試,再寫程式。
優點
- 測試提早介入,減少後期出錯成本
- 迫使工程師先思考功能跟介面
- 程式較容易維護,易懂
缺點
- 初期需耗費時間寫測試
- 後期可能產生大量維護成本高的測試
- 測試程式碼,並不代表程式符合使用者需求
如何改進 – 讓開發更知道該測試什麼
Test-Driven Development
One of the most famous development approaches. TDD has remained a prominent practice in software development for many years. As its name, the idea is simple: write tests first, then write the code.
Advantages
- Testing is introduced in early stage, reducing the cost of fixing bugs
- Make engineers think about functionality and interface before implementation
- Make code easier to maintain, understand and refactor
Disadvantages
- Require more time and effort to write test cases at beginning
- Over time, the project may accumulate a large number of test cases that are costly to maintain
- Passing test cases doesn’t mean the software meets users’ actual needs
How to improve – help developers better understand what should be tested in the first place

行為驅動開發
除了測試外,要確認結果是否符合預期行為。
優點
- 業務,產品經理,工程師一起討論需求
- 測試更接近實際使用場景
缺點
- 需要多部門共同參與討論
- 情境描述需花費大量時間,若情境過多,容易產生大量測試,或重複測試
- 須有人將業務需求轉換成軟體開發規範
如何改進 – 涉及複雜業務時,讓系統知道業務需求
Behavior-Driven Development
Besides test cases, BDD focuses on ensuring that the system behaves as expected.
Advantages
- Cross-teams discussions, including sales, PMs, engineers
- Make test cases more closely aligned with real user scenarios
Disadvantages
- Requires collaboration from multiple departments
- Spend a lot of time on writing detailed scenarios. Too many scenarios might lead to excessive or duplicated test cases
- Require someone to be bridge between business requirements and software development specifications
How to improve – when dealing with complicated business logic, help the system better understand business requirements

領域驅動設計
對於複雜且龐大的專案,先理解業務,再建立能實現業務邏輯的模型。
優點
- 有通用語言,模型,上下文邊界去產生所有人都懂的模型
- 適合大型且邏輯複雜的系統
- 業務能持續在模型裡累積
缺點
- 前期學習曲線高,且要深入理解業務
- 若系統不複雜,則可能過度設計
- 需要業務長期參與維護
Domain-Driven Design (DDD)
For large and complex projects, the approach is to understand the business domain first, then build models that accurately represent and implement its business logic.
Advantages
- Establishes a shared language, domain models, and bounded contexts to create a common understanding among all participators.
- Well-suited for large systems with complex business logic.
- Allows business knowledge to continuously evolve and accumulate within the domain model.
Disadvantages
- Has a steep learning curve and requires an in-depth understanding of the business domain.
- May lead to overengineering if the system is not particularly complex.
- Requires long-term involvement from business stakeholders to maintain and evolve the models.
到此開發已經發展的非常熟成,但我們總會遇到其他問題。
最想解決的問題
該怎麼更快,更穩定的持續交付
By this stage, software development methodologies had become mature. However, new challenges continued to emerge.
The next challenge
How can we deliver software faster, more reliably, and continuously?

DevOps
將開發,測試,整合 (CI),部署 (CD),維運之間,形成一個自動迴圈,互相協作。
優點
- 加快產品從開發到上線的速度
- 減少人工部署的錯誤
- 開發跟維運同時承擔系統品質
缺點
- 初期需要投入時間部署基礎設施,自動化腳本
- 需要改變多個團隊長期協作
- 自動化流程如過設計不良,可能使錯誤迅速擴散
DevOps
DevOps connects development, testing, integration (CI), deployment (CD), and operations into a continuous automated cycle.
Advantages
- Accelerates the delivery process, from development to production.
- Reduces errors caused by manual deployment.
- Encourages development and operations teams to share responsibility for system quality.
Disadvantages
- Requires an initial investment of time and effort to set up infrastructure and automation scripts.
- Requires long-term collaboration and cultural changes across multiple teams.
- Poorly designed automation pipelines can cause errors to spread rapidly.
… When AI involved 當 AI 加入後

規格驅動開發
先定義需求,建立規格,再讓 AI 按照規格,建立計劃,以及後續執行,測試,驗證,迭代。
優點
- 定義以及規格讓 AI 減少模糊需求
- 規格可以作為溝通以及後續維護
- 有助於將複雜工作拆分成小任務
缺點
- 前期需花時間建立需求以及規格
- 若初始規格錯誤,會產生大量的錯誤代碼
- 規格有時若未定義清楚的邊界,AI 會產出錯誤
- 如何審查以及驗證
Specification-Driven Development (SDD)
Start by defining the requirements and creating a clear specification. AI then uses the specification to generate a development plan, followed by implementation, testing, validation, and iteration.
Advantages
- Clear requirements and specifications help AI reduce ambiguity and better understand what needs to be built.
- Specifications serve as a shared reference for communication and future maintenance.
- Helps break down complex work into smaller, more manageable tasks.
Disadvantages
- Requires time and effort to define requirements and create specifications at first place.
- Incorrect specifications cause large amounts of incorrect code.
- If boundaries and constraints are not clearly defined, AI may generate incorrect or unintended code.
- How to effectively review and validate AI-generated code.
我們總有問題,也一直尋找不同的方法解決。每個方式都對應不同的問題,也都產生了新的問題。沒有什麼是最好的開發方式,而我們,將一直尋找方法。
There will always be challenges, and we will continue searching for different ways to solve them.
Each development approach addresses a different set of problems, but each also introduces new challenges of its own.
There is no single best approach to software development. And we will continue to explore, adapt, and find better ways forward.