This paper presents our approach proposed to detect and create indivisible multi-hunk bugs, an evaluation of existing repair techniques based on these bugs, and a study of how these bugs are repaired by the developers and the existing tools. Multi-hunk bug repair aims to deal with complex bugs by producing patches addressing different locations of the program. Previous research on multi-hunk bug repair is severely misguided, as the evaluation of existing techniques is based on the Defects4J dataset, which is filled with \textit{divisible} multi-hunk bugs. A divisible multi-hunk bug is essentially a combination of multiple independent bugs triggering different failures. Repairing divisible bugs is in practice uncommon, as the developer typically deals with one failure at a time for debugging. To provide a better basis for multi-hunk repair research, we propose an enumeration-based approach IBugDC to automatically detect divisible and indivisible bugs and further isolate the divisible bugs detected to create new indivisible bugs. We applied IBugDC to 281 multi-hunk bugs from the Defects4J dataset. It identified 139 divisible bugs and further created 249 isolated bugs among which 105 are multi-hunk. Since no previous evaluation has focused on indivisible bug repair, we also evaluated existing repair techniques in dealing with these bugs. Our result shows that current techniques repaired only a small number of the indivisible bugs suggesting weak repair abilities.

Because there was no study that helps people understand why an indivisible bug requires multi-hunk patches and how to generate these patches, we studied a sample of the indivisible bugs identified and created by IBugDC with a focus on analyzing the relationships of the partial patches made at the various locations and understanding the role each of the partial patches plays in tackling the failure. As the main result, we identified 8 relationships and sketched strategies to generate patches based on the relationships. We further analyzed the patches generated for bugs repaired by existing tools and found that most of the patches are single-hunk and single-hunk-alike, implying that existing tools are not mature at addressing complex bugs.