欢迎来到天天文库
浏览记录
ID:10873309
大小:2.62 MB
页数:76页
时间:2018-07-08
《基于子图发现的设计模式识别系统——CodeMiner插件和源码解析模块的设计与实现---毕业论文.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、本科毕业论文基于子图发现的设计模式识别系统——CodeMiner插件和源码解析模块的设计与实现DesignPatternDetectingSystembySubgraphDiscovery——TheDesignandImplementationofCodeMinerPlug-inandCodeAnalysisModule姓名:学号:学 院:软件学院系:软件工程专业:软件工程年级:指导教师:年月摘 要现代软件工业已经广泛地应用设计模式来重用成功的设计实践和提高软件系统的质量,然而受制于软件系统的规模和设计文档的缺失,开发人员无法直观地理解现有软件系统中应用的设计模式,从
2、源码中发现设计模式实例对于提高软件可理解性和可维护性、软件设计重用以及软件重构具有重要意义。为了便于在实际应用中理解、选择和实践设计模式,设计模式的特征通常以非形式化的方式描述,在进行设计模式识别时需要对其进行形式化的表示,已有的研究中采用不同的中间表示来描述设计模式和系统源码以及提出不同的算法来进行设计模式识别。本文在比较目前已有的设计模式发现方法的基础上,进一步提出了一种新的设计模式识别方法。本文提出了一种基于子图发现和有限自动机的设计模式识别方法,将抽象语义图作为系统源码和设计模式签名的中间表示,将在系统源码中发现设计模式实例的问题转化成在非连通图中发现同构子图的
3、问题。设计模式签名描述了设计模式的结构和行为特征,并转换成确定性有限自动机,有限自动机的终态代表着特定的设计模式。子图发现算法采用有限自动机来引导设计模式候选实例的产生,从而缩小搜索空间,提高了算法效率。另外,本文实现了Eclipse插件CodeMiner来支持所提出的设计模式识别方法,采用EclipseJDT(JavaDevelopmentToolkit)对目标系统的源码进行解析,从源码中提取的信息构建抽象语义图,通过在CodeMiner上对3个开源项目进行实验,并将实验结果与现有的相关研究的实验结果进行比较,在可识别的设计模式种类和识别的模式实例准确性上有明显的优势
4、,表明本文提出的基于子图发现的设计模式识别方法具有较高的应用价值。关键词:设计模式;抽象语法树;Eclipse插件AbstractModernsoftwareindustryhaswidelyadopteddesignpatternstoreusethebestpracticesandimprovethequalityofsoftwaresystems.However,manysystemsarelegacyandthedesigndocumentsisoftenmissing,thisretardthecomprehensionofsystems’designanda
5、rchitectureduringmaintenanceactives.Detectingdesignpatternsfromexistingsourcecodecanimprovesystems’internalqualityattributessuchasreusabilityandmaintainability.Designpatternsarenormallydescribedinformallytounderstandandusedthemeasilyinpractice;researchersneedtocharacterizedesignpatternsf
6、ormallyduringdesignpatterndetection.Relatedworkusesseveralintermediaterepresentationsofsoftwaresystemsanddesignpatterns,andintroducesorproposessomealgorithmstodetectdesignpatterninstances.Thispaperanalyzedrelatedapproachesforminingdesignpatternsfromsourcecodeinacomparativestudyandpropose
7、danovelapproachfordesignpatterndetection.Thepaperpresentedanalgorithmbasedonsubgraphdiscoveryandfiniteautomatatorecognizeinstancesofdesignpatternsinasoftwaresystem.Intheapproach,thesystemanddesignpatternsarebothdescribedwithASG(AbstractSyntaxGraph),thereforefindingadesign
此文档下载收益归作者所有