中圖分類號 :?。裕?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