## 4 Predicting the Change of Software Maintainability with the Historical Software Metrics
### Software Metric Measurements Used  
After preparing the dataset of projects, the internal quality was assessed of individual releases of studied software components in the dataset. Similar to the work of [PERSON] et al. [47], the internal quality assessment of the projects in our study was based on the C&K set. According to the findings of the systematic literature review conducted by [PERSON] et al. [58], 79% of primary studies covered in the study rely on the C&K metric set when assessing the internal quality of software components. For the task, the JHawk software [59], static code analysis and metric measurement tool were applied to measure software metrics and maintainability of the source files. The JHawk tool was chosen because it provided all the necessary software metric measurements. At the same time, it is a tool used commonly in related research [2; 34]. The JHawk tool in version 6.1.4 was applied for the study. In the study, the analysed releases of the projects were scanned through for Java classes. For each class found during the scan process, all class level software metrics provided by the tool were measured. Further, the C&K software metrics (or their equivalents) and the maintainability index of the classes were extracted. To avoid manual work during the process, the automation was achieved by the application of the console version of the tool. Since the JHawk tool does not provide all the software metrics from the C&K metric suite out-of-the-box, some of the metrics in the suite had to be replaced by the equivalents provided by \begin{table}
\begin{tabular}{c c c} \hline \hline  & **No. of Versions** & **Days between Releases** \\ \hline Average & 38.88 & 83.45 \\ Median & 39.00 & 78.09 \\ Standard Deviation & 8.84 & 45.66 \\ Minimum & 19.00 & 19.22 \\ Maximum & 50.00 & 259.89 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistics based on project version and release periods. Figure 3: The distribution of periods between releases of all projects in the experiment. JHawk. Instruction for the software metric alternatives can be found in the documentation published on the homepage [60] and the official documentation [57] of the tool. The software metric NOC was replaced by the software metric Subclasses (NSUB), where the only difference between both software metrics is in the name. According to the JHawk's documentation, the WMC metric can be substituted by software metric number of methods (No. of Methods), which counts the total number of methods in a class, or total cyclomatic complexity (TCC), which represents the sum of complexity of methods in a class. Following the tool guidance, software metric WMC was substituted by TCC, since it expresses the complexity of a class more accurately. Similarly, the JHawk tools offers two versions of the maintainability index. The first version denoted with MI (maintainability index) follows the four-metric calculation formula, which considers the appropriateness of program code comments. The second version, denoted as MINC (maintainability index no comments), follows the three-metric calculation formula, which ignores the quality of comments in a program code. Based on the studies found in the literature, the maintainability index used in our study was based on the three-metric formula (MINC). Modern approaches in software engineering advocate the self-expressiveness of the program code, and push the consistency of commenting in the background [61]. Whereas we have included current software in the dataset, it is assumed that the software coding follows the above guidelines. The characteristics of the maintainability were quantified through the following equation:  
\[\textit{MINC}=171-5.2\ln(\textit{aveVol})-0.23\textit{aveV}(g)-16.2\ln(\textit{aveLOC}) \tag{1}\]  
where _aveVol_, _aveV(g)_, and _aveLOC_ are the average Halstead's volume metric, the extended cyclomatic complexity per module, and the average number of lines of code.