Skip to content
Preprint

Assessing the Construct Validity of Object-Oriented, Class-Level Code Quality Metrics

Sep 2026 · 0 citations · 64 references
Computer Science

TL;DR

The results strongly support the construct validity of 24 code quality metrics and reveal Coupling and Inheritance are revealed as multidimensional constructs, since they require measuring two different concepts, revealed as sub-categories in the analysis.

Abstract

Background: Code quality metrics are intended to measure latent properties of software source code. Although numerous code metrics have been proposed and used, their construct validity is rarely evaluated. Thus, the extent to which code metrics actually measure what they claim to measure is often unclear. Aim: Drawing from modern measurement theory, we investigate the construct validity of common class-level, object-oriented code quality metrics by identifying their factor structure using Exploratory Factor Analysis (EFA). The metrics were extracted from the Apache Maven project by three software tools: Designite, JHawk, and Understand. The factor structure was later verified using Confirmatory Factor Analysis (CFA) on 22 randomly selected open source projects meeting a predetermined eligibility criteria. Results: 24 code quality metrics that correspond to six constructs: Cohesion, In-Coupling, Out-Coupling, Size, Sub-Inheritance (related to subclasses), and Sup-Inheritance (related to superclasses) were revealed in the underlying factor structure. Ten metrics did not correspond to any known dimension of software quality and were removed in the EFA. Ten additional metrics exhibited low loadings in the CFA, suggesting their removal from the final measurement model. Size, Cohesion, Inheritance, and Coupling were the constructs retained, with subcategories identified for Inheritance and Coupling. Conclusions: Our results strongly support the construct validity of 24 code quality metrics. Coupling and Inheritance are revealed as multidimensional constructs, since they require measuring two different concepts, revealed as sub-categories in our analysis, and Complexity may be better explored in a multilevel model. Overall, our study demonstrates the value of applying modern measurement theory and latent variable modeling in validating software code quality metrics.

View source

Similar papers

Conference Sep 2026

A Model of Software Code Quality Analysis, Assessment, and Improvement System

Existing code analysis systems address individual aspects of software quality (complexity, duplication, style) but do not combine multi-level analysis, metric aggregation, and learning-based inference within a single formal framework, nor do they close the loop between refactoring outcomes and assessment. This paper pr...

Ihor Prokofiev, Oleg Savenko · 0 citations
Conference Open access 2026

Assessing Software Metrics and Complexity in Student and Open-Source Projects Using Static Analysis

Maintaining code quality remains a significant challenge in both educational and professional software development. This paper presents the development and evaluation of static code analysis tools aimed at identifying structural issues, such as complexity, cohesion, and maintainability in C# projects. The analyzers wer...

Peter Csaszar, Máté Cserép · 0 citations
Open access Sep 2026

A Novel Entropy based Maintainability Measurement Algorithm For Java Source Code.

Software metrics play a central role in assessing and managing the quality of software systems providing quantitative insights into attributes such as complexity, reliability, rigidity, modifiability and maintainability. Among these, maintainability is particularly critical, as it directly influences the ease of system...

Remi M. Yusuf, M. S. Mashuk, Julian M. Bass · 0 citations
#machine learning Preprint Sep 2026

On the Relation between Code Quality and Machine Learning Performance: A Large-scale Empirical Study

A large-scale empirical study of 265,363 Python notebooks submitted to Kaggle competitions found that competition expertise correlates with better performance, fewer ML-specific violations, and slightly more Python errors and refactoring violations.

Marius Mignard, Steven Costiou, Anne Etien · 0 citations
Preprint Aug 2026

Comparing the Quality of Code Generated by Vibe Coding Tools

This study compares the structural quality of code produced by three widely adopted vibe coding tools --- Lovable, v0, and Replit --- starting from a single generation prompt and suggests that choosing between vibe coding tools involves structural trade-offs that go beyond perceived productivity.

Gustavo Rubin da Mota, Kiev Gama · 0 citations
#software testing Open access Sep 2026

Detection of God Class Smells in PHP Systems Using Object-Oriented Metrics

The study demonstrates that metric-based detection can effectively identify maintainability problems in PHP applications and provides a foundation for future PHP-specific threshold development.

Naveed Toofani, Bayu Priyambadha, A. Arwan · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.