Font Size: a A A

Automatic Generation Of Test Cases Based On UML Activity Diagram

Posted on:2023-06-28Degree:MasterType:Thesis
Country:ChinaCandidate:W J ChenFull Text:PDF
GTID:2558306848955549Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the continuous development of the software industry,software testing has an unignorable impact on software development,and software testing can effectively ensure software quality.Test cases are the core of software testing.Manual design of test cases is inefficient,while automatically generating test cases can effectively improve the efficiency of software testing.UML is a standardized unified modeling language.Extracting information from UML models can be used to generate test cases.The method of generating test cases based on UML model has gradually become a popular research direction in software testing.This research analyzes the advantages and disadvantages of various UML dynamic model diagrams,and chooses to generate test cases based on UML activity diagrams.The research contents of this paper mainly include:(1)UML activity diagram is used to model the system.After modeling,different kinds of structures in the activity diagram are analyzed and the activity diagram is standardized.Considering that UML is a semi-formal language,it is necessary to formally define the activity diagram,simplify the activity diagram,and then convert the simplified activity diagram into a directed diagram according to the corresponding conversion rules.(2)In order to meet the test sufficiency requirements and reduce the blindness of the test,the node coverage criterion,the transition edge coverage criterion and the path coverage criterion are proposed based on the idea of white-box testing.According to the characteristics of the concurrent structure in the activity diagram,a test case coverage criterion which is more suitable for the concurrent structure is formulated.(3)This paper adopts a two-level test scenario architecture based on graph search algorithm and improved anti-ant colony optimization algorithm,and implements an activity graph-based test case generation method covering a large number of concurrent activities.First,starting from the activity diagram,the search algorithm of graph theory is used to form the primary test scene.Then,combined with the constraint relationship between concurrent activities,the improved anti-ant colony optimization algorithm is used,and the directed graph is searched by dividing the location band to obtain the secondary test scene.Next,the primary test scenarios and secondary test scenarios are integrated and optimized,and finally the test data and test scenarios are organically combined to obtain corresponding test cases.(4)The test case generation method based on UML activity diagram studied in this paper is applied to the system instance.Taking the common user activity diagram as an example,the feasibility and effectiveness of the method are verified by analyzing the results of generating test cases.The innovative work of this paper is reflected in: using a two-level test scene architecture to design a test case generation method based on activity diagram,forming a concurrent structure test scene by an improved anti-ant colony optimization algorithm,and introducing a hierarchical division of location bands.The test results show that the method in this paper does not need to divide the location band multiple times,so it is more convenient and the generated test cases have higher coverage.Furthermore,while ensuring efficiency,this method also satisfies a certain coverage rate,and can effectively solve the problem of the number of paths that may explode due to a large number of concurrent activities contained in the activity diagram.
Keywords/Search Tags:Software Testing, UML Activity Diagram, Test Cases, Automatic Generation, Test Scenario
PDF Full Text Request
Related items