一個基于UML協作圖的集成測試用例生成方法

發表于:2009-03-04來源:作者:點擊數: 標簽:umlUML協作
一個基于UML協作圖的集成 測試 用例 生成方法 王林章 (南京大學計算機科學與技術系,南京市漢口路22號419信箱,210093,南京)摘要: UML協作圖描述了系統的一個協作中參與對象之間的結構關系和交互行為,確認它們是否被正確實現是 集成測試 的 工作 。本文
一個基于UML協作圖的集成測試用例生成方法 王林章 (南京大學計算機科學與技術系,南京市漢口路22號419信箱,210093,南京)摘要: UML協作圖描述了系統的一個協作中參與對象之間的結構關系和交互行為,確認它們是否被正確實現是集成測試工作。本文提出了一個基于UML協作圖生成集成測試用例的方法,將表示設計的協作圖作為測試模型,并從中提取相關信息生成用于測試所描述的行為的集成測試用例。首先通過遍歷每條消息的直接后繼識別協作圖中的表示用例實現的所有可能的場景路徑,然后在遍歷每條場景路徑的過程中獲取相應協作執行的路徑條件、參數變量和預期方法調用序列,最后使用范疇-劃分方法確定場景路徑上的輸入、輸出、環境條件的合理組合作為覆蓋該場景路徑的測試用例,用于測試一個協作場景路徑上的交互行為。該方法完全基于UML,集合了白盒方法和黑盒方法,生成了較少的測試用例覆蓋所有的測試需求。本文將該方法應用于一個ATM建立會話的用例片斷實現的實例,證明了其可行性和實用性,并提出了一個用UML設計的工具框架,以實現該方法的自動化,使得其可以方便地集成到使用UML的軟件開發過程中。關鍵詞:測試用例生成,集成測試,UML協作圖,場景路徑

中圖分類號 :?。裕?11   文獻標識碼 :    文章編號 :

An Approach to Generate Integration Test Cases based on UML Collaboration Diagrams Linzhang Wang, Xuandong Li,Guoliang Zheng (CS Department , Nanjing University, Hankou Road 22 P.O. Box 419, 210093, Nanjing) Abstract: UML collaboration diagrams represent the structure relationship and interactive behavior of the objects involving in a collaboration of the software system, whether they are correctly implemented or not can be validated by integration testing. This paper propose an approach to generate integration test cases based on UML collaboration diagrams, take collaboration diagram as test model, from which we can extract information to generate integration test cases for testing the behavior. Firstly, the method identifies all the scenario paths in the diagram which represent use case realization by traverse the direct suclearcase/" target="_blank" >ccessors of each message. Then it selects and traverses each scenario path to get the method call sequence, path condition and parameters. Lastly, it applies category partition method to generate rational combination of input parameters, environmental conditions, as well as the corresponding output and method call sequence, to form a test case for each scenario path, thus we can test the interactive behavior of the software. This method completely base on UML, combine white-box and black-box test method to generate fewer test cases to test the gray-box behavior. In this paper, we apply this approach to an example of constructing sessions between cardholder and the bank through ATM, proving its feasibility and practicability, also propose a corresponding tool framework to facilitate its automation, thus to easily be deployed into the UML –based software development process. Keywords: test cases generation, integration testing, UML collaboration diagram, scenario path

1、引言 面向對象的技術因為能夠解決傳統程序設計語言的問題,自提出后,一度成為研究熱點,事實上采用面向對象技術減少了不少錯誤的發生,對于提高軟件質量起到了很大的作用,但是面向對象技術本身在任何情況下都不會排除軟件測試的動機,同時面向對象語言的本質特征,如繼承、封裝、和多態等,也帶來了新的故障風險,并給軟件測試提出了新的挑戰。[1,2,9] 區別于傳統軟件的功能分解,面向對象軟件是通過合成來構造軟件的,因而集成是面向對象軟件開發中最重要的工作,面向對象軟件構造過程中有的不同層次的集成,包括:從方法到類的集成,類通過繼承集成,類通過容器集成,類到組件的集成,組件到應用系統的集成。在面向對象的迭代式增量開發過程中,通過不斷的集成產生系統的可執行的版本,但每一個集成的環節都可能引入錯誤,導致軟件中存在缺陷,為了能夠發現軟件集成中的問題,面向對象軟件的

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97