Automatic detection of outdated comments in open source Java projects
Ankita Sadu · LA Referencia (Red Federada de Repositorios Institucionales de Publicaciones Científicas) · 2019
Source code comments are significant assets to retain the logic designed during coding. In addition, they aid by communicating the intent of the code to other programmers, maintainers or even to oneself when checked at a later stage. Nevertheless, commenting code and keeping up-to-date comments are often disregarded by programmers. Some common reasons being, the extra work of commenting doesn’t deliver much value to the writer, time constraints, and various other reasons. As a first step to aid the process of updating comments following a code change, we present DocRevise, a tool that can automatically detect outdated Javadoc comments of open source Java projects at a fine-grain level. We utilized 30 Java methods from well-known and documented open source Java repositories from Github. Our approach involved inspecting the relationships between the code and the comments and fetching the identifiers that were altered. Experimental results show that DocRevise reaches 80.49% of accuracy when it comes to identifying relationships between the comments and the code. In addition, the results demonstrate that DocRevise can assist developers to locate outdated comments in prior versions of the existing projects.