| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
|
|
|
|
|
|
MigrationBench provides an automated and robust framework for evaluating code migration success.
The name MigrationBench is used for both the dataset and the evaluation framework for code migration success:
The evaluation is an approximation for functional equivalence by checking the following:
JavaMigration is a separate Github package to conduct code migration with LLMs as a baseline solution, and it relies on the current package for the final evaluation.
There are three datasets in 🤗 MigrationBench:
| Index | Dataset | Size | Notes |
|---|---|---|---|
| 1 | 🤗 AmazonScience/migration-bench-java-full | 5,102 | Each repo has a test directory or at least one test case |
| 2 | 🤗 AmazonScience/migration-bench-java-selected | 300 | A subset of 🤗 migration-bench-java-full |
| 3 | 🤗 AmazonScience/migration-bench-java-utg | 4,814 | The unit test generation (utg) dataset, disjoint with 🤗 migration-bench-java-full |
MigrationBench supports two evaluation modes:
Docker mode provides a consistent evaluation environment without requiring local Java/Maven installation. Each evaluation runs in an isolated container, making it ideal for batch processing and reproducible results.
Benefits:
1. Install Docker:
Follow the official Docker installation guide:
2. Verify Docker:
docker --version3. Install MigrationBench:
git clone https://github.com/amazon-science/MigrationBench.git
cd MigrationBench
pip install -r requirements.txt -e .That's it! The Docker image will be built automatically on first run.
To run a single repository evaluation in Docker:
GITHUB_URL=https://github.com/0xShamil/java-xid
GIT_DIFF_FILE=/path/to/java-xid.diff
python run_eval.py --github_url $GITHUB_URL --git_diff_filename $GIT_DIFF_FILE --use_dockerEvaluate with a migrated repository directory:
MIGRATED_DIR=/path/to/migrated/repo
python run_eval.py --github_url $GITHUB_URL --migrated_root_dir $MIGRATED_DIR --use_dockerForce rebuild the Docker image:
python run_eval.py --github_url $GITHUB_URL --git_diff_filename $GIT_DIFF_FILE --use_docker --build_docker_imageTo run batch evaluations in Docker:
PREDICTIONS=predictions.json
# Run batch evaluation in Docker
python run_eval.py --predictions_filename $PREDICTIONS --use_dockerWith parallel processing (recommended for large batches):
# Run 8 Docker containers in parallel (each evaluates one repo)
python run_eval.py --predictions_filename $PREDICTIONS --use_docker --max_workers 8Important Notes:
Local mode runs evaluations directly on your machine. This requires Java 17 and Maven 3.9.6 installed locally.
Install Java 17:
# Install OpenJDK 17 sudo apt update sudo apt install -y openjdk-17-jdk # Verify installation java --version
Install Maven 3.9.6:
# Download and install Maven curl -O https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip unzip apache-maven-3.9.6-bin.zip sudo mv apache-maven-3.9.6 /opt/ # Create symlinks sudo ln -s /opt/apache-maven-3.9.6 /opt/maven # for MAVEN_HOME sudo ln -s /opt/apache-maven-3.9.6/bin/mvn /usr/local/bin/mvn # so mvn works without PATH setup # Clean up rm apache-maven-3.9.6-bin.zip # Verify installation mvn --version
Verify installations:
java -version # Should show version 17
mvn -version # Should show version 3.9.6git clone https://github.com/amazon-science/MigrationBench.git
cd MigrationBench
pip install -r requirements.txt -e .GITHUB_URL=https://github.com/0xShamil/java-xid
GIT_DIFF_FILE=/path/to/java-xid.diff
python run_eval.py --github_url $GITHUB_URL --git_diff_filename $GIT_DIFF_FILEPREDICTIONS=predictions.json
# Sequential processing
python run_eval.py --predictions_filename $PREDICTIONS
# Parallel processing (8 workers)
python run_eval.py --predictions_filename $PREDICTIONS --max_workers 8For batch evaluation (both Docker and Local modes), provide a predictions file in JSON format.
For each repository, specify the GitHub URL and one of the following:
Example predictions.json:
[
{
"github_url": "https://github.com/0xShamil/java-xid",
"git_diff_file": "/absolute/path/to/java-xid.diff"
},
]or
[
{
"github_url": "https://github.com/0xShamil/java-xid",
"git_diff": "diff --git a/pom.xml b/pom.xml\n--- a/pom.xml\n+++ b/pom.xml\n..."
},
]or
[
{
"github_url": "https://github.com/0xShamil/java-xid",
"migrated_root_dir": "/absolute/path/to/migrated/java-xid"
},
]@misc{liu2025migrationbenchrepositorylevelcodemigration,
title={MigrationBench: Repository-Level Code Migration Benchmark from Java 8},
author={Linbo Liu and Xinle Liu and Qiang Zhou and Lin Chen and Yihan Liu and Hoan Nguyen and Behrooz Omidvar-Tehrani and Xi Shen and Jun Huan and Omer Tripp and Anoop Deoras},
year={2025},
eprint={2505.09569},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2505.09569},
}| Back | FazBrowse Home | New Git URL |