LambdaMiner is a fork for RefactoringMiner. While RefactoringMiner is used to detect refactorings in the history of Java projects, LambdaMiner is used for identifying newly-introduced lambda expressions in Java code. We used this tool for conducting a study on how Java developers take advantage of lambda expressions in their code.
Clone or download LambdaMiner.
Import LambdMiner to Eclipse (it is easily possible to create a standalone configuration as well, we will provide it later). For that, first you will need to run the command
gradlew eclipsein the project's folder (
./gradlew eclipseon posix-compliant systems). After the downloading of the necessary dependencies is finished, open Eclipse, and use the
File > Import > General > Existing Projects into Workspace. Select the project's folder and click Finish to import LambdaMiner into eclipse.
LambdaMiner needs a database engine to write the extracted data to. We used MySQL, while you are free to use whatever engine that you like. You will need to configure the
src/META_INF/persistence.xmlfile accordingly. You can download a sample
persistence.xmlfile from here. Make sure to provide the correct server address/username/password for the database in this file.
Make a database named
lambda-studyin your database server (this name can be changed in the
If you want to automatically fetch the top 1000 projects from GitHub (ranked by stargazers count) into the database, follow this step.
Note: You can manually enter the information about the projects of interest to the database and skip this step. To this aim, go to step 6 and run the tool once so that the necessary tables are created into the database. Then enter the necessary data to the
Make a run configuration in Eclipse for running LambdaMiner with the main class
br.ufmg.dcc.labsoft.refactoringanalyzer.operations.GitProjectFinder. You should provide your GitHub user name and password as the program input arguments (space separated). Not that, your user name and password will not be sent, it's just your run configuration for Eclipse saved on your local Eclipse workspace (you can check the class
GitProjectFinderto see what we are doing with your credentials).
In the database, a table named
projectsgitwill be created after this step.
Make a run configuration in Eclipse for running LambdaMiner and detecting lambdas. There are two modes for the tool:
A. Detecting all the lambda expressions in the history of software systems. To do this, run the tool with the with the main class
ca.concordia.lambdas.AnalyzeProjectsForLambda. You should mark the projects that you want to be analyzed in the database by setting the value of the
analyzedcolumn to 0 and the
pendingfor those projects.
B. Detecting only new lambda expressions from the last time that the tool is run. Run the tool with the main class
ca.concordia.lambdas.AnalyzeNewCommitsForLambdasfor this mode. You should select which projects you want to be monitored for lambdas, by setting the value of the
monitoring_enabledcolumn to 1 for those projects.
In both cases, the program should be run with one argument, which is the path to which the repositories will be cloned.
ACKNOWLEDGEMENT: We used the existing data-access logic in RefactoringMiner which was developed by Danilo Silva.
The following tables are created in the database when running LambdaMiner:
||Info about the projects under analysis|
||Info about each revision of each analyzed project|
||Info about each lambda expression found in each revision|
||Info about each parameter for each lambda expression|
We used a dump of the database created after running the tool to generate CSV files and fulfill the analysis in R.