Programming-Construct-Level Change Entropy for Software Bug Prediction: An Empirical Comparison with File-Level Entropy
Open Access
Abstract
Changing business requirements and the need to improve user satisfaction mean that software source code must be modified frequently to implement new features, enhancements, and bug fixes. These frequent code changes introduce uncertainty and complexity, which is quantified by entropy-based measures. Previous studies have used entropy-based measures for bug prediction by analyzing the distribution of changes across different source code files. However, such approaches do not capture the syntactic and semantic features of different programming-construct-based code changes. In this study, we identify 11 new programming-construct-based code change subcategories, in addition to those in the existing study. The different programming constructs are IF Statement (IF), Method Call (MC), Method Declaration (MD), Loop (LP), Sequence (SQ), Class Field (CF), Class (C), Try (TY), Assignment (AS), Switch (SW), and Finally (F). We use historical code change data from the Eclipse Java project’s Core, UI, and Debug components to quantify change complexity at the file and programming-construct levels and to propose an entropy-based bug prediction model using these metrics. The study examines relationships between programming-construct-based subcategories and bugs, their contribution to prediction performance, their consistency across components, and the effect of Shannon entropy transformation. This study proposes three bug prediction models based on entropy measures: two models use programming-construct-level change entropy, including individual and aggregated programming construct entropy, while the third model uses file-level change entropy. Experimental results across several regression techniques demonstrate that the programming-construct-level change entropy-based models achieve higher prediction performance than file-level change entropy-based models. The findings indicate that bug prediction using programming-construct-level change entropy provides better performance than file-level change entropy. The proposed study supports developers and managers in understanding software complexity and improving code maintainability.Keywords
This publication has 41 references indexed in Scilit:
- An audit of machine learning experiments on software defect predictionEmpirical Software Engineering, 2026
- Anticipating bugs: Ticket-level bug prediction and temporal proximity effectsEmpirical Software Engineering, 2025
- Assessing Ensemble Learning Techniques in Bug Prediction2021
- Entropy Based Machine Learning Models for Software Bug Severity Assessment in Cross Project Context2020
- Ammonia: an approach for deriving project-specific bug patternsEmpirical Software Engineering, 2020
- Complexity of the Code Changes and Issues Dependent Approach to Determine the Release Time of Software ProductLecture Notes in Computer Science, 2017
- Evaluating defect prediction approaches: a benchmark and an extensive comparisonEmpirical Software Engineering, 2011
- Toward an understanding of bug fix patternsEmpirical Software Engineering, 2008
- The Origins of the Entropy Concept2004
- A Mathematical Theory of CommunicationBell System Technical Journal, 1948