Font Size: a A A

Research On Testing Technology Of Object-oriented Programs Based On Dependency Analysis

Posted on:2013-01-28Degree:DoctorType:Dissertation
Country:ChinaCandidate:Y M ZhangFull Text:PDF
GTID:1118330362466294Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Software testing is an important mean to improve and guarantee software quality.It is an expensive, tedious and labor-intensive work. Object-oriented software testingmethod includes four levels: method level testing, class level testing, class clusterlevel testing/inter-class testing and system level testing. Studies show that methodlevel testing and class level testing (unit testing) and class cluster leveltesting/inter-class testing (integration testing) are key research areas in softwaretesting. Considering the characteristics of actual software under test, this paperinvestigates theories and applications of object-oriented programs, aiming atevolutionary generation problem of test data based on path coverage in unit testingand class-integration-test order determination problem in integration testing. The maincontents of the paper are listed as follows.Method level testing, methods in a class and the traditional procedures (orfunctions) have some differences in some situations. Therefore, this paper analyzesthe dependency information of object-oriented programs that containexception-handling constructs. Through studying the influence of exception-handlingconstruct on the program dependency information, we expect to obtain the accuratelyinformation such as control flow, data flow, control dependence and data dependenceinformation. They can provide accurate information for software engineering taskssuch as system architecture testing.On the basis of analyzing the dependency information, we propose a staticapproach to detecting infeasible basis path of programs with exception-handlingconstructs based on branch correlations of different conditional statements. First, wegive the judgment principles of correlation for conditional statement based ondataflow information, and then detect infeasible paths based on branch correlations ofdifferent conditional statements. The novelty of the dataflow information lies in thefact that it takes account of exception-handling constructs and pointer alias analysis.The results of case study show that the proposed method can further enhance theaccuracy of feasibility for the detected basis paths, laying a good foundation for us tosolve path covering problem efficiently.For the problem of test data generation based on path coverage, we propose amethod of multiple path coverage test data generation on the basis of determining thefeasibility of paths. First, the program under test is expressed as control flow graph, and the target paths are encoded into the form of combining statement label with flowdirection of branch (i.e. T and F); then, genetic alorithm is applied to generatemultiple test data, and the fitness function of an individual takes into account thematching degree of the traversed path and the target paths. The experimental resultsshow that the propose approach can avoid redundant test, improving the efficiency oftest data generation effectively.To solve the problem of determining class-integration-test order when only staticdependencies are considered and the overall complexity of created test stubs is takenas the optimization goal, we present an approach to determinng class-integration-testorder based on coupling measures. The technique combines inter-class couplingmeasurement and graph-based heuristic algorithm. The former is used to assess thecomplexity of each stub and the latter is used to break cycles with the minimumoverall complexity of stubbing. First, we propose a computing method of couplingweight used in coupling measure, by which each test stub complexity is reevaluated.Then, present an effective graph-based heuristic algorithm for breaking the cycles ofclass diagram. The experimental results show that our approach can make the overallstubbing complexity for breaking cycles reduced obviously, and lead to lowerintegration test cost.We also propose an approach to deal with class-integration-test order in thepresent of cyclic dependencies, in which both dynamic binding and abstract classesare taken into account. The number of created test stubs is taken as the optimizationgoal. First, inter-class static and dynamic dependencies are analyzed. Then, rules ofedge deletion are given, in addition, an algorithm of eliminating the cycles thatformed by static and dynamic dependency is presented, ensuring that the number oftest stubs is minimum. Furthermore, an integration testing order strategy and analgorithm are given, enabling class-integration-test order based on test-levelgeneration. However, abstract classes that cannot be instantiated make some testlevels infeasible. Therefore, we adjust the test order to make all of them feasible. Theproposed strategy needs less test stubs and can significantly improve test efficiencycompared to previous work.This research greatly enriched the theory of software testing, achieved the goalsof improving the efficiency of test data generation and automatically generating classtest order, therefore, it has great theoretical significance and practical applicationvalues.
Keywords/Search Tags:dependency analysis, test data generation, class test order, couplingmeasures, test level, abstract class
PDF Full Text Request
Related items