隨著軟體系統規模日益複雜,測試程序的正確性也更複雜。我們建立一個軟體測試的平台,幫助程式設計師測試所發展的程式。達到方便、高效率、有系統的測試功能。我們採用國際標準化的測試語言---TTCN-3當作我們的開發主軸。就如同一般的程式語言一樣,TTCN-3程式本身不能執行,必須經過直譯或是編譯的過程,轉成可執行的目的碼,才能真正和待測物進行溝通。首先,我們利用語法剖析程式,將TTCN-3程式碼轉成XML格式。XML為國際標準的可擴充式標記語言,我們之所以會選擇XML當作編譯的中間程式,是由於XML主要是用來做資料的交換,且其樹狀結構剛好可以對應TTCN-3的BNF文法,讓我們可以完整地保留原來TTCN-3的資料。接著,我們便可以使用XQuery去擷取我們所需要的資訊並將其轉成適當的C/C++程式碼。TTCN-3的測試案例提供了許多型態的敘述,像是送出訊息、啟動或是停止計時器等,可以直接透過執行介面的函示呼叫來實做。而比較複雜的敘述向是接收、超時控制、選擇語句敘述等。我們利用兩種佇列來實做。由於測試案例和待測程式是兩個獨立的程序,因此在實做凍結敘述句時需要使用信號機來保護程式間的同步行為以及死結的避免。
TTCN-3 is an internationally standardized language for defining test specifications for a wide range of computer and telecommunication systems. MSC is one of TTCN-3 presentation formats. We have already developed a user-friendly environment for constructing MSC test specifications before. Like any other programming language, TTCN-3 code is not executable by itself. It either needs to be interpreted or translated into some executable formats. For the sake of allowing testcases in TTCN-3 to execute against the real software system, first we parse the TTCN-3 code into XML documents and then extract the critical information and translate it into appropriate C/C++ code by XQuery. Consequently testers do not have to write long-winded testcases by themselves. They just need to draw MSC test speci cations and run testcases to achieve the goal of software test automation. In this thesis, we present the implementation technology of TTCN-3 compilation and execution.