Not logged in.

Contribution Details

Type Bachelor's Thesis
Scope Discipline-based scholarship
Title "Comment Quality Assessment and Classification"
Organization Unit
Authors
  • Tim Moser
Supervisors
  • Harald Gall
  • Sebastiano Panichella
Language
  • English
Institution University of Zurich
Faculty Faculty of Business, Economics and Informatics
Date 2021
Abstract Text Almost all tasks concerning the evolution and maintenance of software require a developer to understand the code. Multiple studies have shown in the past that commented code is more readable than code without any comments, indicating that comments are containing vital information about the implementation. However, not all comments are of equal quality: some are often incomplete, inconsistent with the code, hard to read and understand, or entirely missing. In this thesis, we investigated how we can provide an approach to analyze comments and rate them with respect to their quality in four different programming languages: Java, C, C++ and C#. The goal of this thesis is twofold: - RQ1: Propose a deep learning approach to classify comments into different categories, based on purpose and semantics. We show that our classification pipeline reached an accuracy of over 90% (F1-score), out-performing traditional machine learning models on the same data set in the same environment. - RQ2: Develop a tool for assessing comment quality with respect to readability, coherence, usefulness, completeness and consistency. We will also demonstrate with said tool the evolution of comment quality in four repositories, written in different programming languages and suggest directions for future work, like an empiric evaluation with real developers.
Zusammenfassung Beinahe alle Aufgaben im Software Maintenance und Evolution Bereich verlangen von Entwicklern Code zu verstehen. Mehrere Studien haben gezeigt, dass Code mit Kommentaren einfacher zu verstehen ist als solcher ohne. Dies zeigt uns, dass Kommentare sehr wichtige Informationen über die Implementation beinhalten. Es ist jedoch so, dass nicht alle Kommentare die selbe Qualität vorweisen: manche sind nicht komplett, inkonsistent gegenüber dem Code, schwer zu lesen oder verstehen oder fehlen ganz. In dieser Arbeit untersuchen wir, wie wir eine Möglichkeit, um Kommentare zu analysieren und ihre Qualität zu bewertein, breitstellen können für die Sprachen Java, C, C++ und C#. Das Ziel der Arbeit ist zweierlei: - RQ1: Einen Deeplearning Ansatz zur klassifizierung von Kommentaren auf Grund ihres Nutzen und Zweck bereitzustellen. Wir zeigen, dass unsere Pipeline eine Genauigkeit von über 90% (F1-Score) erreicht, was traditionelle Machinelearning Modelle unter gleichen Umständen übertrifft. - RQ2: Ein Tool zu entwickeln um die Qualität von Kommentaren zu bewerten auf Grund ihrer "readability", "coherence", "usefulness", "completeness" und "consistency". Wir zeigen auch an einem Beispiel mit vier verschiedenen GitHub Repositories und deren Entwicklung ihrer Kommentar Qualität, wozu das Tool fähig ist und zeigen auf, was in der Zukunft erforscht werden könnte.
PDF File Download
Export BibTeX