代码坏味对软件演化影响的实证研究
详细信息    查看全文 | 推荐本文 |
  • 英文篇名:Empirical Study of Code Smell Impact on Software Evolution
  • 作者:章晓芳 ; 朱灿
  • 英文作者:ZHANG Xiao-Fang;ZHU Can;School of Computer Science and Technology, Soochow University;
  • 关键词:软件维护 ; 反模式 ; 代码坏味 ; 实证研究 ; 软件演化
  • 英文关键词:software maintenance;;anti-pattern;;code smell;;empirical study;;software evolution
  • 中文刊名:RJXB
  • 英文刊名:Journal of Software
  • 机构:苏州大学计算机科学与技术学院;
  • 出版日期:2019-05-15
  • 出版单位:软件学报
  • 年:2019
  • 期:v.30
  • 基金:国家自然科学基金(61772263,61772014,61572375);; 苏州市科技发展计划(SYG201807);; 软件新技术与产业化协同创新中心资助项目~~
  • 语种:中文;
  • 页:RJXB201905015
  • 页数:16
  • CN:05
  • ISSN:11-2560/TP
  • 分类号:224-239
摘要
代码坏味是指程序设计中存在的不良设计模式或设计缺陷.坏味的存在,被认为会阻碍软件的演化与维护.近年来,研究人员致力于探究坏味产生的影响以及坏味与软件演化之间的关系.已有研究表明,代码坏味会随着软件的演化而不断发生变化.通常,软件的演化将涉及源文件的增加、修改与删除这3类具体操作,了解代码坏味与软件演化中源文件操作的关系,将有助于开发者更好地计划软件开发过程和重构软件代码.因此,针对13种常见的坏味,在8个Java项目共计104个版本中进行了系统的实证研究.研究发现,随着软件版本的演化,含代码坏味的文件在整个项目中的占比在不同的项目中呈现出不同的特征.另外,包含代码坏味的文件更倾向于被修改,而坏味本身与文件的添加或者删除并没有太大的关联.更进一步地,在探究的所有坏味中,有几种特定的坏味对文件的修改产生了显著的影响,且这些坏味文件间存在着明显的重叠.这些发现有助于开发人员更好地了解代码坏味,以便于更好地对软件进行维护.
        Code smells refer to poor design patterns or design defects that are considered to have negative impacts on software evolution and maintenance. Many researchers have been devoted into studies on these effects and correlations in recent years. Previous researches indicated that code smells might vary with the evolution of software. In normal cases, the software evolution involves addition,modification, and deletion of source files. Therefore, the understanding of the correlations between code smells and software evolution will be helpful for developers in scheduling the development process and in code refactoring. Thus, in this study, on 8 popular Java projects with 104 released versions, an extensive empirical study is conducted to investigate 13 kinds of code smells. It is found that, as the software evolves, the proportion of files that contain code smell in all files reflects different characteristics in different projects.Additionally, the files containing smells are prone to be modified while the smells are not strongly correlated with adding or deleting files.Furthermore, among all the smells studied, some certain ones have significant impact on the file changes and obvious overlap exists in these specific smelly files. These findings are beneficial for developers to achieve in-depth comprehension of code smells, which will lead to better software maintenance.
