不一致软件克隆与故障关系的实证研究
On the Relationship of Inconsistent Software Clones and Faults: An Empirical Study
摘要:
背景:代码克隆-复制和重用源代码片段-是软件开发实践中的常见现象。关于克隆的影响已经有了一些实证研究,但关于克隆与缺陷的联系,有相互矛盾的结果。目的:我们的目的是澄清代码克隆和错误之间的关系。特别是,我们专注于不一致(或类型3)的克隆在这项工作中。方法:我们与TWT GmbH进行了一个案例研究,在其中我们检测了三个Java系统中的代码克隆,将它们与来自问题跟踪和版本控制的信息相关联,并采访了三位关键开发人员。结果:在3型克隆中,17%的克隆存在缺陷.开发人员同时修改了大多数3型克隆,从而一致地修复了3型克隆中的一半故障。具有故障的2型克隆都进化为固定的3型克隆。克隆长度与不完美性仅弱相关。结论:有迹象表明,两个案例中的开发人员已经意识到克隆。这可能是第三类无性系与断层关系不密切的原因之一。因此,让开发人员了解克隆似乎很重要,可能有新的工具支持。未来的研究需要调查的故障率在类型3克隆证明使用它们作为线索,在缺陷检测。
英文摘要:
Background: Code cloning - copying and reusing pieces of source code - is a common phenomenon in software development in practice. There have been several empirical studies on the effects of cloning, but there are contradictory results regarding the connection of cloning and faults. Objective: Our aim is to clarify the relationship between code clones and faults. In particular, we focus on inconsistent (or type-3) clones in this work. Method: We conducted a case study with TWT GmbH where we detected the code clones in three Java systems, set them into relation to information from issue tracking and version control and interviewed three key developers. Results: Of the type-3 clones, 17 % contain faults. Developers modified most of the type-3 clones simultaneously and thereby fixed half of the faults in type-3 clones consistently. Type-2 clones with faults all evolved to fixed type-3 clones. Clone length is only weakly correlated with faultiness. Conclusion: There are indications that the developers in two cases have been aware of clones. It might be a reason for the weak relationship between type-3 clones and faults. Hence, it seems important to keep developers aware of clones, potentially with new tool support. Future studies need to investigate if the rate of faults in type-3 clones justifies using them as cues in defect detection.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。