您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > DBunit
單元測試工具Dunit介紹
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/1/29 15:56:21 ] 推薦標簽:

  Dunit 是Xunit 家族中的一員,用于Dephi 的單元測試。是ExtremeProgramming 測試實現(xiàn)Xtreme Testing 的一種工具。Dunit 是一個Free 的測試工具,沒有代碼覆蓋率功能。

  Dunit 的官方Web Site 是https://sourceforge.net/projects/dunit/。使用Dunit 應(yīng)該先看看Dunit 安裝目錄下的docREADME.html。本文也是參看Readme 寫的。

  配置測試環(huán)境

  在使用Dunit 前應(yīng)該將下載的Dunit 解壓。然后后將Dunit 的路徑加到菜單Tools->Environment Options 里面的Library->Library Path 中。

  Dunit 的主要文件

File
Description
TestFramework.pas The framework itself.
TestExtensions.pas Decorator classes that may be used to extend testcases.
GUITesting.pas Classes for testing user interfaces (Forms and Dialogs).
TextTestRunner.pas Routines to run tests in console mode.
GUITestRunner.pas The graphical user interface to the framework..
GUITestRunner.dfm The GUITestRunner Form

 

  Dunit 基本實現(xiàn)方法(GUI 方式)

  Dunit 的基本實現(xiàn)思路是將被測試代碼(單元)與測試代碼(單元)分開。提供一個FrameWork 及一個運行界面。所有的測試單元都應(yīng)繼承TtestCase。

  運行GUI 界面

  運行TestCase

  這里要注意的一點是SetUp 方法和TearDown 是每個測試方法運行時都被調(diào)用的,如果想要只運行一次Setup 及TearDown,應(yīng)該使用TtestSetup 類,具體情況后面《Dunit 附加功能》一節(jié)。

上一頁123下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd