欢迎来到天天文库
浏览记录
ID:32062728
大小:1.49 MB
页数:63页
时间:2019-01-31
《结合动态测试和静态分析的克隆代码重构》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、哈尔滨工业大学工学硕士学位论文AbstractDetectionandRefactoringofcodecloneisanimportantwaytoimprovethereliabilityandqualityofsoftware.Sofar,asthetwotypesofcodeclone,functionallyequivalentcodecloneandstructuralsemanticsimilarcodeclonearemorecomplicatedthansyntacticallysimilarclonecode,sothedetec
2、tionandrefactoringofthetwotypesisless.Themethodofdetectingfunctionallyequivalentcodeclonehastheproblemofhightimecomplexity.Andthereisnorelatedworkofrefactoringfunctionallyequivalentcodecloneandstructuralsemanticsimilarcodeclone.Inresponsetotheseproblems,thispapermainlycompleted
3、thefollowingwork.Aboveall,aimingattheshortcomingsofthecurrentresearchofdetectingfunctionallyequivalentcodeclone,thispaperproposesafunctionallyequivalentclonecandidatecodeextractionmethodbasedonstaticanalysis.Firstofall,theparameterinformationisextractedfromthehighlycohesiveandf
4、unctionallyindependentcodefragmentswhichproducedbytheK-nearestneighborclusteringalgorithm.Thentheinitialcodeclonesetsarefilteredandclassifiedstepbysteptogettheclonecandidatecodegroupsaccordingtothenumberandtypeofparameters.Thecandidatecodegroupsaretheinputofdynamictestingoffunc
5、tionallyequivalentcodeclonedetection.Inthenextplace,fortherefactoringoffunctionallyequivalentcodeclone,thispaperputforwardtwokindsofoptimizationcriteria.Thentheoptimizedfunctionisdeterminedbytheoptimizationcriteria.Next,thecorrespondingrelationofparametersbetweentheoptimizedfun
6、ctionandthenon-optimizedfunctionisdetermined.Therefactoringprogramisgottenbytheprocessreplacement.Atlast,onthequestionofrefactoringstructuralsemanticsimilarcodeclone,thispaperproposesthestandardizationrules,andtheprogramistransformedintothestandardformat.Thenthedifferentcodeclo
7、neisachievedbythedetectiontoolandthedifferentcodecloneisanalyzedtogetthedifference.Thedifferencedataiscomparedwiththemetrictodeterminewhetheritshouldberefactored.Finally,theresultofprogramdifferencemergingisshowniftheprogramissuitableforrefactoring,otherwisetheadviceofnotsuitab
8、leforrefactoringisgivenout.ThispaperusestheCsmallprogr
此文档下载收益归作者所有