Back to overview

Towards Detecting Inconsistent Comments in Java Source Code Automatically

Type of publication Peer-reviewed
Publikationsform Proceedings (peer-reviewed)
Author Stulova Nataliia, Blasi Arianna, Gorla Alessandra, Nierstrasz Oscar,
Project Agile Software Assistance
Show all

Proceedings (peer-reviewed)

Page(s) 65 - 69
Title of proceedings 2020 IEEE 20th International Working Conference on Source Code Analysis and Manipulation (SCAM)
DOI 10.1109/scam51674.2020.00012

Open Access

Type of Open Access Repository (Green Open Access)


A number of tools are available to software developers to check consistency of source code during software evolution. However, none of these tools checks for consistency of the documentation accompanying the code. As a result, code and documentation often diverge, hindering program comprehension. This leads to errors in how developers use source code, especially in the case of APIs of reusable libraries. We propose a technique and a tool, upDoc, to automatically detect code-comment inconsistency during code evolution. Our technique builds a map between the code and its documentation, ensuring that changes in the code match the changes in respective documentation parts. We conduct a preliminary evaluation using inconsistency examples from an existing dataset of Java open source projects, showing that upDoc can successfully detect them. We present a roadmap for the further development of the technique and its evaluation.