This folder contains TRec's source code and console application organized as follows:
-
The TRec folder contains the console application and all the necessory components needed to run the application. Please read the instructions below on using the console application.
-
The SourceCode folder contains TRec's source code. We provide the source code so that that tool can be extended. Please check ReadMe files in this folder and its subfolders for instructions on using TRec through the source code.
- Ensure that .NET Framework version 4.7.2 or higher is installed on your system.
- You can download and install the .NET Framework from the official Microsoft website: Download .NET Framework
- Ensure that Java version 21.0.3 or higher is installed on your system.
- You can download and install the latest version of Java from the official Oracle website: Download Java
To verify if Java is installed and to check its version, follow these steps:
-
Open Command Prompt (cmd).
-
Type the following command and press Enter:
java -version
-
If Java is installed correctly, you should see an output similar to this:
java version "21.0.3" 2023-04-18 LTS Java(TM) SE Runtime Environment (build 21.0.3+8-LTS-211) Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+8-LTS-211, mixed mode, sharing)
-
If you do not see the version information and instead get an error message, follow the steps below to install or configure Java.
- Go to the Java SE Downloads page.
- Download the installer for your operating system.
- Run the downloaded installer and follow the on-screen instructions to install Java.
- Open the Start menu, search for "Environment Variables," and select "Edit the system environment variables."
- In the System Properties window, click on the "Environment Variables" button.
- In the Environment Variables window, under System variables, click on "New" to add a new system variable.
- Variable name:
JAVA_HOME
- Variable value:
C:\Program Files\Java\jdk-21.0.3
(Replace this path with the path where Java is installed on your system)
- Find the
Path
variable in the System variables section, select it, and click on "Edit." - In the Edit Environment Variable window, click on "New" and add the following path:
%JAVA_HOME%\bin
- Click OK to close all windows.
-
Open a new Command Prompt (cmd).
-
Type the following command and press Enter:
java -version
-
You should see the Java version information, indicating that Java is installed and configured correctly.
- Navigate to the
TRec
folder. - Double-click the file named
ConsoleApp.exe
to open TRec. You can also open the file via a terminal or command prompt.
- The tool will prompt for the local repository path of the project that you want recommendations for.
- Note that the project should be cloned using git bash and not downloaded, as downloading from Git does not include the commit history.
- Example:
C:\Users\saiki\commons-lang
- The tool will then ask for the Commit ID for recommendations.
- Example:
f161ff66698bea44784926fc6aa9073d96a00cec
- If you are running the tool for the first time, it will perform an initial analysis. This process may take a while to complete. For reference, TRec took 3 hours 22 minutes, 37 minutes, and 1 hour 48 minutes to analyze commons-lang, gson, and commons-io during the evaluation, respectively.
- Note that TRec will create a TCT (test-to-code traceability) link database folder under the
TRec
folder. The database size depends on the number of TCT links extracted by the tool. Please ensure that the drive has sufficient storage. We recommend at least 10GB free space since TRec uses some space for processing commits. - After the initial analysis, the tool provides the recommendations.
- You can close the console application by pressing "C".
- You have to start/open the
ConsoleApp.exe
each time you need a recommendation for a commit. However, for subsequent uses, the tool will skip the initial analysis. - TRec takes the same inputs as in the initial analysis and provides recommendations instantly.
- Ensure the provided repository path and commit ID are correct.
- The initial analysis may take some time, but it is only required during the first run.
If you prefer to skip the initial analysis for the projects on which TRec is evaluated on, you can use the already extracted TCT link databases as follows:
- Extract the
DataBase.rar
file located in theTRec
folder. - Copy/Replace the existing database folder in the
TRec
folder with the extracted database folder. - Ensure that you have the following directory structure:
TRec\DataBase\ParsedData
andTRec\DataBase\ParsedData\RepoWareHouse
. You should have a database file for each evaluated project in theTRec\DataBase\ParsedData
folder.