日志文件分析
日志文件用于記錄完成 wrksuite 測試后測試用例的運行狀態。有兩個日志文件:suite.log 和 failed.log。
suite.log 文件記錄所有測試用例的狀態。包括三部分:日志頭、主體和統計結果。
如表 1 和表 2 所示。表 1. suite.log 文件結構
項目 | 內容 | 說明 |
---|---|---|
header | tapi Version 3.3 starting Thu Feb 28 10:34:40 EST 2008 Suite root is C:/cqe/wrk/notes This screen output is captured in C:/cqe/wrk/notes/suite.log Failures are also logged to C:/cqe/wrk/notes/failed.log Individual case logfile is {case-dir}/case.log Running nmake -f mswin32.mak -e excl --- Skipping UI tests. |
suite.log 日志文件的頭部記錄了 tapi 版本、測試用例根目錄、日志文件路徑等信息。 |
body | … ./formula/compend......BUILD ok...TEST passed ./formula/compile......BUILD ok...TEST failed … |
suite.log 的主體部分記錄了每個測試用例的運行狀態。每個用例有三種狀態:{BUILD ok...TEST passed}、{BUILD ok...TEST failed} 和 {BUILD failed}。 |
statistic | Done Thu Feb 28 10:58:12 EST 2008 0 builds failed out of 490. 6 tests failed out of 490. 1 known failures out of a total of 6 failed tests. 5 total unknown failures. |
統計數據部分記錄了總體運行結果。用戶可以在這里看到測試用例的統計信息。 |
表 2. failed.log 文件結構
項目 | 內容 | 說明 |
---|---|---|
header | tapi Version 3.3 starting Thu Feb 28 10:34:40 EST 2008 | failed.log 的頭部記錄了 tapi 版本和測試用執行時間等信息。 |
body | ./aaafirst/showinfo......BUILD ok...TEST passed -------------------------------------------------------- Compiled with Notes C API Release = Notes/Domino 8.0.1 Client test platform = NT 3.x Client notes build | date = Build V801_01062008|January 06, 2008 Current test user name = CN=Jack Tester/O=toolkit API test server = LGCToolkit/toolkit -------------------------------------------------------- ./adminp/reqmhier......BUILD ok...TEST failed see also: SPR#YQR06W6A5F can not rename user when i call ADMINReqMoveUserInHier ./formula/compile......BUILD ok...TEST failed … |
suite.log 主體部分記錄了每個失敗測試用例的運行狀態,以及成功通過的測試用例的輸出信息。測試人員可以了解測試失敗的情況,分析失敗的用例。 |
![]() ![]() |
![]()
|
插件測試
在上述自動測試框架中,插件測試就是測試人員用插件的方式增加新的部件(測試用例)。Lotus C API 工具箱隨著新版本 Lotus Notes and Domino 的推出將增加新的功能(子例程和數據結構)。工具箱中的所有 API 在交付之前必須經過全面測試。
圖 4 顯示了自動測試框架中的插件測試。Lotus Notes and Domino 7.0.2 中,Lotus C API 工具箱增加了一系列的 Multipurpose Internet Mail Extensions (MIME) API。我們設計了 MIME 組件,創建了它的子組件(mimedir、cd2mime 等),并插入到測試框架中進行自動測試。它表明自動測試框架為新特性的測試提供了一種有效的方式。
圖 4. 插件測試

結束語
Lotus C API 工具箱自動測試框架是一種有效的 API 自動化測試方法。本文介紹了自動測試框架的設計及其重要意義,可以幫助讀者了解如何為自己的產品開發自動 API 測試工具。
文章來源于領測軟件測試網 http://www.kjueaiud.com/