Linguistic antipatterns: what they are and how developers perceive them

Linguistic antipatterns: what they are and how developers perceive them
复制标题

DOI:
10.1007/s10664-014-9350-8
复制
发表时间:
2016-02-01
影响因子:
4.1
通讯作者:
Antoniol, Giuliano
Antoniol, Giuliano
中科院分区:
计算机科学2区
文献类型:
--
作者:
Arnaoudova, Venera;Di Penta, Massimiliano;Antoniol, Giuliano

文献摘要

被引文献

相似文献

反模式被认为是反复出现的问题的糟糕解决方案。例如,Brown等人。和Fowler定义了关于糟糕的设计或实现解决方案的实践。然而,我们知道,源代码词典是影响程序心理复杂性的因素之一,即使程序难以被人类理解和维护的因素。这项工作的目的是识别与命名、文档和实体(称为语言反模式(LAS))的实现之间的不一致相关的反复出现的不良实践,这些实践可能会损害程序理解。为此,我们首先挖掘实际开源项目中这种不一致的例子,并将它们抽象为与方法和属性相关的17个重复出现的LAS的目录。然后,为了了解LAS的相关性,我们对开发人员进行了两项实证研究-30名外部人员(即不熟悉代码)和14名内部人员(即开发或维护代码的人)。结果表明,大多数参与者认为LAS是糟糕的做法,因此必须避免--分别有69%和51%的外部和内部开发商。作为LAS有效性的进一步证据,了解LAS的开源开发人员对该问题的反应是在10%的情况下进行代码更改。最后,为了促进LAS在实践中的使用,我们确定了LAS的一个子集,这些子集被普遍认为是有问题的;那些在代码行为和词典之间有明显不协调的子集。
Antipatterns are known as poor solutions to recurring problems. For example, Brown et al. and Fowler define practices concerning poor design or implementation solutions. However, we know that the source code lexicon is part of the factors that affect the psychological complexity of a program, i.e., factors that make a program difficult to understand and maintain by humans. The aim of this work is to identify recurring poor practices related to inconsistencies among the naming, documentation, and implementation of an entity-called Linguistic Antipatterns (LAs)-that may impair program understanding. To this end, we first mine examples of such inconsistencies in real open-source projects and abstract them into a catalog of 17 recurring LAs related to methods and attributes. Then, to understand the relevancy of LAs, we perform two empirical studies with developers-30 external (i.e., not familiar with the code) and 14 internal (i.e., people developing or maintaining the code). Results indicate that the majority of the participants perceive LAs as poor practices and therefore must be avoided-69% and 51% of the external and internal developers, respectively. As further evidence of LAs' validity, open source developers that were made aware of LAs reacted to the issue by making code changes in 10% of the cases. Finally, in order to facilitate the use of LAs in practice, we identified a subset of LAs which were universally agreed upon as being problematic; those which had a clear dissonance between code behavior and lexicon.