Font Size: a A A

Research On Testing Approach For Aspect-Oriented Programs Based On Control Flow And Data Flow

Posted on:2014-10-22Degree:MasterType:Thesis
Country:ChinaCandidate:L P XiongFull Text:PDF
GTID:2268330425483670Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
As a new software deve lop ment techniq ue, AOP (Aspect-Orie nted Progra ms)has brought ma ny adva ntages, but the dependenc ies betwee n aspects and traditio nmode ls, as well as the new features exis ting in AOP, bring new prob le ms. The newcharacteristics o f aspect-oriented progra m make the mature testing tec hniques,currently used in procedura l and object-oriented progra ms, fa il to be applied toaspect-oriented progra ms d irectly. We need to expand the existing methods orpropose new AOP software testing tec hno lo gy, so researching AOP test method isvery necessary with important theoretical significance and practical value.Aiming at the c haracteristics o f AOP, this paper presents a s truc tura l testingapproach based on contro l flow and data flo w, and perfects a test coverage criterio non the bas is o f predecessor’s work. In order to improve productivity, PSO (partic leswarm optimizatio n a lgorithm) was applied to the a uto matic data ge neration in AOP.The main contents include:First o f a ll, we expounded the meas urability of AOP, the necessity a ndpartic ularity of testing AOP, ana lyzed and compared the curre nt methods used intesting AOP. Although the testing covera ge criterion suc h as stateme nt coverage,branch coverage and path coverage etc. are designed in many approaches, they can’tguarantee test co mp lete ly, and has less research on a uto matic test data ge neratio n onAOP.Second ly, we proposed a structura l test approach based on control flow a nd dataflow. BDUC (Block-Definition-Use-Contro l) express ion is used to show the contro lflow a nd data flow for the AOP whic h wa its to be tested. It generates test s ubpathsaccording to the BDUC express ion, and then generates test data to cover thesesubpaths. In order to achieve full covera ge, in the process of test subpaths generatio n,this paper perfects a test coverage criterio n on the bas is of predecessor’s work. Thiscoverage criterio n inc ludes two kinds o f test covera ge criteria based on contro l flowand a coverage criterio n based on data flow. Case study a nd the experime nta l res ultsshow that the testing approach can cover more subpaths to make the test coveragemore fully by add ing a s ma ll a mo unt of test da ta. Based on this work, this paperdesigned and partia l imp le me nted a test tool called CDTT-AJ (Contro l flow and Dataflow Test Too l for AspectJ). The tool inc ludes five co mpone nts: BDUC e xpressio n generato r, test dema nd generato r, progra m ins trumenta tion, te st exec utio n and testmeas ure generator, and the externa l inp uts are the source procedures under test, testcoverage criteria and test data, the output is the test report.Fina lly, this paper put forward an a uto matic test data ge neratio n for AOP basedon PSO. This method ge nerated test subpaths based on BDUC express ion a nd thecomp leted test coverage criteria, and the n generated test data auto matica lly based onPSO, whic h can coverage these subpaths. The experimenta l results show that thenumber o f test data ge nerating to covera ge this subpaths us ing PSO is less tha n thatus ing the rando m a lgorithm and ge netic a lgorithm. The number o f iteratio ns also isless, and the larger the scale of programs is, the more the method has the advantage.
Keywords/Search Tags:Software Testing, Aspect-orie nted Progra mming, Auto mated Test DataGeneration, Controlflow, Dataflow, Particle Swarm Optimization
PDF Full Text Request
Related items