引文
[1]Hall T,Zhang M,Bowes D,Sun Y.Some code smells have a significant but small effect on faults.ACM Trans.on Software Engineering and Methodology,2014,23(4):Article 33.
    [2]Yamashita A,Moonen L.Do developers care about code smells?An exploratory survey.In:Proc.of the 2013 20th Working Conf.on Reverse Engineering(WCRE).Piscataway:IEEE,2013.242-251.[doi:10.1109/WCRE.2013.6671299]
    [3]Aversano L,Canfora G,Cerulo L,Del Grosso C,Di Penta M.An empirical study on the evolution of design patterns.In:Proc.of the 6th Joint Meeting of the European Software Engineering Conf.and the ACM SIGSOFT Symp.on the Foundations of Software Engineering(ESEC-FSE 2007).New York:ACM Press,2007.385-394.
    [4]Olbrich S,Cruzes DS,Basili V,Zazworka N.The evolution and impact of code smells:A case study of two open source systems.In:Proc.of the 2009 3rd Int’l Symp.on Empirical Software Engineering and Measurement(ESEM 2009).Washington:IEEEComputer Society,2009.390-400.
    [5]Olbrich SM,Cruzes DS,Sjoberg DIK.Are all code smells harmful?A study of god classes and brain classes in the evolution of three open source systems.In:Proc.of the 2010 IEEE Int’l Conf.on Software Maintenance.Piscataway:IEEE,2010.1-10.[doi:10.1109/ICSM.2010.5609564]
    [6]Yamashita A,Moonen L.Exploring the impact of inter-smell relations on software maintainability:An empirical study.In:Proc.of the 2013 35th Int’l Conf.on Software Engineering(ICSE).Piscataway:IEEE,2013.682-691.
    [7]Li W,Shatnawi R.An empirical study of the bad smells and class error probability in the post-release object-oriented system evolution.Journal of Systems and Software,2007,80(7):1120-1128.
    [8]Marinescu R.Detecting design flaws via metrics in object-oriented systems.In:Proc.of the 39th Int’l Conf.and Exhibition on Technology of Object-Oriented Languages and Systems(TOOLS 39).Piscataway:IEEE,2001.173-182.[doi:10.1109/TOOLS.2001.941671]
    [9]Marinescu R.Detection strategies:Metrics-based rules for detecting design flaws.In:Proc.of the 20th IEEE Int’l Conf.on Software Maintenance.Piscataway:IEEE,2004.350-359.[doi:10.1109/ICSM.2004.1357820]
    [10]Marinescu R.Measurement and quality in object-oriented design.In:Proc.of the 21st IEEE Int’l Conf.on Software Maintenance(ICSM 2005).Piscataway:IEEE,2005.701-704.[doi:10.1109/ICSM.2005.63]
    [11]Fard AM,Mesbah A.Jsnose:Detecting javascript code smells.In:Proc.of the 2013 IEEE 13th Int’l Working Conf.on Source Code Analysis and Manipulation(SCAM).Piscataway:IEEE,2013.116-125.[doi:10.1109/SCAM.2013.6648192]
    [12]Schumacher J,Zazworka N,Shull F,Seaman C,Shaw M.Building empirical support for automated code smell detection.In:Proc.of the 2010 ACM-IEEE Int’l Symp.on Empirical Software Engineering and Measurement(ESEM 2010).New York:ACM Press,2010.8:1-8:10.
    [13]Xie G,Chen J,Neamtiu I.Towards a better understanding of software evolution:An empirical study on open source software.In:Proc.of the IEEE Int’l Conf.on Software Maintenance 2009(ICSM 2009).Piscataway:IEEE,2009.51-60.
    [14]Neamtiu I,Xie G,Chen J.Towards a better understanding of software evolution:An empirical study on open-source software.Journal of Software:Evolution and Process,2013,25(3):193-218.
    [15]Peters R,Zaidman A.Evaluating the lifespan of code smells using software repository mining.In:Proc.of the 2012 16th European Conf.on Software Maintenance and Reengineering.Piscataway:IEEE,2012.411-416.[doi:10.1109/CSMR.2012.79]
    [16]Arcoverde R,Garcia A,Figueiredo E.Understanding the longevity of code smells:Preliminary results of an explanatory survey.In:Proc.of the 4th Workshop on Refactoring Tools(WRT 2011).New York:ACM Press,2011.33-36.
    [17]Moha N,Gueheneuc YG,Duchien L,Meur AFL.Decor:A method for the specification and detection of code and design smells.IEEE Trans.on Software Engineering,2010,36(1):20-36.
    [18]Fowler M.Refactoring:Improving the design of existing code.In:Proc.of the 2002 2nd Int’l Conf.on Extreme Programming and Agile Methods(XP/Agile Universe 2002).LNCS 2418,Berlin,Heidelberg:Springer-Verlag,2002.
    [19]Khomh F,Vaucher S,Guhneuc YG,Sahraoui H.A bayesian approach for the detection of code and design smells.In:Proc.of the2009 9th Int’l Conf.on Quality Software.Piscataway:IEEE,2009.305-314.[doi:10.1109/QSIC.2009.47]
    [20]Oliveto R,Khomh F,Antoniol G,Gueheneuc YG.Numerical signatures of antipatterns:An approach based on B-splines.In:Proc.of the 2010 14th European Conf.on Software Maintenance and Reengineering.Piscataway:IEEE,2010.248-251.[doi:10.1109/CSMR.2010.47]
    [21]Palomba F,Panichella A,Lucia AD,Oliveto R,Zaidman A.A textual-based technique for smell detection.In:Proc.of the 2016IEEE 24th Int’l Conf.on Program Comprehension(ICPC).Piscataway:IEEE,2016.1-10.[doi:10.1109/ICPC.2016.7503704]
    [22]Tsantalis N,Chatzigeorgiou A.Identification of move method refactoring opportunities.IEEE Trans.on Software Engineering,2009,35(3):347-367.
    [23]Sheng JF,Hu PP,Wang B.Survey of research on anti-pattern detection.Application Research of Computers,2013,30(12):3525-3528(in Chinese with English abstract).[23]盛津芳,胡培培,王斌.反模式检测研究综述.计算机应用研究,2013,30(12):3525-3528.
    [24]Gao Y,Liu H,Fan XZ,Niu ZD,Shao WZ.Resolution sequence of bad smells.Ruan Jian Xue Bao/Journal of Software,2012,23(8):1965-1977(in Chinese with English abstract).http://www.jos.org.cn/1000-9825/4152.htm[doi:10.3724/SP.J.1001.2012.04152][24]高原,刘辉,樊孝忠,牛振东,邵雄忠.代码坏味的处理顺序.软件学报,2012,23(8):1965-1977.http://www.jos.org.cn/1000-9825/4152.htm[doi:10.3724/SP.J.1001.2012.04152]
    [25]Ma W,Chen L,Zhou Y,Xu B,Zhou X.Are anti-patterns coupled?An empirical study.In:Proc.of the 2015 IEEE Int’l Conf.on Software Quality,Reliability and Security.Piscataway:IEEE,2015.242-251.[doi:10.1109/QRS.2015.43]
    [26]Khomh F,Penta MD,Gueheneuc YG,Antoniol G.An exploratory study of the impact of antipatterns on class change-and faultproneness.Empirical Software Engineering,2012,17(3):243-275.
    [27]Chatzigeorgiou A,Manakos A.Investigating the evolution of bad smells in object-oriented code.In:Proc.of the 2010 7th Int’l Conf.on the Quality of Information and Communications Technology.Piscataway:IEEE,2010.106-115.[doi:10.1109/QUATIC.2010.16]
    [28]Tufano M,Palomba F,Bavota G,Oliveto R,Penta MD,Lucia AD,Poshyvanyk D.When and why your code starts to smell bad.In:Proc.of the 2015 IEEE/ACM 37th IEEE Int’l Conf.on Software Engineering.Piscataway:IEEE,2015.403-414.[doi:10.1109/ICSE.2015.59]
    [29]Palomba F,Bavota G,Penta MD,Fasano F,Oliveto R,Lucia AD.On the diffuseness and the impact on maintainability of code smells:A large scale empirical investigation.Empirical Software Engineering,2018,23(3):1188-1221.
    [30]Zhang X,Zhou Y,Zhu C.An empirical study of the impact of bad designs on defect proneness.In:Proc.of the 2017 Int’l Conf.on Software Analysis,Testing and Evolution(SATE).Piscataway:IEEE,2017.1-9.[doi:10.1109/SATE.2017.9]
    [31]Zhu C,Zhang X,Feng Y,Chen L.An empirical study of the impact of code smell on file changes.In:Proc.of the 2018 IEEE Int’l Conf.on Software Quality,Reliability and Security(QRS).Piscataway:IEEE,2018.238-248.[doi:10.1109/QRS.2018.00037]

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700