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

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

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

  配置測(cè)試環(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 基本實(shí)現(xiàn)方法(GUI 方式)

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

  運(yùn)行GUI 界面

  運(yùn)行TestCase

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

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