Computer scientists have demonstrated that integrating software design principles directly into machine learning feature representations substantially improves the identification and categorization of structural software defects. In a study published in Discover Computing, researcher Mitrabinda Ray introduced an architecture-aware software analytics framework that combines metrics based on Keep It Super Simple, Don’t Repeat Yourself, and SOLID design principles to classify design-level faults. Evaluating the framework across four established open-source Java systems, the investigation established that a hierarchical classification architecture achieved a peak classification accuracy of 91.3 percent when utilizing a full 36-dimensional feature space. By contrast, conventional fault classification models relying strictly on traditional code complexity, object-oriented metrics, and process measures attained an accuracy of only 75.5 percent under identical experimental conditions.
Software fault classification serves a foundational role in software analytics and system maintenance by grouping defects according to their underlying mechanics and structural characteristics. Historically, fault categorization relied on source-code metrics, bug reports, and standard code complexity measurements to flag failure-prone software components. However, existing classification models exhibit notable limitations in characterizing design-level violations, as they seldom incorporate foundational software design principles into their feature formulations. Complex modern software applications depend heavily on component modularity, inheritance hierarchies, interface contracts, and controlled coupling. When defects stem from architectural deficiencies—such as overloaded class responsibilities, fragile abstractions, or improper concrete dependencies—traditional metrics like lines of code or basic branching complexity offer minimal diagnostic power. To bridge this gap, the investigation mapped fundamental design guidelines to structural fault categories, establishing a quantitative basis for recognizing how departures from maintainability, extensibility, and modularity principles produce distinct families of design defects within production codebases.
The methodology centers on constructing a comprehensive 36-dimensional feature space derived entirely from automated static source-code analysis. This unified representation consolidates four distinct metric groups into a single feature vector for each analyzed class. The first group incorporates four Keep It Super Simple metrics evaluating structural complexity, comprising Cyclomatic Complexity, Nesting Depth, Cognitive Complexity, and Long Method Count. The second group provides five Don’t Repeat Yourself measures targeting code duplication, including Clone Density, Duplicate Block Count, Clone Consistency Ratio, Repeated Logic Frequency, and Clone Change Coupling. The third group captures architectural properties through fifteen metrics distributed evenly across the five SOLID design principles: Responsibility Count, Cohesion Violation Ratio, and God Class Indicator for Single Responsibility; Extension Difficulty Index, Modification Frequency, and Conditional Complexity Ratio for Open-Closed; Override Violation Count, Behavioral Deviation Ratio, and Contract Violation Index for Liskov Substitution; Interface Fatness Ratio, Unused Method Ratio, and Interface Cohesion Score for Interface Segregation; and Abstraction Dependency Ratio, Concrete Dependency Count, and Dependency Instability Index for Dependency Inversion. Twelve traditional metrics complete the vector, encompassing five Chidamber and Kemerer object-oriented metrics, four Halstead complexity measures with lines of code, and three historical process metrics tracking revision counts, change frequency, and code churn.
To extract these diverse structural properties systematically, the researcher engineered an automated software analytics pipeline combining static syntax analysis and Abstract Syntax Tree parsing. Structural and behavioral properties were parsed using JavaParser, complemented by static code analyzers including SonarQube, PMD, and the CK Metric Tool. Code duplication and clone evolution metrics were extracted utilizing specialized clone detection engines, specifically NiCad and SourcererCC, alongside repository history inspection for evolution metrics. The operational workflow processed Java repositories checked out at consistent version states, deliberately excluding interfaces, annotation types, generated files, anonymous classes, package descriptors, and testing suites to isolate core application logic. Multi-collinearity analysis confirmed that while conceptually related metrics within the same design families exhibited moderate statistical correlations, the Variance Inflation Factor values across all thirty-six feature dimensions remained strictly below the conservative diagnostic threshold of 5.0, confirming that the unified feature space maintained distinct structural signals without excessive redundancy.
Because existing open-source defect repositories predominantly document implementation bugs rather than balanced design violations, the study generated a controlled benchmark dataset through deliberate design-level fault injections. Four major open-source Java projects—Apache Ant, Apache Lucene, Apache Camel, and JUnit—served as the subject systems, providing diverse architectural styles, domain responsibilities, and structural complexities. Within these projects, candidate classes underwent controlled modifications to implement representative design violations corresponding to predefined fault mechanisms. Crucially, ground-truth labels were assigned at the moment of fault injection entirely independent of metric computation, preventing metric-derived label leakage and circular label reasoning. The resulting corpus comprised balanced instances distributed across seven Level-1 fault families: Complexity, Duplication, Responsibility, Extensibility, Behavioral, Interface, and Dependency faults. Each high-level family further contained five specialized Level-2 fault subtypes, yielding thirty-five fine-grained categories that capture operational defects ranging from control-flow and clone faults to interface bloat and abstraction leakage.
Rather than attempting flat classification across dozens of competing categories simultaneously, the framework deploys a two-phase hierarchical machine learning architecture. In the first phase, a high-level classifier identifies coarse-grained architectural fault patterns, assigning each input feature vector to its overarching Level-1 fault family. Once this broad deficiency category is established, the framework invokes a specialized second-stage classifier trained exclusively on the subordinate fault subtypes belonging to that specific family. This hierarchical decomposition reduces the number of competing candidate classes at each decision point, allowing specialized models to focus on subtle intra-family differentiators. Evaluated using Random Forest and Extreme Gradient Boosting algorithms under stratified five-fold cross-validation, the hierarchical approach systematically surpassed flat multiclass architectures. Hierarchical Random Forest achieved 89.2 percent accuracy compared to 84.7 percent for its flat counterpart, while Hierarchical XGBoost achieved 91.3 percent accuracy versus 88.6 percent for flat classification, with paired t-tests demonstrating statistically significant differences across cross-validation folds.
A progressive ablation analysis demonstrated that each tier of architectural design metrics contributed vital predictive power to the classification framework. Using the gradient-boosted decision tree implementation under identical experimental conditions, a baseline model trained solely on traditional object-oriented, complexity, and process metrics yielded an accuracy of 75.5 percent. Integrating the four Keep It Super Simple complexity metrics elevated classification accuracy to 81.8 percent, and the subsequent inclusion of the five Don’t Repeat Yourself duplication metrics increased accuracy to 84.2 percent. Incorporating the full complement of fifteen SOLID metrics produced the peak overall accuracy of 91.3 percent, demonstrating that responsibility allocation, extensibility constraints, behavioral contracts, interface breadth, and dependency hierarchies provide substantial discriminatory information beyond conventional code measures. Notably, an isolated model utilizing only the twenty-four principle-driven metrics without any traditional metrics retained an accuracy of 89.6 percent, confirming that architectural principles alone provide a robust foundation for fine-grained fault characterization.
The research assessed cross-project generalization through rigorous leave-one-project-out validation experiments, training the machine learning pipeline on three open-source systems and testing its diagnostic accuracy on the remaining unseen project. Across iterative evaluations involving Apache Ant, Apache Lucene, Apache Camel, and JUnit, the framework sustained an average cross-project accuracy of 91.2 percent with minimal performance fluctuation among the different application domains. Paired t-test comparisons between Random Forest and XGBoost across cross-validation folds yielded low p-values favoring gradient boosting, although the author noted that the statistical tests must be interpreted cautiously due to the limited degrees of freedom inherent in five-fold cross-validation.
To evaluate whether the injected fault categories reflected real-world software maintenance challenges, the investigator conducted an independent taxonomy validation study examining two hundred naturally occurring defects. Fifty confirmed bug reports with corresponding patch commits were collected from the public issue trackers of each subject project, filtering out documentation changes, feature additions, and unverified reports. Operational mapping criteria matched these natural defects against the proposed fault definitions, successfully categorizing 188 of the 200 defects—an overall taxonomy coverage rate of 94 percent. Real-world faults mapped naturally onto categories including Control Flow Faults, Clone Faults, Responsibility Overload Faults, Extension Resistance Faults, Behavioral Substitution Faults, Interface Bloat Faults, and Concrete Dependency Faults, with only twelve defects remaining unmapped. This independent validation confirmed that the taxonomy accurately reflects authentic architectural degradation, even though these natural defects were strictly reserved for taxonomy verification and excluded from model training.
The study explicitly outlines several methodological boundaries and threats to validity regarding its findings. Foremost among external constraints is that the empirical classification experiments relied on manually injected design faults rather than natural bug corpora, meaning the controlled dataset does not claim to mirror the statistical distributions, contextual nuances, or human developer errors characteristic of operational production environments. Construct validity considerations also emphasize that static metric analysis cannot observe runtime execution states or developer intent, functioning as measurable proxies rather than absolute arbiters of software quality. Future research will explore graph neural networks, larger multi-language ecosystems, and automated extraction of design fault categories from historical defect repositories to advance automated architectural fault diagnosis.
Subject of Research: Architecture-aware multiclass design-level fault classification in software engineering
Article Title: Architecture-aware multiclass design-level fault classification using KISS, DRY, and SOLID principle-based metrics
Article References: Ray, M. (2026). Architecture-aware multiclass design-level fault classification using KISS, DRY, and SOLID principle-based metrics. Discover Computing, 29(1), Article 860. https://doi.org/10.1007/s10791-026-10800-y
Image Credits: AI Generated
DOI: 10.1007/s10791-026-10800-y
Keywords: software engineering, fault classification, software metrics, machine learning, SOLID principles, hierarchical classification, software architecture, code quality, Architecture-aware, multiclass, design-level, fault
News Source: Teresa Odom. (November 9, 2026). Hierarchical Machine Learning Framework Classifies Software Design Faults Using Architectural Metrics. Scienmag.



