Font Size: a A A

Analysis And Research On Automatically Generating Software Test Cases Based On Genetic Algorithm

Posted on:2014-06-06Degree:MasterType:Thesis
Country:ChinaCandidate:L L MiaoFull Text:PDF
GTID:2268330401976275Subject:Traffic Information Engineering & Control
Abstract/Summary:PDF Full Text Request
It is estimated that80%of software development cost is spent on detecting and fixingdefects. To tackle this issue, a number of tools and testing techniques have been developed toimprove the testing framework. Although techniques such as static analysis, random testingand evolutionary testing have been used to automate the testing process, it is not clear what isthe best approach. Previous research on evolutionary testing has mainly focused onprocedural programming languages with simple test data inputs such as numbers. In this work,we present an evolutionary testing approach that combines a genetic algorithm with staticanalysis to increase the number of faults found within a time frame.Genetic Algorithms (GA) have been used successfully to automate the generation of testdata for software developed in ADA83. The test data were derived from the program’sstructure with the aim to traverse every branch in the software. The investigation uses fitnessfunctions based on the Hamming distance between the expressions in the branch predicateand on the reciprocal of the difference between numerical expressions in the predicate. Theinput variables are represented in Gray code and as an image of the machine memory. Thepower of using GA lies in their ability to handle input data which may be of complexstructure, and predicates which may be complicated and unknown functions of the inputvariables. Thus, the problem of test data generation is treated entirely as an optimizationproblem.Random testing is used as a comparison of the effectiveness of test data generation usingGA which requires up to two orders of magnitude fewer tests than random testing andachieves100%branch coverage. The main features of the genetic algorithm is initiallyunknown search space to collect information and then indicate to the ability of other usefulsubspace. If the logical structure of spatial variation is not too large, it can be exhaustivedevelopment of heuristic search strategy to remain under the control of the calculation time.Genetic can be used as an adaptive sampling strategy to search a large and complex space.The sampling strategy is to adapt the sample (offspring) are used to the subsequent samplingbias into the sampling of the high-expected performance in the global best domain feedback.This means that, even if a solution has generated a good genetic optimization parametersvalidity also depends on the usefulness of information obtained through feedback. Importantto select the appropriate feedback mechanism to be adaptive search strategy. The advantage ofGA is that through the search and optimization process, test sets are improved such that theyare at or close to the input subdomain boundaries. The GA gives most improvements overrandom testing when these subdomains are small. Mutation analysis is used to establish thequality of test data generation and the strengths and weaknesses of the test data generation strategy.Finally, we designed and implemented a system based on genetic algorithm test casesautomatically generated. The basic design idea of the system is the triangle program as atypical example, the specified data range and input data to generate test cases to the fullestextent possible the complete path coverage. Derived based on experimental data, this systemnot only to complete the simple generation of the test case of the pre-set target path, but alsocan fully traverse the target path generated to meet the requirements of the test case. At thesame time, the program path to be covered or not recorded, the best solution currently canalso be given while path are not fully covered. Experiments show that GA required less CPUtime in general to reach a global solution than random testing. The greatest advantage is whenthe density of global optima (solutions) is small compared to entire input search domain.
Keywords/Search Tags:Automatic test case generation, Path wise test, Soft ware test, Genetic algorithm
PDF Full Text Request
Related items