How to collect the necessary context for bug detection

Develop methods to collect the program context necessary to decide whether a given code unit is buggy in bug detection research.

Background

In addition to the amount of required context, an open problem is how to obtain that context effectively in practice. The authors’ results suggest that grep-based, agent-driven searches may be a promising mechanism for context collection, but this remains to be validated for bug detection tasks.

References

\citet{risse_2025_topscorewrongexam} raised two open questions in bug detection research: (i) what amount of context is sufficient to decide whether a given code unit is buggy, and (ii) how should this context be collected?

How and Why Agents Can Identify Bug-Introducing Commits  (2603.29378 - Risse et al., 31 Mar 2026) in Discussion, Subsection Bug Detection