期刊文献+

基于相似性度量的面向对象程序方法级克隆侦测 被引量:4

Object-Oriented Program Method Level Clone Detection Based on Similarity Measurement
下载PDF
导出
摘要 代码克隆侦测对于代码重构以及可复用资产抽取都有着重要的作用.现有的克隆侦测方法及工具以相似代码片段为单位,给进一步的克隆分析以及代码重构带来困难.针对这一问题,本文提出了一种基于相似性度量的面向对象程序方法级克隆侦测方法,即以方法为单位进行克隆代码侦测.该方法综合利用代码中的注释、签名以及语法相似性来度量方法代码之间的克隆程度.在此基础上合并子类中的相似方法并提取到父类中,从而实现进一步的代码重构.本文通过对JDK包中代码的实验分析验证了本文所提出方法的有效性.初步的实验结果表明,本文方法能够准确、有效地辅助开发者实现方法级的克隆代码侦测. Code clone detection is important for refactoring and extraction of reusable assets. The present code clone detec- tion method is on the basis of detection of similar code segments, which brings difficulty for further clone analysis and refactoring. Aiming at this problem, this paper offers a method level clone detection method for object-oriented program based on similarity measurement, which detects method level cloned code. Our method utilizes comments of the code, method signature and syntactic similarity to measure the degree of the clone. Based on the method mentioned above, further refactoring can be realized by combin- ing similar methods of sub-classes into one method and pulling it up into super-class. Our method' s effectiveness has been verified by analyzing the result of the experiment on the code of JDK. The initial experiment result shows that our method can help develop- er detect method level code clone both accurately and effectively.
出处 《电子学报》 EI CAS CSCD 北大核心 2010年第B02期174-181,共8页 Acta Electronica Sinica
基金 国家863高技术研究发展计划(No.2007AA01Z125,2009AA010307) 国家自然科学基金(No.60703092,60903013) 上海市科学技术委员会项目(No.08DZ2271800,09DZ2272800)
关键词 面向对象 代码克隆 克隆侦测 逆向工程 重构 object- oriented code clone clone detection reverse engineering refactoring
  • 相关文献

参考文献7

  • 1JDK1.5 [ CP/OL ]. http://java, sun. com/javase/downloads/ index, j sp, 2008 -03 - 01.
  • 2Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue. CCFinder: a multilinguistic token-based code clone detection system for large scale source code[J].IEEE Transactions on Software Engineering, 2002,28 (7) : 654 - 670.
  • 3Ira D Baxter, Andrew Yahin, Leonardo Moura, et al. Clone detection using abstract syntax trees [ A ]. In: Proceedings of the International Conference on Software Maintenance[ C ]. Maryland, USA: IEEE CS, 1998.368 - 377.
  • 4Raghavan Komondoor, Susan Horwitz. Using slicing to identify duplication in source code[ A]. In: Proceedings of the 8th International Symposium on Static Analysis (LNCS 2126)[C]. Germany: Springer, 2001.40 - 56.
  • 5Jens Krinke. Identifying similar code with program dependence graphs[ A ]. In:Proceedings of the 8th Working Conference on Reverse Engineering [ C ]. Germany: ACM Press, 2001. 301 - 309.
  • 6Chao Liu, Chen Chen, Jiawei Han, Philip S Yu. GPLAG: Detection of software plagiarism by program dependence graph analysis[ A] .In:Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining [ C ]. Philadelphia, USA: ACM Press. 2006. 872 - 881.
  • 7于冬琦,彭鑫,赵文耘.使用抽象语法树和静态分析的克隆代码自动重构方法[J].小型微型计算机系统,2009,30(9):1752-1760. 被引量:14

二级参考文献9

  • 1JavaCC[ EB/OL]. https://javacc, dev. java. net/, Accessed October 2007.
  • 2JDK1.5 [ EB/OL]. http://java, sun. com/javase/downloads/index. jsp, Accessed March 2008.
  • 3Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue. CCFinder: a multilinguistic token-based code clone detection system for large scale source c.ode[ J]. IEEE Transactions on Software Engineering, 2002, 28(7) : 654-670.
  • 4Ira D Baxter, Andrew Yahin, Leonardo Moura, et al. Clone detection using abstract syntax trees[ C]. Proceedings of the Internation- al Conference on Software Maintenance, 1998, 368-377.
  • 5Komondoor R, Horwitz S. Using slicing to identify duplication in source code[ C]. Proceedings of the 8th International Symposium on Static Analysis, 2001, 40 - 56.
  • 6Higo Y, Kamiya T, Kusumoto S, et al. Refactoring support based on code clone analysis[ C]. Proceedings of 5th International Conference on Product Focused Software Process Improvement, April 2004, 220-233.
  • 7Bas Comelissen, Bas Graaf, Leon Moonen. Identification of variation points using dynamic analysis[ C]. Proceedings of First International Workshop on Reengineering Towards Product Lines, November 2005, 9-13.
  • 8Simian [ EB/OL]. http://www, redhillconsulting, com. au/products/simian/, Accessed October 2007.
  • 9JTB [ EB/OL]. http ://compilers. cs. ucla. edu/jtb/, Accessed October 2007.

共引文献13

同被引文献92

  • 1KAMIYA T, KUSUMOTO S, INOUE K. CCFinder: a multi-linguistic token-based code clone detection system for large scale source code [ J]. IEEE Trans on Software Engineering, 2002,28 (7) : 654- 670.
  • 2DEISSENBOECK F, HUMMEL B, JUERGENS E. Code clone detection in practice [ C ]//Proc of the 32nd ACM/IEEE International Conference on Software Engineering. New York:ACM Press,2010: 499- 500.
  • 3RIEGER M, DUCASSE S, LANZA M. Insight into system-wide code duplication[ C]//Proc of the llth Working Conference on Reverse Engineering. Washington DC : IEEE Computer Society, 2004 : 100- 109.
  • 4INOUE K, CORDY J R, KOSCHKE R. 6th International Workshop on Software Clones[ EB/OL]. [ 2012-10-15 ]. http ://iwsc2012. ist. osaka-u, ac. jp/.
  • 5CORDY J R. Comprehending reality: practical barriers to industrial adoption of software maintenance automation [ C ]//Proc of the 11 th IEEE International Workshop on Program Comprehension. Washington DC : IEEE Computer Society, 2003 : 196-206.
  • 6RIEGER M. Effective clone detection without language barriers[D]. Bern, Switzerland : University of Bern, 2005.
  • 7JIANG Ling-xiao, SU Zhen-dong, CHIU E. Context-based detection of clone-related bugs [ C ]//Proc of the 6th Joint Meeting of the European Software Engineering Conference and ACM SIGSOFT Symposium on Foundations of Software Engineering. New York: ACM Press, 2007 : 55-64.
  • 8SAHA R. Detection and analysis of near-miss clone genealogies[ D]. Saskatoon : University of Saskatchewan, 2011.
  • 9RAHMAN F, BIRD C, DEVANBU P. Clones: What is that smell? [ C ] //Proc of the 7th IEEE Working Conference on Mining Software Repositories. Washington DC: IEEE Computer Society, 2010:72-81.
  • 10BAKER B S. A program for identifying duplicated code[J]. Computing Science and Statistics, 1992,24( 1 ) : 49-57.

引证文献4

二级引证文献25

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部