Saved in:
Bibliographic Details
Main Authors: Xing, Ying, Zhao, Mengci, Yang, Bin, Zhang, Yuwei, Li, Wenjin, Gu, Jiawei, Yuan, Jun
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.10511
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913353751855104
author Xing, Ying
Zhao, Mengci
Yang, Bin
Zhang, Yuwei
Li, Wenjin
Gu, Jiawei
Yuan, Jun
author_facet Xing, Ying
Zhao, Mengci
Yang, Bin
Zhang, Yuwei
Li, Wenjin
Gu, Jiawei
Yuan, Jun
contents In recent years, defect prediction techniques based on deep learning have become a prominent research topic in the field of software engineering. These techniques can identify potential defects without executing the code. However, existing approaches mostly concentrate on determining the presence of defects at the method-level code, lacking the ability to precisely classify specific defect categories. Consequently, this undermines the efficiency of developers in locating and rectifying defects. Furthermore, in practical software development, new projects often lack sufficient defect data to train high-accuracy deep learning models. Models trained on historical data from existing projects frequently struggle to achieve satisfactory generalization performance on new projects. Hence, this paper initially reformulates the traditional binary defect prediction task into a multi-label classification problem, employing defect categories described in the Common Weakness Enumeration (CWE) as fine-grained predictive labels. To enhance the model performance in cross-project scenarios, this paper proposes a multi-source domain adaptation framework that integrates adversarial training and attention mechanisms. Specifically, the proposed framework employs adversarial training to mitigate domain (i.e., software projects) discrepancies, and further utilizes domain-invariant features to capture feature correlations between each source domain and the target domain. Simultaneously, the proposed framework employs a weighted maximum mean discrepancy as an attention mechanism to minimize the representation distance between source and target domain features, facilitating model in learning more domain-independent features. The experiments on 8 real-world open-source projects show that the proposed approach achieves significant performance improvements compared to state-of-the-art baselines.
format Preprint
id arxiv_https___arxiv_org_abs_2405_10511
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Defect Category Prediction Based on Multi-Source Domain Adaptation
Xing, Ying
Zhao, Mengci
Yang, Bin
Zhang, Yuwei
Li, Wenjin
Gu, Jiawei
Yuan, Jun
Software Engineering
In recent years, defect prediction techniques based on deep learning have become a prominent research topic in the field of software engineering. These techniques can identify potential defects without executing the code. However, existing approaches mostly concentrate on determining the presence of defects at the method-level code, lacking the ability to precisely classify specific defect categories. Consequently, this undermines the efficiency of developers in locating and rectifying defects. Furthermore, in practical software development, new projects often lack sufficient defect data to train high-accuracy deep learning models. Models trained on historical data from existing projects frequently struggle to achieve satisfactory generalization performance on new projects. Hence, this paper initially reformulates the traditional binary defect prediction task into a multi-label classification problem, employing defect categories described in the Common Weakness Enumeration (CWE) as fine-grained predictive labels. To enhance the model performance in cross-project scenarios, this paper proposes a multi-source domain adaptation framework that integrates adversarial training and attention mechanisms. Specifically, the proposed framework employs adversarial training to mitigate domain (i.e., software projects) discrepancies, and further utilizes domain-invariant features to capture feature correlations between each source domain and the target domain. Simultaneously, the proposed framework employs a weighted maximum mean discrepancy as an attention mechanism to minimize the representation distance between source and target domain features, facilitating model in learning more domain-independent features. The experiments on 8 real-world open-source projects show that the proposed approach achieves significant performance improvements compared to state-of-the-art baselines.
title Defect Category Prediction Based on Multi-Source Domain Adaptation
topic Software Engineering
url https://arxiv.org/abs/2405.10511