Characterising the Knowledge about Primitive Variables in Java Code Comments

03/23/2021
by   Mahfouth Alghamdi, et al.
0

Primitive types are fundamental components available in any programming language, which serve as the building blocks of data manipulation. Understanding the role of these types in source code is essential to write software. Little work has been conducted on how often these variables are documented in code comments and what types of knowledge the comments provide about variables of primitive types. In this paper, we present an approach for detecting primitive variables and their description in comments using lexical matching and advanced matching. We evaluate our approaches by comparing the lexical and advanced matching performance in terms of recall, precision, and F-score, against 600 manually annotated variables from a sample of GitHub projects. The performance of our advanced approach based on F-score was superior compared to lexical matching, 0.986 and 0.942, respectively. We then create a taxonomy of the types of knowledge contained in these comments about variables of primitive types. Our study showed that developers usually documented the variables' identifiers of a numeric data type with their purpose (69.16 type String which were less documented with purpose (61.14 concept (55.46 of documenting primitive variables and point at areas that are often not well documented, such as the meaning of boolean variables or the purpose of fields and local variables.

READ FULL TEXT
research
07/09/2021

How to Identify Class Comment Types? A Multi-language Approach for Class Comment Classification

Most software maintenance and evolution tasks require developers to unde...
research
03/31/2022

Comments on Comments: Where Code Review and Documentation Meet

A central function of code review is to increase understanding; helping ...
research
03/18/2022

How Do Programmers Express High-Level Concepts using Primitive Data Types?

We investigated how programmers express high-level concepts such as path...
research
03/02/2023

Performance Comparison of Binary Machine Learning Classifiers in Identifying Code Comment Types: An Exploratory Study

Code comments are vital to source code as they help developers with prog...
research
06/25/2020

Source Code Comments: Overlooked in the Realm of Code Clone Detection

Reusing code can produce duplicate or near-duplicate code clones in code...
research
03/03/2023

APIContext2Com: Code Comment Generation by Incorporating Pre-Defined API Documentation

Code comments are significantly helpful in comprehending software progra...
research
08/12/2020

Prevalence, Contents and Automatic Detection of KL-SATD

When developers use different keywords such as TODO and FIXME in source ...

Please sign up or login with your details

Forgot password? Click here to reset