摘要
Abstract
There are some features in object-oriented software ,such as classes ,encapsulation ,inheritance ,and dynamic con-nections .They make the division of object-oriented testing procedures and the choice of strategy different from traditional testing ideas .According to the characteristics of object-oriented software ,the paper adopts the methods based on models for testing software and adds OCL (Object Constraints Language )constraints for sequence diagram of UML (United Model Language )design model and tests interaction among classes .The paper proposes the algorithm for generating EG (Execution Graph )and transforms SD (Sequence Diagram) to EG ,and SD is constrainted by OCL for testing interaction among classes .In this algorithm ,the testing problem for four major combined fragments including alt ,loop ,opt ,break in the new features ,and their nesting among them and the polymorphism , will be solved in sequence diagram of UML 2.0 .In order to get the smallest complete test pathes ,strategy for traversing EG and al-gorithm for generating test paths are presented .Finally ,the paper proposes algorithm for determining test scenarios by testing pathes , deleting invalid scenarios by OCL constraints ,and generating test cases .Experimental validation shows that our solution can test software based on UML sequence diagram and OCL .关键词
UML/顺序图/OCL/执行图 (EG )/测试场景/测试用例Key words
UML (United Model Language )/sequence diagram/OCL (Object Constraints Language )/execution graph (EG )/test scenario/test case分类
信息技术与安全科学