Specter

以下節錄自官方網頁:Specter的說明:
Specter is an object-behaviour specification framework. It enables behaviour driven development by requiring developers to write executable specifications for their objects, before actually implementing them. Technologically this is similar to test driven development, however the shift in nomenclature removes the psychological barrier of writing "tests" for code that does not exist. (Existing projects implementing this idea include RSpec for Ruby and NSpec for .NET.)


簡單的說,是一個用來測試物件行為規格的 Framework,很類似 Unit test framework,但語法比較起來,更為簡潔:
如果你用 NUnit 可能會是這樣:
[Test]
public void StackCountMustEqual42()
{
Assert.AreEqual(42, stack.Count)
}

改用 Specter 的話,會是這樣子:
specify stack.Count.Must == 42

留言

這個網誌中的熱門文章

三本免費的電子書

NModbus