Deep multi-metrics learning for mobile app defect prediction using code and process metrics

Ahmed Abdu, Hakim A. Abdo, Inam Ullah, Jawad Khan, Yeong Hyeon Gu, Redhwan AlgabriScientific 2025

Abstract

The rise in mobile apps necessitates precise defect prediction to aid developers in resource allocation. The efficacy of defect prediction relies on data representation and model selection. However, existing research relies on isolated data sources, limiting models' ability to capture the complex interplay of code and process metrics in app development. This paper addresses this limitation by proposing a Deep Multi-Metrics Learning Model (DMLM), which leverages code metrics from the current code version and process metrics from previous releases. A deep convolutional neural network (CNN) is employed to capture intricate patterns within these metrics, enabling more accurate predictions. Experimental evaluations using nine real-world Android apps from Git Android repositories demonstrate that DMLM outperforms state-of-the-art approaches under non-effort-aware conditions regarding Area Under the Curve (AUC), F1 scores, and Matthews correlation coefficient (MCC). The experimental evaluation also demonstrates that the DMLM model outperforms existing baseline methods in PofB20 under effort-aware conditions. The findings highlight the efficacy of DMLM in enhancing mobile app defect prediction performance across both non-effort-aware and effort-aware contexts.

Introduction

Software defect prediction is a critical task for developers aiming to optimize quality assurance efforts. By identifying files or modules likely to contain bugs, teams can prioritize testing where it is most needed. Traditionally, prediction models have focused on two distinct categories of data:

  1. Code Metrics: Static features such as Lines of Code (LOC) or Cyclomatic Complexity that describe the structural complexity of the code.
  2. Process Metrics: Evolutionary data like code churn, the number of commits, or the number of developers, which reflect the history of changes.

In the fast-paced world of mobile app development, characterized by rapid release cycles, neither category is sufficient on its own. A structurally complex file might remain stable if rarely touched, while a simple file might become a bug hotspot due to frequent, high-churn updates. The key to better prediction lies in capturing the interplay between a file's structure and its developmental history.

Methodology: The DMLM Framework

To bridge this gap, we propose the Deep Multi-Metrics Learning Model (DMLM). This framework systematically fuses heterogeneous feature spaces to provide a holistic view of software health.

Data Collection and Preparation

The process begins by extracting 20 code metrics (e.g., WMC, CBO, LOC) from the current version of the code and 10 process metrics (e.g., Lines Added/Deleted, Entropy) from Version Control Systems (VCS) like Git. This data is combined with information from Bug Tracking Systems to label instances as "defective" or "clean."

Overview of the DMLM framework, showing the pipeline from data collection to classification.

To address the common issue of class imbalance—where buggy files are significantly outnumbered by clean ones—the framework employs data preparation techniques. This includes undersampling for apps with high defect rates and oversampling for those with low defect rates, ensuring the model learns to distinguish both classes effectively.

Model Architecture

The core of DMLM is a 1D Convolutional Neural Network (CNN). While CNNs are typically associated with image processing, they are highly effective at "feature learning" from structured tabular data. The 1D-CNN identifies non-linear interactions and spatial dependencies between the combined code and process metrics.

Detailed architecture of the 1D-CNN model used for feature learning and defect prediction.

As shown in the architecture, the input layer receives the combined metrics, which then pass through a 1D convolutional layer and a max-pooling layer to extract high-level features. A dropout layer is included to prevent overfitting. Finally, a series of fully connected layers leads to a Softmax classifier that outputs the final prediction: Defective or Clean.

Experimental Evaluation

The study evaluated DMLM using nine real-world Android application packages sourced from Google’s Git repositories, including Bluetooth, Browser, Camera, Contacts, DocumentsUI, Gallery2, Email, Messaging, and TV App. Multiple releases were collected for each project to capture their evolution.

DMLM was compared against six state-of-the-art baselines, including Multi-task learning (MTL-DNN) and Simplified Deep Forest (SDF). The evaluation focused on both standard predictive performance and "effort-aware" scenarios.

Key Results and Insights

The experimental results demonstrate the superiority of the multi-metrics approach:

  • Predictive Performance: DMLM consistently outperformed all baselines. It achieved an average F1 score of 0.566 and an AUC of 0.707, significantly higher than the next best baseline (SDF at 0.508 F1 and 0.644 AUC).
  • Reliability: The model showed a higher Matthews Correlation Coefficient (MCC) of 0.422, indicating reliable performance even on imbalanced datasets.
  • Effort-Aware Utility: In the PofB20 test—measuring bugs found within the top 20% of the codebase—DMLM reached a score of 0.391. This implies that developers can catch nearly 40% of defects by reviewing only one-fifth of the code.
  • Cross-Project Generalization: The model demonstrated strong performance in cross-project scenarios, suggesting it learns universal patterns of defect-prone development behavior rather than just project-specific quirks.

Conclusion

The DMLM model highlights the importance of combining code structure with process history for mobile app defect prediction. By leveraging a 1D-CNN to capture the synergy between these metrics, DMLM provides a more accurate and resource-efficient tool for QA teams. Future work will explore the integration of semantic information through Large Language Models (LLMs) and the inclusion of human-centric factors like developer experience to further refine prediction accuracy.

Summary updated

BibTeX
@inproceedings{abdu2025deep,
  author = {Ahmed Abdu and Hakim A. Abdo and Inam Ullah and Jawad Khan and Yeong Hyeon Gu and Redhwan Algabri},
  title = {{Deep multi-metrics learning for mobile app defect prediction using code and process metrics}},
  booktitle = {Scientific},
  year = {2025},
  doi = {10.1038/s41598-025-22566-2},
}
Figure