| The anima of software is quality. How to assure the quality of softwarewithin limited budget and deadline becomes the most important problem.Software testing is one of the software quality control activities, it is the keyfor software to increase the testing portion of the development cycle.Software testing expenses are estimated to be between 20% and 50% of totaldevelopment costs. In software testing, test case generation is the mostdifficult ,expensive and tedious .it can easily take several months of hardwork. Software testers need methodologies and tools to facilitate test casegeneration. And automating the process could significantly improve thequality and reduce the costs of software development.UML is the object-oriented system analysis,design standard modellanguage, it uses a series of views to describe each aspect of the modeledsystem each aspect. UML sequence diagram describes the dynamic behaviorof a software system, especially manifests the message transmission's timeorder of the interactive objects , is valuable information source in softwareintegration test. When modeling object interactions, there will be times whena condition must be met for a message to be sent to the object. In mostsequence diagrams, however, the UML 1.x "in-line" guard is not sufficient tohandle the logic required for a sequence being modeled. This lack offunctionality was a problem in UML 1.x. UML 2 has addressed this problemby removing the "in-line" guard and adding a notation element called aCombined Fragment.This paper takes UML sequence diagrams as its test model and transformsthem into scenario test tree model, explores an approach to generation ofintegration test case based on UML sequence diagrams. From the function,the method mainly does three big parts:1.formalize the sequence diagram UML uses graphics language fordefinition, for the sake of the balance between accuracy and feasibility,makes use of the natural language and formal languages together, is a kind offormalized and half formalized model language. To obtain activityinformation for the function test, it can look for the useful information withinother models to the UML sequence diagram, defines sequence diagram SD asa five dollar set: SD=( O, M, E, → , msg), then defines the semantics andscenario of the simple sequence diagram, finally gives the concept of thescenario test tree.2.generate scenario test tree It is easy to get the scenario test tree forsimple sequence diagram. For the complicated, it is decomposed into a fewparts, each part is done respectively, then all parts are linked organically.Especially for the branch and loop: take each branch of the branch structureas an independent part, do it like the general sequence diagram;According toZOT loop coverage criteria, transform the loop into a branch structure withthree branches: jump the loop ,execute the loop once, execute the loop twice.3.generate scenario test case analyze each branch of the tree: a branchis a scenario , apply category partition method to find environmenta1 settingsrelated to each scenario and combine them with method call sequence,aswell as input and output, to form a test case for each scenario.According to the approach to generate scenario test case based on sequencediagram, we design to implement an experiment system. It takes the sequencediagram in the XMI document format as the import, analyzes the XMIsequence diagram to get the related information for scenario test tree, thengenerates test case from the tree. In the process of function implementation,we resolve a few problems:First the XMI expression problem of sequence diagram, build up asequence diagram using the model tool Metamill4.1 that supports UML2.0and export the sequence diagram in a document of XMI, analyze theexpression manner of the XMI's content, put forward the sequence diagram'sXMI expression that is suitable to the experiment system and give an XMIsequence diagram template. By doing this, it not only benefits in an XMIsequence diagram generating scenario test tree, but also makes it easy totransform the XMI from other model tool into the XMI sequence diagramtemplate, this method can be used everywhere.Next the information storage problem of the scenario test tree, the mainpurpose of the generated scenario test tree is used to generate test case, so weuse the LinkedList in the Java to express the scenario test tree, in the treenode Message there is all information for test case: the node's layer in thetree, message name, guard condition and the state information of the sender.Thus it facilitate the information expression, and make it easy to obtaininformation for test case.Finally the system's main algorithm problem, this paper gives thealgorithms of generating a scenario test tree from an XMI sequence diagramand generating test case from the scenario test tree in the experiment system. |