SoftwareIntrospectionLab / FixCache

Other
16 stars 5 forks source link

FixCache

What is it?

FixCache is used to predict faulty files. It processes a database filled in from a source control repository history to identify files which are likely to be buggy.

Dependencies

Versions tested are in parentheses

Database

This distribution of FixCache operates on a MySQL database constructed by MininGit constructed with the following parameters:

./cvsanaly2 --db-user=[user] --db-password=[password] --extensions=FileTypes,BugFixMessage,Content,FileCount,Patches,Hunks,HunkBlame --hard-order [repository path]

To allow FixCache to run unit tests without instansiating a database, the unit tests on an in-memory SQLite database. As Java has no standard SQLite library (for shame!), a dependency is downloaded automatically by Maven.

Building and Running with Maven

FixCache is compiled and run using Maven 2. This allows all the dependencies to be managed for you. As long as you are connected to the Internet, a build should compile cleanly. If you don't have Maven, most *nix package repositories (including MacPorts) have it under maven2, otherwise you can download it from the Maven web site.

The standard Maven mvn clean/build/test/run goals work, and these are wrapped up in the RUN script. You shouldn't need to ever run the test goal, but if you do and all the tests don't pass, let us know!

Configuring FixCache

First off, you need a MySQL database populated with MininGit data, as previously described. Next, you'll need to create a file called database.properties in the root directory so FixCache knows how to connect to it.

Here's an example database.properties file, which follows standard Java Properties file formatting. You'll need to provide at least your username and password:

UserName:orson
UserPass:rosebud

You might also want to provide the URL to your database, and if you are really adventerous, modify the database driver to something else. Only MySQL is tested, and there's no guarantees that some of the queries aren't MySQL-specific. The values in the square brackets are the defaults.

Driver:[com.mysql.jdbc.Driver]
URL:[jdbc:mysql://localhost:3306/fixcache]

Running FixCache

Once you have an all the data for a given project in the database and a database.properties file set up, you can run FixCache directly from the command line.

You can do this with the RUN script, with various parameters. It's important to understand what they do for the FixCache program to work correctly, it's not a "Fire and Forget" process.

Only the project ID is required.

Example Usage

    FixCache -b=10000 -c=500 -f=600 -r="LRU" -p=1

    FixCache --blksize=10000 --csize=500 --pfsize=600 --cacherep="LRU" --pid=1