Empirical evidence reveals bias in count-based metrics for software engineering, suggesting weighted measures improve accuracy.
Abstract Count-based metrics count the number of internal elements of a class, e.g., attributes, methods, and their interactions. Such metrics are used in a variety of areas of software engineering, e.g., measuring cohesion, detecting God Classes, and refactoring assistance. This paper criticizes the shortsightedness of the metrics and proves by statistical testing that the same treatment for all the number of class elements causes them to be measured with error. We introduce weighted and context-sensitive measures to overcome these limitations. A weighting system based on scientific literature and expert feedback is utilized within our method to emphasize the deficiencies of standard measures. Using Sahand 2.0, the fine-grained code analysis tool developed specifically to perform fine-grained code analysis, we executed three big Java open-source projects (RxJava, jmt, and Hibernate), and the result showed that our proposed weighting model detects bias over uniform couting. Even though our approach is promising, calculation of optimal weights remains problematic due to the subjective nature of expert-set weights and demands for further extensive validation. Our findings emphasize that more advanced methods, such as data-driven weight calculation or machine learning, are still needed to achieve more sustainable and trustworthy software systems.
No takes yet. Share an insight, caveat, or question.
Gholamali Nejad Hajali Irani (2025) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: