English

CFaults: Model-Based Diagnosis for Fault Localization in C Programs with Multiple Test Cases

Software Engineering 2025-09-08 v2 Artificial Intelligence Logic in Computer Science

Abstract

Debugging is one of the most time-consuming and expensive tasks in software development. Several formula-based fault localization (FBFL) methods have been proposed, but they fail to guarantee a set of diagnoses across all failing tests or may produce redundant diagnoses that are not subset-minimal, particularly for programs with multiple faults. This paper introduces a novel fault localization approach for C programs with multiple faults. CFaults leverages Model-Based Diagnosis (MBD) with multiple observations and aggregates all failing test cases into a unified MaxSAT formula. Consequently, our method guarantees consistency across observations and simplifies the fault localization procedure. Experimental results on two benchmark sets of C programs, TCAS and C-Pack-IPAs, show that CFaults is faster than other FBFL approaches like BugAssist and SNIPER. Moreover, CFaults only generates subset-minimal diagnoses of faulty statements, whereas the other approaches tend to enumerate redundant diagnoses.

Keywords

Cite

@article{arxiv.2407.09337,
  title  = {CFaults: Model-Based Diagnosis for Fault Localization in C Programs with Multiple Test Cases},
  author = {Pedro Orvalho and Mikoláš Janota and Vasco Manquinho},
  journal= {arXiv preprint arXiv:2407.09337},
  year   = {2025}
}

Comments

Accepted at FM 2024. 15 pages, 2 figures, 3 tables and 5 listings

R2 v1 2026-06-28T17:38:46.817Z