60
Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code Nicolas Bettenburg Stephen W. Thomas Ahmed E. Hassan Queen’s University Software Analysis and Intelligence Lab (SAIL) Kingston, Ontario, Canada

Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Embed Size (px)

DESCRIPTION

Talk on Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code, given at the 16th European Conference on Software Maintenance and Reengineering (CSMR'12) in Hungary.

Citation preview

Page 1: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Using Fuzzy Code Search to Link Code Fragments in Discussions to

Source Code

Nicolas Bettenburg Stephen W. Thomas Ahmed E. HassanQueen’s University

Software Analysis and Intelligence Lab (SAIL)Kingston, Ontario, Canada

Page 2: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

2

“Given enough eyeballs, all bugs are shallow.”

Eric S. Raymond - The Cathedral and the Bazaar

Page 3: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

3

Which parts of the source code did

developers discuss?

Objective in this Study:

Page 4: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

3

Which parts of the source code did

developers discuss?

Finding Associations of Discussions with Source Code Files

Objective in this Study:

Page 5: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Communication Repository

4

Source CodeArchive

Page 6: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Communication Repository

4

Source CodeArchive

Page 7: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Communication Repository

4

Source CodeArchive

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 8: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Communication Repository

4

Source CodeArchive

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

TraceabilityLinks

Page 9: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

5

Page 10: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

5

Page 11: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

5

org.eclipse.swt/Eclipse_SWT/win32/org/eclipse/swt/widgets/Button.java

Page 12: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

Approaches in the Past

6

3Change Log Analysis

Information Retrieval

Lightweight Textual Analysis

Page 13: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

7

Change Log Analysis

LUCENE-2297: allow reader pooling to be enabled (through IndexWriterConfig) even if you're not pulling NRT reader.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

SVN

Page 14: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

7

Change Log Analysis

LUCENE-2297: allow reader pooling to be enabled (through IndexWriterConfig) even if you're not pulling NRT reader.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

SVN

Page 15: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

7

Change Log Analysis

LUCENE-2297: allow reader pooling to be enabled (through IndexWriterConfig) even if you're not pulling NRT reader.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

SVN

Bug Report #LUCENE-2297

Page 16: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

7

Change Log Analysis

LUCENE-2297: allow reader pooling to be enabled (through IndexWriterConfig) even if you're not pulling NRT reader.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

SVN

Bug Report #LUCENE-2297

Page 17: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

8

Map<Integer, BugReport> bugReports = dbc.getReportsConcurrent(bugIDs, Main.isCli_withDiscussions(), Main.isCli_withAttachments(), true); // Instantiate Output Class // This time we will need to use some XML Outputter for the Stacktraces Experiment_Structural_Logger logger = new Experiment_Structural_Logger (); DataExportUtility dexutil = new DataExportUtility(); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); Element rootElement = new Element("CVS"); // Process the Reports if (Main.getCli_project().equalsIgnoreCase("eclipse")) { for (int id : bugIDs) { } BugReport currentReport = bugReports.get(id); Element reportElement = new Element("Report"); Code

DescriptionJared Burns 2002-11-01 14:56:40 ESTBuild 20021031(, 30, and 29)Linux-GTK

Very often (in recent builds), when I perform an action that requires establishing a connection to the dev.eclipse.org CVS server, the progress dialog appears but it stalls before any progress is made. I have to hit Cancel, wait 10+ seconds (I just switch apps), and then try again or it neverconnects.

This happens to me most often when I click the "Synchronize all CVSprojects..." button. The dialog appears and says "Authenticating overextssh", but the progress monitor never budges.

Discussion

Information Retrieval

Page 18: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

8

Map<Integer, BugReport> bugReports = dbc.getReportsConcurrent(bugIDs, Main.isCli_withDiscussions(), Main.isCli_withAttachments(), true); // Instantiate Output Class // This time we will need to use some XML Outputter for the Stacktraces Experiment_Structural_Logger logger = new Experiment_Structural_Logger (); DataExportUtility dexutil = new DataExportUtility(); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); Element rootElement = new Element("CVS"); // Process the Reports if (Main.getCli_project().equalsIgnoreCase("eclipse")) { for (int id : bugIDs) { } BugReport currentReport = bugReports.get(id); Element reportElement = new Element("Report"); Code

DescriptionJared Burns 2002-11-01 14:56:40 ESTBuild 20021031(, 30, and 29)Linux-GTK

Very often (in recent builds), when I perform an action that requires establishing a connection to the dev.eclipse.org CVS server, the progress dialog appears but it stalls before any progress is made. I have to hit Cancel, wait 10+ seconds (I just switch apps), and then try again or it neverconnects.

This happens to me most often when I click the "Synchronize all CVSprojects..." button. The dialog appears and says "Authenticating overextssh", but the progress monitor never budges.

Discussion

Information Retrieval

Page 19: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

8

Map<Integer, BugReport> bugReports = dbc.getReportsConcurrent(bugIDs, Main.isCli_withDiscussions(), Main.isCli_withAttachments(), true); // Instantiate Output Class // This time we will need to use some XML Outputter for the Stacktraces Experiment_Structural_Logger logger = new Experiment_Structural_Logger (); DataExportUtility dexutil = new DataExportUtility(); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); Element rootElement = new Element("CVS"); // Process the Reports if (Main.getCli_project().equalsIgnoreCase("eclipse")) { for (int id : bugIDs) { } BugReport currentReport = bugReports.get(id); Element reportElement = new Element("Report"); Code

DescriptionJared Burns 2002-11-01 14:56:40 ESTBuild 20021031(, 30, and 29)Linux-GTK

Very often (in recent builds), when I perform an action that requires establishing a connection to the dev.eclipse.org CVS server, the progress dialog appears but it stalls before any progress is made. I have to hit Cancel, wait 10+ seconds (I just switch apps), and then try again or it neverconnects.

This happens to me most often when I click the "Synchronize all CVSprojects..." button. The dialog appears and says "Authenticating overextssh", but the progress monitor never budges.

Discussion

Information Retrieval

Page 20: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

8

Map<Integer, BugReport> bugReports = dbc.getReportsConcurrent(bugIDs, Main.isCli_withDiscussions(), Main.isCli_withAttachments(), true); // Instantiate Output Class // This time we will need to use some XML Outputter for the Stacktraces Experiment_Structural_Logger logger = new Experiment_Structural_Logger (); DataExportUtility dexutil = new DataExportUtility(); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); Element rootElement = new Element("CVS"); // Process the Reports if (Main.getCli_project().equalsIgnoreCase("eclipse")) { for (int id : bugIDs) { } BugReport currentReport = bugReports.get(id); Element reportElement = new Element("Report"); Code

DescriptionJared Burns 2002-11-01 14:56:40 ESTBuild 20021031(, 30, and 29)Linux-GTK

Very often (in recent builds), when I perform an action that requires establishing a connection to the dev.eclipse.org CVS server, the progress dialog appears but it stalls before any progress is made. I have to hit Cancel, wait 10+ seconds (I just switch apps), and then try again or it neverconnects.

This happens to me most often when I click the "Synchronize all CVSprojects..." button. The dialog appears and says "Authenticating overextssh", but the progress monitor never budges.

Discussion

Information Retrieval

Page 21: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

9

I20041130-0800

Wrong compiler error when interface overrides two methods with same signaturebut different thrown exceptions: The call to ij.m() is OK, but eclipse flags itwith "Unhandled exception type IOException".

public class Over { void x() throws ZipException { IandJ ij= new K(); ij.m(); //wrong compile error } void y() throws ZipException { K k= new K(); k.m(); }}

interface I { void m() throws IOException; }interface J { void m() throws ZipException; }interface IandJ extends I, J {} // swap I and J to make compile error disappearclass K implements IandJ { public void m() throws ZipException { } }

Lightweight Textual Analysis

Page 22: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

9

I20041130-0800

Wrong compiler error when interface overrides two methods with same signaturebut different thrown exceptions: The call to ij.m() is OK, but eclipse flags itwith "Unhandled exception type IOException".

public class Over { void x() throws ZipException { IandJ ij= new K(); ij.m(); //wrong compile error } void y() throws ZipException { K k= new K(); k.m(); }}

interface I { void m() throws IOException; }interface J { void m() throws ZipException; }interface IandJ extends I, J {} // swap I and J to make compile error disappearclass K implements IandJ { public void m() throws ZipException { } }

Over.java

ZipException.java

IOException.java

I.java J.javaK.java

Lightweight Textual Analysis

Page 23: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

10

Page 24: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

10

Change Log AnalysisXOnly works for Bug ReportsGeneralizeability:

Associates complete discussion threadGranularity:Link to all files changed in commitPrecision:

Ignores the actual discussions!Conceptual Mismatch:

Page 25: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

10

Change Log AnalysisXOnly works for Bug ReportsGeneralizeability:

Associates complete discussion threadGranularity:Link to all files changed in commitPrecision:

Ignores the actual discussions!Conceptual Mismatch:

Works for all kinds of documentsGeneralizeability:Which granularity level to choose?Granularity:

Lots and lots of false positives!Precision:Links unrelated documents!Conceptual Mismatch:

Information RetrievalX

Page 26: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

10

Change Log AnalysisXOnly works for Bug ReportsGeneralizeability:

Associates complete discussion threadGranularity:Link to all files changed in commitPrecision:

Ignores the actual discussions!Conceptual Mismatch:

Works for all kinds of documentsGeneralizeability:Which granularity level to choose?Granularity:

Lots and lots of false positives!Precision:Links unrelated documents!Conceptual Mismatch:

Information RetrievalX

Works for all kinds of documentsGeneralizeability:Very fine-grainedGranularity:

Up to 95% precision [Bacchelli-ICSE10]Precision:Links to every class mentionedConceptual Mismatch:

Lightweight Textual AnalysisX

Page 27: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

11

In this Paper:Fuzzy Code Search

I20041130-0800

Wrong compiler error when interface overrides two methods with same signaturebut different thrown exceptions: The call to ij.m() is OK, but eclipse flags itwith "Unhandled exception type IOException".

public class Over { void x() throws ZipException { IandJ ij= new K(); ij.m(); //wrong compile error } void y() throws ZipException { K k= new K(); k.m(); }}

interface I { void m() throws IOException; }interface J { void m() throws ZipException; }interface IandJ extends I, J {} // swap I and J to make compile error disappearclass K implements IandJ { public void m() throws ZipException { } }

Over.javaZipException.java

IOException.javaI.java J.javaK.java

Page 28: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

11

In this Paper:Fuzzy Code Search

I20041130-0800

Wrong compiler error when interface overrides two methods with same signaturebut different thrown exceptions: The call to ij.m() is OK, but eclipse flags itwith "Unhandled exception type IOException".

public class Over { void x() throws ZipException { IandJ ij= new K(); ij.m(); //wrong compile error } void y() throws ZipException { K k= new K(); k.m(); }}

interface I { void m() throws IOException; }interface J { void m() throws ZipException; }interface IandJ extends I, J {} // swap I and J to make compile error disappearclass K implements IandJ { public void m() throws ZipException { } }

Over.javaZipException.java

IOException.javaI.java J.javaK.java

Page 29: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

11

In this Paper:Fuzzy Code Search

I20041130-0800

Wrong compiler error when interface overrides two methods with same signaturebut different thrown exceptions: The call to ij.m() is OK, but eclipse flags itwith "Unhandled exception type IOException".

public class Over { void x() throws ZipException { IandJ ij= new K(); ij.m(); //wrong compile error } void y() throws ZipException { K k= new K(); k.m(); }}

interface I { void m() throws IOException; }interface J { void m() throws ZipException; }interface IandJ extends I, J {} // swap I and J to make compile error disappearclass K implements IandJ { public void m() throws ZipException { } }

X.java

Y.java

Over.javaZipException.java

IOException.javaI.java J.javaK.java

Page 30: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

12

Discussion

Fuzzy Code SearchApproach

Page 31: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

12

Discussion

infoZilla tool

Fuzzy Code SearchApproach

Page 32: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

12

Discussion

infoZilla tool

Code Fragments

Fuzzy Code SearchApproach

Page 33: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

12

Discussion

infoZilla tool

Code Fragments

Clone DetectionPage 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Page 2 of 4

Untitled 12-03-15 2:55 PM

this.opt_withObsolete = opt_withObsolete;}

/* (non-Javadoc) * @see main.IExperiment#getDescription() */public String getDescription() {

String description = "We want to run an experiment all those bug reports.\n\t"+ "We extract the complete stacktrace information to study fix

location and stacktrace interplay.\n\t";return description;

}

/* (non-Javadoc) * @see main.IExperiment#run() */public boolean run() {

final boolean DEBUG = Main.isCli_withDebugMessages();

// Select an appropriate database name on the server depending on the project demanded via command line options

String dbName = "";if (Main.getCli_project().equalsIgnoreCase("eclipse"))

dbName = "eclipse-december-2007";else {

System.out.println("We currently only support the Eclipse database!");

System.exit(0);}

// Create the Database ConnectionDatabaseConnector dbc = new DatabaseConnector(Main.getCli_dbHost(),

Main.getCli_dbUser(), Main.getCli_dbPass(), dbName);dbc.initialize();if (!dbc.connect()) {

System.out.println("Could not connect to database. Check host, port, username and password.");

System.exit(1);}

// Fetch a number of Bug Report unique IDs belonging to the following query

String setSelectionQuery = "SELECT DISTINCT bug_id FROM bugzilla_bugs WHERE bug_id > " + Main.getCli_startID() + " ORDER BY bug_id ASC LIMIT " + Main.getCli_amount();

int[] bugIDs = dbc.getIdSetByQuery(setSelectionQuery);int lastID = bugIDs[bugIDs.length -1];

if (DEBUG)System.out.println("* Attempting to fetch " + bugIDs.length + "

reports from " + Main.getCli_dbHost() + " starting with ID " + Main.getCli_startID());

// Collect the bug reports from the database using up to 100 parallel threads.

Fuzzy Code SearchApproach

Page 34: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

13

Evaluation of our Approach

Page 35: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

13

Evaluation of our Approach

1) QuantitativeDo developers talk about the things they end up changing?

Page 36: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

13

Evaluation of our Approach

1) QuantitativeDo developers talk about the things they end up changing?

2) QualitativeWhich parts of the code do developers talk about the most?

Page 37: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

A B14

Change-Log Analysis Fuzzy Code Search

Case Study: Eclipse 2.0 - 3.2

Page 38: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

A B14

Change-Log Analysis Fuzzy Code Search

Case Study: Eclipse 2.0 - 3.2

16,722 23,079Discussions Files

Page 39: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

A B14

Change-Log Analysis Fuzzy Code Search

Case Study: Eclipse 2.0 - 3.2

16,722 23,079Discussions Files

3,865Discussions

13,581Files

Page 40: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

A BQ: Is A a Superset of B ?

14

Change-Log Analysis Fuzzy Code Search

Case Study: Eclipse 2.0 - 3.2

16,722 23,079Discussions Files

3,865Discussions

13,581Files

Page 41: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

15

Bug Reports (211,843)

Page 42: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

16

Bug Reports (211,843)

Bug Reports containing Code (33,301)

Page 43: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

17

Bug Reports (211,843)

Bug Reports containing Code (33,301)

Clone DetectionBased Approach

(2,980)

A

Page 44: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

18

Bug Reports (211,843)

Change Log AnalysisBased Approach

(16,722)

Bug Reports containing Code (33,301)

Clone DetectionBased Approach

(2,980)

A B

Page 45: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

19

Bug Reports (211,843)

Change Log AnalysisBased Approach

(16,722)

Bug Reports containing Code (33,301)

507Clone DetectionBased Approach

(2,980)

A B

Page 46: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

19

Bug Reports (211,843)

Change Log AnalysisBased Approach

(16,722)

Bug Reports containing Code (33,301)

507Clone DetectionBased Approach

(2,980)

A B

Very small overlap: Links are

conceptually different!

Page 47: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

20

Page 48: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

20

Page 49: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

20

In Eclipse: heavy re-use of code

snippets to create regression tests.

Page 50: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

21

Fuzzy Code Search

Page 51: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

21

Fuzzy Code SearchFinds conceptually different links:

Page 52: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

21

Fuzzy Code SearchFinds conceptually different links:

What Developers really talk about

Page 53: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

21

Fuzzy Code SearchFinds conceptually different links:

What Developers really talk about

Not what they end up changing

Page 54: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

21

Fuzzy Code SearchFinds conceptually different links:

What Developers really talk about

Not what they end up changing

Not what their code references

Page 55: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Page 56: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Page 57: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Page 58: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Page 59: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Page 60: Using Fuzzy Code Search to Link Code Fragments in Discussions to Source Code

22

Thanks!