Do we have a commit prior to the buggy commit
I understand we can get the buggy and fixed commit by using '-b' and '-f' options but I am looking for pre buggy commit so that I know if the test case was added newly or it was modified before it failed
defects4j checkout -p Lang -v 1b -w /tmp/lang_1_buggy defects4j checkout -p Lang -v 1f -w /tmp/lang_1_fixed
Is there an option to get the original commit prior to buggy commit ??
Hi @VinayKabadi,
You can access the entire (git) history, using the original buggy and fixed commit hashes (e.g., see revision ids in active-bugs.csv).
Given your use case, you can also just compute the diff between these two commits to determine if the bug-triggering test was newly added. Even simpler, you can look at the patches/<id>.test.patch files -- just note that these precomputed diffs may disappear in future versions because they are cheap to compute on the fly.
IIRC, a triggering test was newly added for most bugs. One thing to keep in mind, though, is that the timeline in the repository is a poor proxy for what actually happened during development. Often, a triggering test existed before the bug was fixed, but it was added to the repo with the bug fix -- presumably to avoid test failures. In these cases, assuming that a triggering test was created after the bug fix was known would be incorrect. If you only want to determine all triggering tests that had existed in the repo prior to the buggy commit, then looking at the diff or commit history seems fine.
Best, René