# Investigating Novice Developers' Code Commenting Trends Using Machine Learning Techniques
## 3 Methodology
### Research Questions  
The main objectives that drive the motivation behind this study are: is it possible to analyze the code activities by novice developers and further classify the source code comments that would help novice student developers to write meaningful code comments? The intent is to make their code more readable. We formulated two research questions (RQs) to investigate this study further. **RQ-1. **_Which kind of code activities are performed by novice students/developers in the source code?_  
Rationale: The primary rationale behind this research question is to analyze the key activities developers mention in their source code comments. This research question provides an idea to novice developers regarding the essential aspects that should be considered for development. The features exploited in this _RQ-1_ are _comment_content_ and _code_, as shown in Table 3. As already described, the main idea is to see the novice developers' activities by analyzing comment code and its corresponding source code and building a meaningful set of categories. The outcome of this research question will be a taxonomy of categories mentioned in the source code. **RQ-2. **_Is it possible to classify novice students'/developers' source code comments using machine learning techniques?_  
Rationale: This research question is dedicated to automatically classifying the novice students'/developers' source code comment categories obtained in _RQ-1_ using machine learning techniques. Furthermore, the objective of this research question is to apply different machine-learning approaches to source code comments and eventually find the best machine-learning approach for classifying code comments. This will help novice developers to categorize the new comments in the correct categories. It is important to note here that the work examines student code comments with a finer categorization of their comments, as discussed at the end of Section 2.6. The objective of this research question is also to lay out the methodology of machine learning techniques based on multi-label classification, which will provide an outcome of how effective this approach is at predicting code comments for novice developers. The proposed method in Listing 1 represents the high-level pseudo-code algorithm, which describes the overall methodology. The methodology of our study consists of two parts: (i) Preparation of taxonomy of code comments using source code comments (M1), and (ii) classification of source code comments categories using machine learning techniques (M2). \(M1\) aims to address _RQ-1_, whereas \(M2\) is dedicated to _RQ-2_, described in the research question section. For the _RQ-2_ methodology, we used three machine learning \begin{table}
\begin{tabular}{l l l} \hline \hline
**No.** & **Feature Name** & **Description** \\ \hline
**1** & comment\_content & This feature contains the comment text written by the student \\
**2** & code & This feature contains the relevant code about which the comment was written. \\
**3** & begin\_line & The line number of the file at which the comment begins. \\
**4** & end\_line & The end line of the comment. \\
**5** & code\_start\_line & The start line for the relevant code section. \\
**6** & type & The type of the comment, i.e., single-line or multi-line. \\
**7** & category & This is the class that was labeled to the dataset using the taxonomy. \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Description of the features extracted for the dataset preparation. techniques to classify the source code's comments: (i) Support Vector Machine, (ii) Random Forest, and (iii) Decision Tree. **Listing 1. ** Pseudo code of classification of code comments. 1
2 Input: Comments extracted from the source code  
3 Parameter: Hyperparamter tuning  
4 Output: Label comments  
5 Steps of M1: Preparation of dataset of source code comments  
6 building taxonomy of source code comments  
7
8 1. Pre-processing the raw java source code. 9 2.