測試驅動程式



什麼是測試驅動程式?

測試驅動程式用於自底向上整合測試中,以模擬尚未整合的上層模組的行為。測試驅動程式是充當呼叫模組的臨時替代模組,並提供與實際產品相同的輸出。

當軟體需要與外部系統互動時,也使用驅動程式,通常比樁程式更復雜。

驅動程式 - 流程圖

Role of Driver in Bottom Up Integration Testing

上圖清楚地說明了模組4、5、6和7不可用進行整合,而以上模組仍在開發中,目前無法整合。因此,使用驅動程式來測試這些模組。整合順序將為

4,2
5,2
6,3
7,3
2,1
3,1

測試方法

+ Firstly, the integration between the modules 4,5,6 and 7
+ Test the integration between the module 4 and 5 with Driver 2
+ Test the integration between the module 6 and 7 with Driver 3
廣告