close

unit , 直覺上我們可以把他想做是一個單元 , 也就是在一個application中可以獨立進行運作的module , 

In object-oriented programming , a unit is often an entire interface, such as a class, but could be an individual method.[

所以unit test , 就是教導我們在針對每一個可以獨立運作的module時 , 必須寫一段test code來判斷其功能的可行性.

而這個概念 , 也有人將他轉換成test-driven design的形式 , 

也就是在面對一個requirement 時 , 我們先不去寫code , 而是先寫好test code , 

然後再依照我們想要符合的test code架構下去進行寫出符合這個test code形式的程式.

 

ref : http://en.wikipedia.org/wiki/Unit_testing

ref : http://ria.richtechmedia.com/2005/11/16/unit-test-%E8%88%87-asunit-30-%E9%97%9C%E6%96%BC-testing-%E8%88%87-test-driven%E7%9A%84%E5%85%A9%E4%B8%89%E4%BA%8B-33/

arrow
arrow
    全站熱搜

    JerryCheng 發表在 痞客邦 留言(0) 人氣()