利用Stub來打破關連性 (4)
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 3 Using stubs to break dependencies
利用Stub來打破關連性 (4)
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 3 Using stubs to break dependencies
利用Stub來打破關連性 (3)
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 3 Using stubs to break dependencies
利用Stub來打破關連性 (2)
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 3 Using stubs to break dependencies
利用Stub來打破關連性 (1)
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 3 Using stubs to break dependencies
Unit test and State-based testing
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 2 A first unit test
單元測試的基本觀念
Source: The art of unit testing with examples in .NET, Roy Osherove
http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274/ref=sr_1_1?ie=UTF8&s=books&qid=1267086529&sr=1-1
Chapter 1 The basics of unit testing
Mock和Stub的比較
Martin Fowler 寫過一篇文章, 叫"Mocks aren’t stubs" (http://martinfowler.com/articles/mocksArentStubs.html). 討論Mock和 stub的不同
說真的一開始看了半天, 不是很懂他要講什麼, 後來在網路上看了半天, 終於比較有感覺了. 以下是我簡單的整理.
首先我們首先看個例子:
(1)定義一個 Mail Service的interface

TDD和Unit Test, Accpetance Test的比較
很多時候大家不清楚TDD和Unit test, accpetance test有時麼差別, 因此在撰寫測試時, 都把他們混在一起. 到時候再來說, TDD不work.
小弟整理了一下它們之間的差別, 有經驗的讀者歡迎補充一下
TDD v.s. Unit Test
1. Test first v.s. Test after
TDD 的簡介
http://www.agiledata.org/essays/tdd.html
TFD(Test first design) 的步驟
(1) 先快速加入一個測試, 基本上是足夠讓程式不能運作就可以
(2) 接下來執行你的測試, 已確定這個新增的測試會失敗
TDD 相關的參考資料
Recommended TDD Tutorials
http://www.infoq.com/news/2009/05/recommended-tdd-tutorials
TDD tutorials recommended by members of the Extreme Programming list
TDD應用狀況的調查 (下)
Test Driven Development (TDD) Survey: October 2008
http://www.ambysoft.com/surveys/tdd2008.html
TDD應用狀況的調查 (上)
Test Driven Development (TDD) Survey: October 2008
http://www.ambysoft.com/surveys/tdd2008.html