<p>Software metrics that count class elements, like methods and attributes, are widely used to measure cohesion, detect God Classes, and support software refactoring. However, these metrics treat all class elements the same, leading to errors. This paper presents empirical evidence that counting elements evenly introduces significant bias. To address this issue, the paper proposes a weighted approach based on scientific literature and expert input. Using Sahand 2.0, a code analysis tool with detailed inspection abilities, the proposed method was tested on three Java open-source systems (RxJava, jmt, and Hibernate). The experiments show that weighted measures reduce bias compared to simple counts. Still, finding optimal weights is challenging due to differing professional opinions, and more validation is needed. The research suggests that data-driven or machine learning methods could further improve the reliability of software quality metrics.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The inaccuracy of uniform counting in software metrics: empirical evidence with a weighted remedy

  • Gholamali Nejad Hajali Irani

摘要

Software metrics that count class elements, like methods and attributes, are widely used to measure cohesion, detect God Classes, and support software refactoring. However, these metrics treat all class elements the same, leading to errors. This paper presents empirical evidence that counting elements evenly introduces significant bias. To address this issue, the paper proposes a weighted approach based on scientific literature and expert input. Using Sahand 2.0, a code analysis tool with detailed inspection abilities, the proposed method was tested on three Java open-source systems (RxJava, jmt, and Hibernate). The experiments show that weighted measures reduce bias compared to simple counts. Still, finding optimal weights is challenging due to differing professional opinions, and more validation is needed. The research suggests that data-driven or machine learning methods could further improve the reliability of software quality metrics.