Abstract

Explainable software defect prediction is practical for software quality assurance. However, it is hard to explain the predictions made by obscure machine learning models because of the lack of transparency and the unreliability of the explanations for such predictions from existing explanation methods. To provide a better understanding of the causes of defect proneness of code commits, we propose an approach called CausalDefect to construct a causal graph of defects, which provides a visual way to understand the causal relationships between different features of defects. Based on the transparent causal graph, software engineers can naturally predict defect proneness of code commits, explain the resulting predictions, and finally take feasible action to reduce defect proneness. To verify the usefulness of the generated causal graph, we conduct evaluations, and the evaluation results suggest that our causal graph can effectively and efficiently predict defect proneness of code commits and explain the resulting predictions, even if the graph is not optimized for specific software projects. Most importantly, CausalDefect is the first attempt to employ causal discovery algorithms to investigate the explainability of defect proneness by establishing a causal graph of software defects.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call