Add files using upload-large-folder tool
Browse files
README.md
CHANGED
|
@@ -21,29 +21,15 @@ pretty_name: Scarf Benchmark
|
|
| 21 |
|
| 22 |
---
|
| 23 |
|
| 24 |
-
**Scarf** (**S**elf-**C**ontained **A**pplication **R**efactoring) is a benchmark suite for evaluating AI agents' ability to migrate enterprise Java applications across
|
| 25 |
|
| 26 |
-
|
|
| 27 |
-
|---|---|
|
| 28 |
-
|
|
| 29 |
-
| Architectural layers | 6 |
|
| 30 |
-
| Frameworks | 3 (Jakarta EE, Quarkus, Spring) |
|
| 31 |
-
| Validation tests | 1,331 |
|
| 32 |
|
| 33 |
-
> All applications have been manually converted and verified by experienced developers
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
## Table of Contents
|
| 38 |
-
|
| 39 |
-
- [Releases](#releases)
|
| 40 |
-
- [Benchmark Structure](#benchmark-structure)
|
| 41 |
-
- [Evaluation & Scoring](#evaluation--scoring)
|
| 42 |
-
- [Quickstart](#quickstart)
|
| 43 |
-
- [Benchmark Applications](#benchmark-applications)
|
| 44 |
-
- [Roadmap](#roadmap)
|
| 45 |
-
- [Citation](#citation)
|
| 46 |
-
- [Contact](#contact)
|
| 47 |
|
| 48 |
---
|
| 49 |
|
|
@@ -57,7 +43,7 @@ pretty_name: Scarf Benchmark
|
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
-
## Benchmark
|
| 61 |
|
| 62 |
### Migration Paths
|
| 63 |
|
|
@@ -68,179 +54,32 @@ pretty_name: Scarf Benchmark
|
|
| 68 |
| Quarkus | Spring |
|
| 69 |
| Spring | Quarkus |
|
| 70 |
|
| 71 |
-
###
|
| 72 |
|
| 73 |
| Layer | Description |
|
| 74 |
|-------|-------------|
|
| 75 |
-
| Business Domain | Stateful, stateless, and singleton EJBs |
|
| 76 |
-
| Dependency Injection | CDI qualifiers, interceptors, decorators,
|
| 77 |
| Infrastructure | Managed executors, async EJBs, timer services |
|
| 78 |
-
|
|
| 79 |
-
|
|
| 80 |
-
|
|
| 81 |
-
|
| 82 |
-
---
|
| 83 |
-
|
| 84 |
-
## Evaluation & Scoring
|
| 85 |
-
|
| 86 |
-
Each migration attempt is scored across three dimensions:
|
| 87 |
-
|
| 88 |
-
| Metric | Description |
|
| 89 |
-
|--------|-------------|
|
| 90 |
-
| **Compilation** | Converted code compiles without errors |
|
| 91 |
-
| **Runtime** | Application starts and serves requests |
|
| 92 |
-
| **Test pass rate** | Smoke tests pass (passed / total) |
|
| 93 |
-
|
| 94 |
-
Evaluation uses **pass@k** — each conversion is attempted multiple times to assess consistency alongside raw correctness.
|
| 95 |
-
|
| 96 |
-
### Running an Evaluation
|
| 97 |
-
|
| 98 |
-
Install the `scarf` CLI (see [installation guide](https://scarfbench.info/installation/)), then:
|
| 99 |
-
|
| 100 |
-
```bash
|
| 101 |
-
scarf eval run \
|
| 102 |
-
--benchmark-dir <path-to-benchmark> \
|
| 103 |
-
--agent-dir <path-to-agent> \
|
| 104 |
-
--source-framework <jakarta|quarkus|spring> \
|
| 105 |
-
--target-framework <jakarta|quarkus|spring> \
|
| 106 |
-
--layer <layer> \
|
| 107 |
-
--app <app-name> \
|
| 108 |
-
--eval-out <output-directory> \
|
| 109 |
-
--pass-at-k <k>
|
| 110 |
-
```
|
| 111 |
-
|
| 112 |
-
Output structure:
|
| 113 |
-
|
| 114 |
-
```
|
| 115 |
-
eval_out/
|
| 116 |
-
├── input/ # source framework code
|
| 117 |
-
├── output/ # agent-converted code
|
| 118 |
-
├── validation/ # agent.err, agent.out, run.log
|
| 119 |
-
└── metadata.json # evaluation metadata
|
| 120 |
-
```
|
| 121 |
-
|
| 122 |
-
Validate converted code with:
|
| 123 |
-
|
| 124 |
-
```bash
|
| 125 |
-
scarf validate --conversions-dir <eval-out> --benchmark-dir <path-to-benchmark>
|
| 126 |
-
```
|
| 127 |
-
|
| 128 |
-
---
|
| 129 |
-
|
| 130 |
-
## Quickstart
|
| 131 |
-
|
| 132 |
-
### Building an Agent
|
| 133 |
-
|
| 134 |
-
Your agent needs two files:
|
| 135 |
-
|
| 136 |
-
**`agent.toml`** — metadata and entrypoint:
|
| 137 |
-
```toml
|
| 138 |
-
name = "my-migration-agent"
|
| 139 |
-
entrypoint = ["run.sh"]
|
| 140 |
-
```
|
| 141 |
-
|
| 142 |
-
**`run.sh`** — the migration logic. The `scarf` CLI sets three environment variables before invoking it:
|
| 143 |
-
|
| 144 |
-
| Variable | Description |
|
| 145 |
-
|----------|-------------|
|
| 146 |
-
| `SCARF_WORK_DIR` | Output directory — all writes must stay here |
|
| 147 |
-
| `SCARF_FRAMEWORK_FROM` | Source framework identifier |
|
| 148 |
-
| `SCARF_FRAMEWORK_TO` | Target framework identifier |
|
| 149 |
-
|
| 150 |
-
Recommended practices:
|
| 151 |
-
- Keep framework-specific logic in skill files (e.g., `skills/spring-to-quarkus/SKILL.md`), not hardcoded prompts
|
| 152 |
-
- Use `run.sh` for orchestration and validation only
|
| 153 |
-
- Print diagnostics to stderr; exit non-zero on failure
|
| 154 |
-
- Never write outside `SCARF_WORK_DIR`
|
| 155 |
-
|
| 156 |
-
### Running a Single Application Locally
|
| 157 |
-
|
| 158 |
-
Each application also ships with Docker and a `Makefile` for standalone use:
|
| 159 |
-
|
| 160 |
-
```bash
|
| 161 |
-
cd business_domain/counter/spring
|
| 162 |
-
make up # build and start
|
| 163 |
-
make test # run smoke tests
|
| 164 |
-
make logs # tail logs
|
| 165 |
-
make down # stop
|
| 166 |
-
```
|
| 167 |
-
|
| 168 |
-
No Java or Maven installation required — Docker handles dependencies.
|
| 169 |
-
|
| 170 |
-
---
|
| 171 |
-
|
| 172 |
-
## Benchmark Applications
|
| 173 |
-
|
| 174 |
-
### Focused Examples
|
| 175 |
-
|
| 176 |
-
Isolated demonstrations of a specific technology per layer. Each example is verified across all supported frameworks.
|
| 177 |
-
|
| 178 |
-
#### Business Domain
|
| 179 |
-
|
| 180 |
-
Core business logic via Enterprise JavaBeans (EJBs):
|
| 181 |
-
|
| 182 |
-
- **cart** — Stateful session bean with shopping cart lifecycle and `@Remove` methods
|
| 183 |
-
- **converter** — Stateless session bean for currency conversion
|
| 184 |
-
- **counter** — Singleton session bean tracking shared web page hit counts
|
| 185 |
-
- **helloservice** — JAX-WS web service as a stateless session bean
|
| 186 |
-
- **standalone** — Stateless session bean for standalone EJB container usage
|
| 187 |
-
|
| 188 |
-
#### Dependency Injection
|
| 189 |
-
|
| 190 |
-
CDI patterns including custom qualifiers, interceptors, decorators, producer methods, event observers, and alternative implementations.
|
| 191 |
-
|
| 192 |
-
#### Infrastructure
|
| 193 |
-
|
| 194 |
-
Managed executors for concurrency, asynchronous EJB methods, interceptors for cross-cutting concerns, and timer services.
|
| 195 |
-
|
| 196 |
-
#### Integration
|
| 197 |
-
|
| 198 |
-
Jakarta Batch, JMS messaging, message-driven beans, JAX-WS web services, and Java Connector Architecture.
|
| 199 |
-
|
| 200 |
-
#### Persistence
|
| 201 |
-
|
| 202 |
-
JPA entities with CRUD operations, complex relationships, composite keys, inheritance strategies, and JPQL queries.
|
| 203 |
-
|
| 204 |
-
#### Presentation
|
| 205 |
-
|
| 206 |
-
Servlets, JAX-RS REST APIs, WebSocket endpoints, server-sent events, file uploads, filters, and listeners.
|
| 207 |
-
|
| 208 |
-
#### Security
|
| 209 |
-
|
| 210 |
-
Jakarta Security identity stores, form-based and basic authentication, EJB security, role-based access control, and password hashing.
|
| 211 |
-
|
| 212 |
-
---
|
| 213 |
|
| 214 |
### Whole Applications
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
Event-driven microservices with Orders, Barista, and Kitchen services via Apache Kafka. Demonstrates MicroProfile (Config, Health, OpenAPI, Metrics), JPA with PostgreSQL, reactive messaging, and eventual consistency.
|
| 225 |
-
|
| 226 |
-
#### DayTrader
|
| 227 |
-
|
| 228 |
-
High-performance stock trading benchmark. Demonstrates stateless session beans, JPA optimistic locking, transaction management, connection pooling, and web service interfaces.
|
| 229 |
-
|
| 230 |
-
#### PetClinic
|
| 231 |
-
|
| 232 |
-
Veterinary clinic management using Jakarta Faces (PrimeFaces). Demonstrates complex JPA relationships (owners-pets, pets-visits, vets-specialties), CDI beans, Bean Validation, and master-detail views.
|
| 233 |
-
|
| 234 |
-
#### RealWorld
|
| 235 |
-
|
| 236 |
-
Medium.com clone (Conduit) implementing the RealWorld specification. Demonstrates MicroProfile JWT, JAX-RS REST API design, JPA with PostgreSQL, BCrypt password hashing, pagination, and Testcontainers integration tests.
|
| 237 |
|
| 238 |
---
|
| 239 |
|
| 240 |
## Citation
|
| 241 |
|
| 242 |
-
If you use this benchmark in your research, please cite:
|
| 243 |
-
|
| 244 |
```bibtex
|
| 245 |
@misc{scarfbench,
|
| 246 |
author = {Krishna, Rahul and McGinn, Bridget and Pavuluri, Raju},
|
|
@@ -254,8 +93,6 @@ If you use this benchmark in your research, please cite:
|
|
| 254 |
|
| 255 |
## Contact
|
| 256 |
|
| 257 |
-
For questions, feedback, or to submit agent results to the leaderboard:
|
| 258 |
-
|
| 259 |
| Name | Email |
|
| 260 |
|----------------|-------|
|
| 261 |
| Rahul Krishna | [imralk+oss@gmail.com](mailto:imralk+oss@gmail.com) |
|
|
|
|
| 21 |
|
| 22 |
---
|
| 23 |
|
| 24 |
+
**Scarf** (**S**elf-**C**ontained **A**pplication **R**efactoring) is a benchmark suite for evaluating AI agents' ability to migrate enterprise Java applications across Jakarta EE, Quarkus, and Spring while preserving functionality, idiomatic patterns, and architectural integrity.
|
| 25 |
|
| 26 |
+
| Applications | Layers | Frameworks | Tests |
|
| 27 |
+
|:---:|:---:|:---:|:---:|
|
| 28 |
+
| 102 | 6 | 3 | 1,331 |
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
> All applications have been manually converted and verified by experienced developers.
|
| 31 |
|
| 32 |
+
**Resources:** [Quickstart](https://scarfbench.info/quickstart/) · [Installation](https://scarfbench.info/installation/) · [Building an Agent](https://scarfbench.info/agent/) · [Leaderboard](https://scarfbench.info/leaderboard/) · [Submit Results](https://scarfbench.info/submit/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
---
|
| 35 |
|
|
|
|
| 43 |
|
| 44 |
---
|
| 45 |
|
| 46 |
+
## Benchmark Applications
|
| 47 |
|
| 48 |
### Migration Paths
|
| 49 |
|
|
|
|
| 54 |
| Quarkus | Spring |
|
| 55 |
| Spring | Quarkus |
|
| 56 |
|
| 57 |
+
### Focused Examples
|
| 58 |
|
| 59 |
| Layer | Description |
|
| 60 |
|-------|-------------|
|
| 61 |
+
| Business Domain | Stateful, stateless, and singleton EJBs (cart, converter, counter, helloservice, standalone) |
|
| 62 |
+
| Dependency Injection | CDI qualifiers, interceptors, decorators, producer methods, event observers |
|
| 63 |
| Infrastructure | Managed executors, async EJBs, timer services |
|
| 64 |
+
| Integration | Jakarta Batch, JMS, message-driven beans, JAX-WS, JCA |
|
| 65 |
+
| Persistence | JPA entities, relationships, composite keys, JPQL queries |
|
| 66 |
+
| Presentation | Servlets, JAX-RS, WebSocket, SSE, file uploads, filters |
|
| 67 |
+
| Security | Identity stores, form/basic auth, EJB security, RBAC, password hashing |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
### Whole Applications
|
| 70 |
|
| 71 |
+
| Application | Description |
|
| 72 |
+
|-------------|-------------|
|
| 73 |
+
| CargoTracker | Domain-Driven Design cargo shipping tracker with Jakarta Faces, CDI, JPA, REST, Batch, and JMS |
|
| 74 |
+
| Coffee Shop | Event-driven microservices (Orders, Barista, Kitchen) via Apache Kafka with MicroProfile |
|
| 75 |
+
| DayTrader | High-performance stock trading benchmark with JPA optimistic locking and transaction management |
|
| 76 |
+
| PetClinic | Veterinary clinic management with Jakarta Faces (PrimeFaces) and complex JPA relationships |
|
| 77 |
+
| RealWorld | Medium.com clone (Conduit) with MicroProfile JWT, JAX-RS, and Testcontainers integration tests |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
---
|
| 80 |
|
| 81 |
## Citation
|
| 82 |
|
|
|
|
|
|
|
| 83 |
```bibtex
|
| 84 |
@misc{scarfbench,
|
| 85 |
author = {Krishna, Rahul and McGinn, Bridget and Pavuluri, Raju},
|
|
|
|
| 93 |
|
| 94 |
## Contact
|
| 95 |
|
|
|
|
|
|
|
| 96 |
| Name | Email |
|
| 97 |
|----------------|-------|
|
| 98 |
| Rahul Krishna | [imralk+oss@gmail.com](mailto:imralk+oss@gmail.com) |
|