An Empirical Study on Relationships between Comments and Design Properties

Yuto Miyake, Sousuke Amasaki, Tomoyuki Yokogawa, Hirohisa Aman · 2017

Recent studies empirically revealed a relationship between source code comments and code quality. Those studies considered activity-based metrics as quality indicators. Project management tasks often used source code-based metrics, and analysis of such metrics can also give a useful insight into the relationship. Objective: To clarify the relationship between comments and code quality with CK metrics. Method: Compare distributions of CK metrics between commented files and noncommented files over four OSS projects. Results: Files with comments tend to be more complex than those without any comments regarding CBO, LCOM, RFC, and WMC. The differences in such metrics were statistically significant. Conclusions: Commented files were prone to be complex and thus less maintainable. The results suggest that developers should take notice of comments and code beside them.

Read the paper · More papers on PaperTik