Skip to content

SoftwareIntrospectionLab/FixCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Apache Maven 2 (2.2.1)
  • Java 1.6
  • MySQL 5 (ver 14.14 distrib 5.5.8)
  • SQLite 3 (3.6.20)

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.

  • Block size -b={int} --blocksize={int}

    Block size is the number of co-changed files to add to the cache for a given bug-introducing file.

  • Cache size -c={int} --csize={int}

    The size of the cache.

  • Pre-fetch size -f={int} --pfsize={int}

    The number of new or modified files to prefetch when processing a particular commit.

  • Cache replacement policy -r={Policy} --cacherep={Policy}

    The type of cache replacement policy to use (see CacheReplacement.java for a list).

  • Project ID -p={int} --pid={int}

    The repository ID of the project to analyze. This is the ID that CVSanalY2 creates for a given repository. Future releases of FixCache will find the ID itself given the same repository address that CVSanalY2 was given. Right now, you'll need to get that ID by manually looking in the database table.

  • Start time -s={String} --start={String}

    The date (in the repository) to start analysis.

  • End time -e={String} --end={String}

    The date (in the repository) to end analysis.

  • Output -o --save

    Print output to files. File output will be written to the results/ directory.

  • Monthly file distribution -m --multiple

    Print file distribution output to a file every few months of repository time (the default is to do this once)

  • Tune -u --tune

    Run in tune mode, checking many different permutations of parameters to find the best combination.

  • Help -h --help

    Print this message.

Example Usage

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

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published