Skip to content

Locating Fix Inducing Changes

jordanell edited this page Jul 3, 2012 · 4 revisions

A fix-inducing change is a change that later gets undone by a fix. In other words, a fix inducing change is a bug. In this section, we show how to automatically locate fix-inducing changes.

From the com2pgsql project, we have links between communication artifacts and project commits. From these links we are able to find out what the fix was for. More specifically we can determine what the commit was changing and see if it was a bug introduction.

Detection

Suppose that a commit δ ∈ t which is known to be a commit associated with a fix communication artifact b (thus a link (t, b) must exist), transforms the revision r1 = 1.17 of Foo.java into r2 = 1.18.

First we need to detect the lines L that have been touch by δ in r1. These are the locations of the fix. To locate them we use our database from the scm2pgsql project which in turn has diffed the revisions of the file in question. In this example, we assume that line 20 and 40 have been changed and line 60 has been deleted, thus the fix locations in r1 are L = {20; 40; 60}.

Next, we use the ownership table inside of the scm2pgsql database to find out the owners for the file at r1. (scm2pgsql uses jGit's blame tool to find this out). We can now determine, not only who owned the unchanged lines in r1, but more importantly when they were last changed. Now, for each line l ∈ L, we find the last time that line was changed and create pairs from the last modification revision to our current fix which become our candidates for a bug and fix. For example if line 20 was last changed at r0 = 1.11 then we would add S = {(1.11, 1.18)} and so on.

From this set of candidates, we remove pairs (ra, rb) for which it is not possible that ra induced the fix rb because ra was committed to git after the bug was reported in a communication artifact.

What is left from the removal of candidates, is our pairs which have been identified by this project as bug and fix relationships and will be inserted into the result table of the database.

Notes

This project's results rely heavily on the success of the com2pgsql project. Problems in this precursor will be compounded in the results of this project.

Clone this wiki locally