Font Size: a A A

Automatic Test Case Generation Based On Data Flow Criteria

Posted on:2019-08-20Degree:MasterType:Thesis
Country:ChinaCandidate:J Q ChenFull Text:PDF
GTID:2428330566463288Subject:Software Engineering Technology
Abstract/Summary:PDF Full Text Request
Software testing can be divided into three steps:(1)design appropriate test cases for the program under test;(2)execute designed test cases in programs;(3)judge whether actual execution results are same with expected results.Writing a test case for programs manually costs high and requires testers with rich experience.Implementation of automatic test case generation will help improving efficiency of software testing and reducing test cost.Test cases can be generated either randomly or aiming at specific test coverage criteria.Coverage criteria can be classified into two categories:(1)control flow criteria like statement coverage criteria,branch coverage criteria;(2)data flow criteria like alluse coverage criteria.Data flow criteria focus on data flow interactions in programs.If a variable is defined in one statement then used in another statement,it is necessary to execute the path between two statements in order to check potential faults.Data flow criteria can obtain interplay of methods through state variables more easily compared with control-flow criteria,which leads to a wide range of application prospect.However,there are still some challenges of test case generation based on data flow criteria:(1)the fitness function used in data flow test case generation contains little information of test cases leading to weak guidance of test case evolution;(2)covering data flow criteria is harder than control flow criteria which influences scalability of data flow criteria in practice.To overcome these problems,we study data flow based test case generation from following aspects:(1)We implement data flow based test case generation with genetic algorithm and design a new fitness function which considers definition node and use node respectively,using branch distance to measure the distance from test case to the node.In addition,the fitness function introduces a constant to present the information of killing node between definition node and corresponding use node.It can provide more information for guiding evolution of test cases.(2)We replace some of DUPs with branches using collateral coverage relationship between all-use criteria and branch criteria before generating test case.Thus,the test case just needs to cover corresponding branches of these DUPs rather than covering DUPs directly during test case generation.It can reduce the complexity of data flow testing for that there is no need to guarantee the test cases covering definition node and use node of the same variable at the same time and no killing nodes between definition and use.(3)We design and implement a tool DFTCG for data flow test case generation,which implements search-based test case generation with genetic algorithm for Java language.The tool provides a visual interface for users to configure parameters and collects different kinds of results.
Keywords/Search Tags:software testing, test case generation, data flow criteria, collateral coverage
PDF Full Text Request
Related items