Unveiling Hybrid Cyclomatic Complexity: A Comprehensive Analysis and Evaluation as an Integral Feature in Automatic Defect Prediction Models

📅 2025-04-01
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Traditional cyclomatic complexity fails to capture inheritance-related structural complexity in modern object-oriented software, limiting defect prediction accuracy. Method: This paper proposes Hybrid Cyclomatic Complexity (HCC), the first metric explicitly integrating intra-class control-flow complexity with inheritance-path complexity. We statically analyze source code from multiple open-source projects to construct feature sets incorporating HCC and evaluate its predictive performance using Random Forest, SVM, and other classifiers. Results: Empirical evaluation shows HCC exhibits only weak correlation with dedicated inheritance-complexity metrics, confirming their non-redundancy. As a standalone feature, HCC achieves defect prediction performance comparable to specialized inheritance-complexity measures and significantly outperforms basic cyclomatic complexity. Moreover, incorporating HCC consistently enhances model discriminative power and generalization capability. This work provides both a novel perspective on object-oriented system complexity modeling and a practical, effective metric for defect prediction.

Technology Category

Knowledge Representation and Reasoning: Computational Complexity of ReasoningMachine Learning: Evaluation and AnalysisSearch and Optimization: Evolutionary Computation

Application Category

Web Mining and Content Analysis: Robustness and generalizability of Web mining methodsGraph Algorithms and Modeling for the Web: Algorithms and analysis for incomplete, noisy, or partially observed Web-related graphsSystems and Infrastructure for Web, Mobile and WoT: Web performance, measurement, and characterization
📝 Abstract
The complex software systems developed nowadays require assessing their quality and proneness to errors. Reducing code complexity is a never-ending problem, especially in today's fast pace of software systems development. Therefore, the industry needs to find a method to determine the qualities of a software system, the degree of difficulty in developing new functionalities, or the system's proneness to errors. One way of measuring and predicting the quality attributes of a software system is to analyse the software metrics values for it and the relationships between them. More precisely, we should study the metrics that measure and determine the degree of complexity of the code. This paper aims to analyse a novel complexity metric, Hybrid Cyclomatic Complexity (HCC) and its efficiency as a feature in a defect prediction model. The main idea behind this new metric is that inherited complexity should play a role in the complexity of a class, hence the need for a metric that calculates the total complexity of a class, taking into account the complexities of its descendants. Moreover, we will present a comparative study between the HCC metric and its two components, the inherited complexity and the actual complexity of a class in the object-oriented context. Since we want this metric to be as valuable as possible, the experiments will use data from open-source projects. One of the conclusions that can be drawn from these experiments is that inherited complexity is not correlated with class complexity. Therefore, HCC can be considered a valid metric from this point of view. Moreover, the evaluation of the efficiency of the prediction models shows us a similar efficiency for HCC and the inherited complexity. Additionally, there is a need for a clear distinction between a class's complexity and its inherited complexity when defining complexity metrics.
Problem

Research questions and friction points this paper is trying to address.

Evaluating Hybrid Cyclomatic Complexity in defect prediction models
Assessing inherited vs. actual class complexity in OOP
Validating HCC as a reliable software quality metric
Innovation

Methods, ideas, or system contributions that make the work stand out.

Introduces Hybrid Cyclomatic Complexity (HCC) metric
Evaluates HCC in defect prediction models
Compares HCC with inherited and actual complexity
🔎 Similar Papers
No similar papers found.
L
Laura Diana Cernau
Babes,-Bolyai University Faculty of Mathematics and Computer Science, Kogălniceanu, 1, 400084, Cluj, Romania
Laura Diosan
Laura Diosan
Babeș-Bolyai University, Computer Science Department
Machine LearningEvolutionary ComputationMedical Image Processing
C
Camelia Serban
Babes,-Bolyai University Faculty of Mathematics and Computer Science, Kogălniceanu, 1, 400084, Cluj, Romania