DUNIT

DUNIT

DUNIT,單詞,解釋為用於Borland Delphi編程的極終極測試框架Delphi 2005中集成了一個新的功能模組

簡介

DUnit:用於Borland Delphi編程的極終極測試框架Delphi 2005中集成了一個新的功能模組:單元測試(Unit testing)。這裡介紹的DUnit是為Delphi4-7而開發的一個單元測試工具

DUNITDUNIT
。若能隨時更新測試程式並且經常反覆地執行它們,你就能夠更輕易地產生可靠的程式代碼,而且在進行修改與重構(refactorings)時更有把握不會破壞原有的程式代碼,於是,應用程式等於有了自我測試的能力。

Delphi單元測試工具Dunit介紹

基本介紹

Dunit是Xunit家族中的一員,用於Dephi的單元測試。是Extreme Programming測試實現Xtreme Testing的一種工具。Dunit是一個Free的測試工具,沒有代碼復蓋率功能。

使用Dunit應該先看看Dunit安裝目錄下的doc\README.html。本文也是參看Readme寫的。

測試環境

在使用Dunit前應該將下載的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 test cases.

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基本實現方法(GUI方式)

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

相關詞條

相關搜尋

熱門詞條

聯絡我們