近代由於網際網路的發達,網頁應用軟體也隨之興起,使得確保網頁應用軟體的品質成為一個重要議題。軟體測試是確保軟體品質主要方法,若軟體測試純靠人力既費時又費力,且易出錯,本論文實作一個黑箱式網頁應用測試案例產生器,可以自動地產生網頁應用測試案例,以降低軟體開發成本與提高軟體品質。本工具首先分析以XML定義而成的規格書,將其轉換成網頁關係圖並交由測試路徑產生器來系統化地條列出網頁關係圖上的測試路徑。接著測試資料產生器會將每條路徑上的節點(web page)所對應到的功能分別產生測試資料,而若是動態網頁需要測試輸入的部分我們將藉由以定義好之類別圖與物件限制語言,轉換成限制邏輯程式的敘述式,來幫助我們求解得到測試輸入與預期輸出。最後根據這些測試資料可產生與JWebUnit網頁測試工具相符之Java測試案例程式碼,使用者便可利用JWebUnit測試平台自動執行所產生出來的測試案例碼。
Web applications become more prevalent due to the Internet advancement in recent years, and the quality assurance of web applications has become more important issue. Software testing is the main method to ensure the quality of software. Manual software testing is error prone. For the sake of reducing development costs and improving the quality of web applications, this thesis develops a black-box test case generator for web applications to automatically generate test cases for web applications. This tool first analyzes from specifications defined in XML, and transforms it into web page dependence graph. The test path generator then systematically enumerates the test paths on the page dependence graph. The test data generator generates test data correspond to the function from every node (web page) on the path. To deal with dynamic page on the path that requires test input, we use the definition of the class diagram and OCL and transform them into constraint logical programming predicates. The solution of predicates is the corresponding test input and expected output. Finally, test script generator generates a test class consistent with JWebUnit from test data, and the user can use JWebUnit test platform to automatically execute the test codes.