IntentTester is the prototype implementation of our ongoing research on intent-driven multi-agent test migration.
This project introduces a multi-agent framework that enables automated migration of unit tests across libraries and programming languages. By modeling test intent and leveraging repository graphs, IntentTester improves:
- Syntactic correctness of migrated tests.
- Execution success across different ecosystems.
- Defect discovery in real-world software libraries.
- Python 3.9+
- Java JDK 11+
- Neo4j (for repository graph construction)
python -m venv venv
pip install -r requirements.txt
You need to specify parameter configurations in the task.properties file.
This file is located under the src/main/resources
# Domain of the experiment (e.g., html, json, time)
domain=html
# Path to the source repository (recommended: place under the project "input" directory)
sourceRepoFilepath=demo/jsoup-master
# Programming language of the source repository
# Currently supported: Java, Python (JavaScript support is under development — stay tuned!)
sourceRepoLanguage=Java
# Path to the target repository (recommended: place under the project "input" directory)
targetRepoFilepath=demo/jfiveparse-master
# Programming language of the target repository
targetRepoLanguage=Java
# LLM service configuration
# For data security, you may also set the API key via environment variables
apiKey=
modelName=💡 The default common.LLMService is a basic LLM service. You can replace it with any other LLM provider as needed.
| Directory / Module | Description |
|---|---|
| assets/ | Icons, figures, and images for documentation and paper presentation. |
| datasets/ | Experimental datasets used in our evaluation. |
| python/ | Auxiliary scripts (graph construction, repository search, etc.). |
| src/Orchestrator/ | Orchestrator for coordinating interactions among multiple agents. |
| src/antlr/ | Grammar parsers for Java, Python, and other supported languages. |
| src/entity/ | Defines entities such as repository graph, context bundles, test intents. |
| src/utils/ | General-purpose utilities (logging, file I/O, etc.). |
| src/common/ | LLM integration layer, prompt templates, task parameter configuration. |
| src/framework/ | Core multi-agent framework (agent definitions, orchestration, execution). |
| └── preprocessing/ | Builds repository graphs for the target project. |
| └── service/ | Agent service toolkit: test extraction, TDL parsing, intermediate results. |
| resources/ | Project configuration files (e.g., task.properties). |
We provide scripts to reproduce the experiments from the paper:
RQ1: Migration correctness evaluation
RQ2: Execution success rate
RQ3: Defect discovery analysis
RQ4: Ablation study of multi-agent components
The complete dataset is available in the datasets directory, containing the source code for all projects used in the paper.
| Source | Target |
|---|---|
| gson | nanojson |
| gson | simplejson |
| simplejson | gson |
| simplejson | nanojson |
| nanojson | gson |
| nanojson | simplejson |
| Source | Target |
|---|---|
| jfiveparse | domonic |
| jfiveparse | jsoup |
| domonic | jfiveparse |
| domonic | jsoup |
| jsoup | domonic |
| jsoup | jfiveparse |
| Source | Target |
|---|---|
| maya | threetenbp |
| maya | time4j |
| threetenbp | maya |
| threetenbp | time4j |
| time4j | maya |
| time4j | threetenbp |
- The
demo/directory contains a toy example of intent-based test migration. - The
results/directory provides all experimental data reported in the paper.
The figure below shows the distribution of execution outcomes for migrated intent tests across different repositories,
highlighting the proportion of successful and failed runs.
Reconstruction quality from TDL:
histogram (left) and ECDF (right) of AST Jaccard similarity, evidencing high fidelity; lower scores mainly reflect LLM refinements rather than semantic loss.
This section describes how to run IntentTester for cross-library test migration.
The process involves two main stages: repository graph construction and intent-based test migration.
Run the framework/preprocessing/RepoGraphConstruction class.
This step builds a repository graph for the target project, which is essential for enabling intent-driven test migration.
- The graph encodes entities such as APIs, methods, classes, and dependencies, along with their relations.
- It provides the structural context needed by downstream agents to align and migrate tests.
- Graph construction can be time-consuming depending on repository size.
- However, this step only needs to be performed once per target project.
Run the Main class. The migration is powered by the multi-agent orchestrator, which coordinates multiple specialized agents:
-
IntentAbstractorAgent
Extracts tests from the source repository and abstracts them into test intents. -
IntentAlignmentAgent
Aligns test intents with the target repository by constructing a context bundle using the repository graph. -
PlanningAgent
Decides whether a test should be migrated, based on semantic compatibility and context alignment. -
TestMigrationAgent
Performs the actual migration, generating executable test cases for the target repository. -
VerificationAgent
Applies refinement mechanisms to check correctness, filter invalid outputs, and ensure execution validity.
📌 Tips
Ensure the
task.propertiesfile is configured correctly before running.
For large repositories, consider allocating more memory to the JVM.
‼️ We are continuously improving the documentation and adding new features. Please stay tuned for updates.


