Code Metrics Selection Using Metaheuristic Algorithms: The Case of Python
摘要
In the contemporary context, a plethora of tools have been developed for the purpose of extracting features from software repositories. However, a significant drawback of many of these metrics is their tendency to exhibit characteristics such as collinearity and overfitting. Manual selection of software metrics is a challenging process that is susceptible to human error and can result in biased outcomes and the unintentional exclusion of important features. The present paper proposes a novel methodology for metric selection in software repositories. The quality of the selected features is evaluated using the Sammon error, a measure that aims to preserve the geometric structure of code. We have applied metaheuristic algorithms, specifically Ant Colony Optimization and Fireflies Algorithm, to minimize Sammon error and select metrics while preserving the ``geometric’’ structure of code. The findings suggest that metaheuristic algorithms can be effectively used in such NP-hard problems.