Commenting source code: is it worth it for small programming tasks?

被引:18
作者
Nielebock, Sebastian [1 ]
Krolikowski, Dariusz [1 ]
Krueger, Jacob [2 ,4 ]
Leich, Thomas [5 ,6 ]
Ortmeier, Frank [3 ]
机构
[1] Otto von Guericke Univ, Magdeburg, Germany
[2] Otto von Guericke Univ, Databases & Software Engn Grp, Magdeburg, Germany
[3] Otto von Guericke Univ, CSE, Magdeburg, Germany
[4] Harz Univ Appl Sci Wernigerode, Magdeburg, Germany
[5] Harz Univ Appl Sci Wernigerode, Requirements Engn, Wernigerode, Germany
[6] Metop GmbH Magdeburg, Magdeburg, Germany
关键词
Comments; Program comprehension; Empirical study; Documentation; Maintenance; IDENTIFIER NAMES; SOFTWARE; COMPREHENSION; READABILITY; TRACEABILITY;
D O I
10.1007/s10664-018-9664-z
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Maintaining a program is a time-consuming and expensive task in software engineering. Consequently, several approaches have been proposed to improve the comprehensibility of source code. One of such approaches are comments in the code that enable developers to explain the program with their own words or predefined tags. Some empirical studies indicate benefits of comments in certain situations, while others find no benefits at all. Thus, the real effect of comments on software development remains uncertain. In this article, we describe an experiment in which 277 participants, mainly professional software developers, performed small programming tasks on differently commented code. Based on quantitative and qualitative feedback, we i) partly replicate previous studies, ii) investigate performances of differently experienced participants when confronted with varying types of comments, and iii) discuss the opinions of developers on comments. Our results indicate that comments seem to be considered more important in previous studies and by our participants than they are for small programming tasks. While other mechanisms, such as proper identifiers, are considered more helpful by our participants, they also emphasize the necessity of comments in certain situations.
引用
收藏
页码:1418 / 1457
页数:40
相关论文
共 84 条
  • [1] An empirical study on the importance of source code entities for requirements traceability
    Ali, Nasir
    Sharafi, Zohreh
    Gueheneuc, Yann-Gael
    Antoniol, Giuliano
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2015, 20 (02) : 442 - 478
  • [2] [Anonymous], 2003, Proceedings of the 7th International Conference on Empirical Assessment in Software Engineering
  • [3] Anquetil N., 1998, PROC ANN IBM CTR ADV, P213
  • [4] Recovering traceability links between code and documentation
    Antoniol, G
    Canfora, G
    Casazza, G
    De Lucia, A
    Merlo, E
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (10) : 970 - 983
  • [5] Building knowledge through families of experiments
    Basili, VR
    Lanubile, F
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1999, 25 (04) : 456 - 473
  • [6] Beck F, 2013, CONF PROC INT SYMP C, P63, DOI 10.1109/ICPC.2013.6613834
  • [7] Bezerra RMM, 2015, INT SYMP EMP SOFTWAR, P132, DOI 10.1109/ESEM.2015.7321213
  • [8] Boehm B. W., 1981, SOFTWARE ENG EC
  • [9] The Role of Method Chains and Comments in Software Readability and Comprehension-An Experiment
    Borstler, Jurgen
    Paech, Barbara
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2016, 42 (09) : 886 - 898
  • [10] An experimental comparison of the maintainability of object-oriented and structured design documents
    Briand L.C.
    Bunse C.
    Daly J.W.
    Differding C.
    [J]. Empirical Software Engineering, 1997, 2 (3) : 291 - 312