Listening to programmers — Taxonomies and characteristics of comments in operating system code

Yoann Padioleau, Lin Tan, Yuanyuan Zhou
2009 2009 IEEE 31st International Conference on Software Engineering  
Innovations from multiple directions have been proposed to improve software reliability. Unfortunately, many of the innovations are not fully exploited by programmers. To bridge the gap, this paper proposes a new approach to "listen" to thousands of programmers: studying their programming comments. Since comments express programmers' assumptions and intentions, comments can reveal programmers' needs, which can provide guidance (1) for language/tool designers on where they should develop new
more » ... niques or enhance the usability of existing ones, and (2) for programmers on what problems are most pervasive and important so that they should take initiatives to adopt some existing tools or language extensions. We studied 1050 comments randomly sampled from the latest versions of Linux, FreeBSD, and OpenSolaris. We found that 52.6% of these comments could be leveraged by existing or to-be-proposed tools for improving reliability. Our findings include: (1) many comments describe code relationships, code evolutions, or the usage and meaning of integers and integer macros, (2) a significant amount of comments could be expressed by existing annotation languages, and (3) many comments express synchronization related concerns but are not well supported by annotation languages. Specifically, studying programmers' comments could help in the following aspects: (1) Programming language: Comments could motivate the design of new programming language extensions. The comments in OpenSolaris shown below specify the field name to which a value is assigned, e.g., assigning 15 to the length field. Specifying such information in comments is not only inconvenient but also error-prone when the struct definition changes. To address these limitations, the GCC designator extension was proposed to specify such field names in the code, e.g., .length = 15. This example shows that some needs indicated by comments have already been addressed by language extensions. c o n s t s t r u c t s t d r i v e t y p e s t
doi:10.1109/icse.2009.5070533 dblp:conf/icse/PadioleauTZ09 fatcat:3nbk33fyoncd3mloc426l6k66q