Files changed (1) hide show
  1. README.md +247 -252
README.md CHANGED
@@ -1,252 +1,247 @@
1
-
2
- <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="https://github.com/scarfbench/site/blob/main/public/assets/images/scarf-dark.png">
4
- <source media="(prefers-color-scheme: light)" srcset="https://github.com/scarfbench/site/blob/main/public/assets/images/scarf-light.png">
5
- <img alt="Logo">
6
- </picture>
7
-
8
- <div align="center">
9
- <a href="https://scarfbench.github.io/site"><img src="https://img.shields.io/badge/site-scarfbench.info-blue?style=for-the-badge" alt="Documentation"></a>
10
- <a href="https://scarfbench.github.io/site/leaderboard/"><img src="https://img.shields.io/badge/leaderboard-view%20results-orange?style=for-the-badge" alt="Leaderboard"></a>
11
- </div>
12
-
13
- **Scarf** (short for **S**elf-**C**ontained **A**pplication **R**efactoring) benchmark is a suite of Java applications across frameworks: Jakarta EE, Quarkus, and Spring for evaluating agentic transformation between the frameworks. This suite enables systematic assessment of AI agents' ability to migrate enterprise Java applications while preserving functionality, idiomatic patterns, and architectural integrity across different runtime environments.
14
-
15
- The benchmark includes comprehensive examples ranging from focused layer-specific demonstrations to complete production-grade applications, each with verified implementations across all supported frameworks.
16
-
17
- > **Note:** All applications in this benchmark have been meticulously converted and verified by experienced developers. Each implementation has undergone rigorous testing to ensure functional correctness, adherence to framework-specific idioms, and preservation of architectural integrity across Jakarta EE, Quarkus, and Spring frameworks.
18
-
19
- ---
20
-
21
- ## Table of Contents
22
-
23
- - [Quickstart Guide](#quickstart-guide)
24
- - [Benchmark Applications](#benchmark-applications)
25
- - [Focused Examples](#focused-examples)
26
- - [Whole Applications](#whole-applications)
27
- - [Roadmap](#roadmap)
28
- - [Contact](#contact)
29
-
30
- ---
31
-
32
- ## Quickstart Guide
33
-
34
- This benchmark suite comes with most things needed to run the benchmark applications. Everything is already set up!
35
-
36
- ### What's Included
37
-
38
- Each application comes with:
39
-
40
- - **Dockerfile** - Pre-configured container with all dependencies installed
41
- - **Makefile** - Simple commands to build and run everything
42
- - **smoke.py or smoke/** - Automated tests to verify the application works
43
-
44
- You don't need to install Maven, Java, or any dependencies. Docker handles it all!
45
-
46
- ### Prerequisites
47
-
48
- You only need:
49
-
50
- - Docker installed on your machine
51
- - make command runner (you can install it via Cargo or your package manager)
52
-
53
- ### Running an Application
54
-
55
- #### Step 1: Pick an Application
56
-
57
- Browse the directory structure and choose any application. For example:
58
-
59
- ```
60
- business_domain/counter/spring/
61
- dependency_injection/encoder/jakarta/
62
- presentation/mood/quarkus/
63
- ```
64
-
65
- #### Step 2: Navigate to the Application
66
-
67
- ```bash
68
- cd business_domain/counter/spring
69
- ```
70
-
71
- #### Step 3: Run It!
72
-
73
- ```bash
74
- make up
75
- ```
76
-
77
- That's it! The `make up` command will:
78
- 1. Build your application
79
- 2. Build the Docker container
80
- 3. Start everything up
81
-
82
- #### Step 4: Check the Logs
83
-
84
- ```bash
85
- make logs
86
- ```
87
-
88
- #### Step 5: Stop When Done
89
-
90
- ```bash
91
- make down
92
- ```
93
-
94
- ### Common Commands
95
-
96
- Every application supports these commands (via the `Makefile`):
97
-
98
- | Command | What it does |
99
- |--------------|------------------------------------|
100
- | `make help` | Shows all available commands |
101
- | `make up` | Builds and starts the application |
102
- | `make logs` | Shows application logs |
103
- | `make test` | Runs everything and the smoke tests|
104
- | `make clean` | Removes build artifacts |
105
-
106
- ### Running Smoke Tests
107
-
108
- Most applications include automated tests. To run, just use `make test`:
109
-
110
- ```bash
111
- make test
112
- ```
113
-
114
- ### Framework Variations
115
-
116
- Each application type comes in three flavors:
117
-
118
- - **jakarta/** - Jakarta EE (enterprise Java)
119
- - **quarkus/** - Quarkus (cloud-native Java)
120
- - **spring/** - Spring Boot (popular Java framework)
121
-
122
- Pick whichever framework you want to test!
123
-
124
- ### Troubleshooting
125
-
126
- **Port already in use?**
127
- ```bash
128
- make rebuild
129
- ```
130
-
131
- **Want to rebuild from scratch?**
132
- ```bash
133
- make clean
134
- make rebuild
135
- make up
136
- ```
137
-
138
- **Need to see what's happening?**
139
- ```bash
140
- make logs
141
- ```
142
-
143
- ---
144
-
145
- ## Benchmark Applications
146
-
147
- This benchmark contains self-contained applications demonstrating core Java EE functionalities and their framework-specific implementations. Each example has been manually converted and verified across all target frameworks, with smoke tests included to verify application behavior after transformation.
148
-
149
- The benchmark includes two types of examples:
150
-
151
- ### Focused Examples
152
-
153
- Application examples organized per layer, where each example demonstrates a specific technology within that layer (e.g., persistence, presentation, integration).
154
-
155
- #### Business Domain Layer
156
-
157
- Core business logic implementations using Enterprise JavaBeans (EJBs). Demonstrates stateful, stateless, and singleton session beans for shopping carts, currency conversion, hit counters, web services, and standalone EJB usage.
158
-
159
- **Examples:**
160
- - **cart** - Stateful session bean with shopping cart lifecycle management and `@Remove` methods
161
- - **converter** - Stateless session bean demonstrating currency conversion business logic
162
- - **counter** - Singleton session bean with shared state for tracking web page hits
163
- - **helloservice** - JAX-WS web service implemented as a stateless session bean
164
- - **standalone** - Stateless session bean for standalone EJB container usage
165
-
166
- #### Dependency Injection Layer
167
-
168
- CDI and dependency injection patterns including custom qualifiers, interceptors, decorators, producer methods, event observers, and alternative implementations for conditional bean selection.
169
-
170
- #### Infrastructure Layer
171
-
172
- Enterprise features including managed executors for concurrency, asynchronous EJB methods, interceptors for cross-cutting concerns, and timer services for scheduled task execution.
173
-
174
- #### Integration Layer
175
-
176
- Integration technologies featuring Jakarta Batch processing, JMS messaging patterns, message-driven beans, JAX-WS web services, and Java Connector Architecture for enterprise system integration.
177
-
178
- #### Persistence Layer
179
-
180
- Data persistence patterns using JPA entities with CRUD operations, complex entity relationships, composite keys, inheritance strategies, and JPQL queries for database interactions.
181
-
182
- #### Presentation Layer
183
-
184
- Web tier implementations including servlets, JAX-RS REST APIs, WebSocket endpoints, server-sent events, file uploads, filters, listeners, and real-time communication patterns.
185
-
186
- #### Security Layer
187
-
188
- Authentication and authorization patterns featuring Jakarta Security identity stores, form-based and basic authentication, EJB security, role-based access control, and password hashing.
189
-
190
- ---
191
-
192
- ### Whole Applications
193
-
194
- Complete, functioning applications that demonstrate the coordination and interaction between multiple layers.
195
-
196
- #### CargoTracker
197
-
198
- Domain-Driven Design cargo shipping tracker with Jakarta Faces, CDI, Enterprise Beans, JPA, REST, Batch, and JMS. Showcases aggregates, repositories, and domain events following Eric Evans' DDD patterns.
199
-
200
- Demonstrates Jakarta Faces, CDI, Enterprise Beans, JPA, REST, Batch, JSON Binding, Bean Validation, and JMS. Showcases end-to-end application architecture with multiple interfaces (web UI, REST API, file scanning) and complex domain modeling including aggregates, repositories, and domain events. Implements the cargo tracking example from Eric Evans' DDD book.
201
-
202
- #### Coffee Shop
203
-
204
- Event-driven microservices with Orders, Barista, and Kitchen services via Kafka. Demonstrates MicroProfile stack, reactive messaging, distributed transactions, and eventual consistency.
205
-
206
- Microservices architecture with Orders, Barista, and Kitchen services communicating via Apache Kafka. Demonstrates MicroProfile (Config, Health, OpenAPI, Metrics), JPA with PostgreSQL, JAX-RS REST APIs, reactive messaging patterns, and distributed transaction coordination. Shows event-driven architecture with asynchronous inter-service communication and eventual consistency.
207
-
208
- #### DayTrader
209
-
210
- High-performance stock trading benchmark with stateless session beans, JPA optimistic locking, transaction management, and connection pooling. Used for measuring server performance.
211
-
212
- Online stock trading benchmark application demonstrating real-world Java EE workload patterns. Implements user authentication, portfolio management, stock quote lookup, and buy/sell transactions. Showcases performance-oriented design with stateless session beans, JPA entities with optimistic locking, transaction management, connection pooling, and web service interfaces.
213
-
214
- #### PetClinic
215
-
216
- Veterinary clinic management with Jakarta Faces (PrimeFaces), complex JPA relationships, CDI, and Bean Validation. Complete workflows for owners, pets, visits, and veterinarians.
217
-
218
- Full-featured veterinary clinic management system using Jakarta Faces (PrimeFaces) for the UI layer. Demonstrates CRUD operations with JPA entities showing one-to-many, many-to-one, and many-to-many relationships (owners-pets, pets-visits, vets-specialties). Includes CDI beans, Bean Validation, JSF navigation, complex forms, and master-detail views.
219
-
220
- #### RealWorld
221
-
222
- Medium.com clone with MicroProfile JWT, JAX-RS REST API, article management, comments, favorites, tags, and user following. Includes Testcontainers integration tests.
223
-
224
- Medium.com clone (Conduit) implementing the RealWorld specification with full CRUD operations, JWT authentication, article management, comments, favorites, tags, and user following. Demonstrates MicroProfile JWT, JAX-RS REST API design, JPA with PostgreSQL, password hashing (BCrypt), slug generation, pagination, filtering, and comprehensive exception handling. Includes integration tests with Testcontainers and MicroShed testing framework.
225
-
226
- ---
227
-
228
- ## Contact
229
-
230
- For any questions, feedback, or suggestions, or to submit your own agent results for the leaderboard, please contact the authors:
231
-
232
- | Name | Email |
233
- | -------------- | ---------------------------------------- |
234
- | Rahul Krishna | [i.m.ralk@gmail.com](mailto:imralk+oss@gmail.com) |
235
- | Bridget McGinn | [bridget.mcginn@ibm.com](bridget.mcginn@ibm.com) |
236
- | Raju Pavuluri | [pavuluri@us.ibm.com](mailto:pavuluri@us.ibm.com) |
237
-
238
- ---
239
-
240
- ## Citation
241
-
242
- If you use this benchmark in your research, please cite our paper:
243
-
244
- ```bibtex
245
- [Placeholder: BibTeX citation will be added when paper is published]
246
- ```
247
-
248
- ---
249
-
250
- ## License
251
-
252
- Apache-2.0
 
1
+ ![](https://github.com/scarfbench/site/blob/main/public/assets/images/scarf-light.png?raw=true)
2
+
3
+ <div align="center">
4
+ <a href="https://scarfbench.github.io/site"><img src="https://img.shields.io/badge/site-scarfbench.info-blue?style=for-the-badge" alt="Documentation"></a>
5
+ <a href="https://scarfbench.github.io/site/leaderboard/"><img src="https://img.shields.io/badge/leaderboard-view%20results-orange?style=for-the-badge" alt="Leaderboard"></a>
6
+ </div>
7
+
8
+ **Scarf** (short for **S**elf-**C**ontained **A**pplication **R**efactoring) benchmark is a suite of Java applications across frameworks: Jakarta EE, Quarkus, and Spring for evaluating agentic transformation between the frameworks. This suite enables systematic assessment of AI agents' ability to migrate enterprise Java applications while preserving functionality, idiomatic patterns, and architectural integrity across different runtime environments.
9
+
10
+ The benchmark includes comprehensive examples ranging from focused layer-specific demonstrations to complete production-grade applications, each with verified implementations across all supported frameworks.
11
+
12
+ > **Note:** All applications in this benchmark have been meticulously converted and verified by experienced developers. Each implementation has undergone rigorous testing to ensure functional correctness, adherence to framework-specific idioms, and preservation of architectural integrity across Jakarta EE, Quarkus, and Spring frameworks.
13
+
14
+ ---
15
+
16
+ ## Table of Contents
17
+
18
+ - [Quickstart Guide](#quickstart-guide)
19
+ - [Benchmark Applications](#benchmark-applications)
20
+ - [Focused Examples](#focused-examples)
21
+ - [Whole Applications](#whole-applications)
22
+ - [Roadmap](#roadmap)
23
+ - [Contact](#contact)
24
+
25
+ ---
26
+
27
+ ## Quickstart Guide
28
+
29
+ This benchmark suite comes with most things needed to run the benchmark applications. Everything is already set up!
30
+
31
+ ### What's Included
32
+
33
+ Each application comes with:
34
+
35
+ - **Dockerfile** - Pre-configured container with all dependencies installed
36
+ - **Makefile** - Simple commands to build and run everything
37
+ - **smoke.py or smoke/** - Automated tests to verify the application works
38
+
39
+ You don't need to install Maven, Java, or any dependencies. Docker handles it all!
40
+
41
+ ### Prerequisites
42
+
43
+ You only need:
44
+
45
+ - Docker installed on your machine
46
+ - make command runner (you can install it via Cargo or your package manager)
47
+
48
+ ### Running an Application
49
+
50
+ #### Step 1: Pick an Application
51
+
52
+ Browse the directory structure and choose any application. For example:
53
+
54
+ ```
55
+ business_domain/counter/spring/
56
+ dependency_injection/encoder/jakarta/
57
+ presentation/mood/quarkus/
58
+ ```
59
+
60
+ #### Step 2: Navigate to the Application
61
+
62
+ ```bash
63
+ cd business_domain/counter/spring
64
+ ```
65
+
66
+ #### Step 3: Run It!
67
+
68
+ ```bash
69
+ make up
70
+ ```
71
+
72
+ That's it! The `make up` command will:
73
+ 1. Build your application
74
+ 2. Build the Docker container
75
+ 3. Start everything up
76
+
77
+ #### Step 4: Check the Logs
78
+
79
+ ```bash
80
+ make logs
81
+ ```
82
+
83
+ #### Step 5: Stop When Done
84
+
85
+ ```bash
86
+ make down
87
+ ```
88
+
89
+ ### Common Commands
90
+
91
+ Every application supports these commands (via the `Makefile`):
92
+
93
+ | Command | What it does |
94
+ |--------------|------------------------------------|
95
+ | `make help` | Shows all available commands |
96
+ | `make up` | Builds and starts the application |
97
+ | `make logs` | Shows application logs |
98
+ | `make test` | Runs everything and the smoke tests|
99
+ | `make clean` | Removes build artifacts |
100
+
101
+ ### Running Smoke Tests
102
+
103
+ Most applications include automated tests. To run, just use `make test`:
104
+
105
+ ```bash
106
+ make test
107
+ ```
108
+
109
+ ### Framework Variations
110
+
111
+ Each application type comes in three flavors:
112
+
113
+ - **jakarta/** - Jakarta EE (enterprise Java)
114
+ - **quarkus/** - Quarkus (cloud-native Java)
115
+ - **spring/** - Spring Boot (popular Java framework)
116
+
117
+ Pick whichever framework you want to test!
118
+
119
+ ### Troubleshooting
120
+
121
+ **Port already in use?**
122
+ ```bash
123
+ make rebuild
124
+ ```
125
+
126
+ **Want to rebuild from scratch?**
127
+ ```bash
128
+ make clean
129
+ make rebuild
130
+ make up
131
+ ```
132
+
133
+ **Need to see what's happening?**
134
+ ```bash
135
+ make logs
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Benchmark Applications
141
+
142
+ This benchmark contains self-contained applications demonstrating core Java EE functionalities and their framework-specific implementations. Each example has been manually converted and verified across all target frameworks, with smoke tests included to verify application behavior after transformation.
143
+
144
+ The benchmark includes two types of examples:
145
+
146
+ ### Focused Examples
147
+
148
+ Application examples organized per layer, where each example demonstrates a specific technology within that layer (e.g., persistence, presentation, integration).
149
+
150
+ #### Business Domain Layer
151
+
152
+ Core business logic implementations using Enterprise JavaBeans (EJBs). Demonstrates stateful, stateless, and singleton session beans for shopping carts, currency conversion, hit counters, web services, and standalone EJB usage.
153
+
154
+ **Examples:**
155
+ - **cart** - Stateful session bean with shopping cart lifecycle management and `@Remove` methods
156
+ - **converter** - Stateless session bean demonstrating currency conversion business logic
157
+ - **counter** - Singleton session bean with shared state for tracking web page hits
158
+ - **helloservice** - JAX-WS web service implemented as a stateless session bean
159
+ - **standalone** - Stateless session bean for standalone EJB container usage
160
+
161
+ #### Dependency Injection Layer
162
+
163
+ CDI and dependency injection patterns including custom qualifiers, interceptors, decorators, producer methods, event observers, and alternative implementations for conditional bean selection.
164
+
165
+ #### Infrastructure Layer
166
+
167
+ Enterprise features including managed executors for concurrency, asynchronous EJB methods, interceptors for cross-cutting concerns, and timer services for scheduled task execution.
168
+
169
+ #### Integration Layer
170
+
171
+ Integration technologies featuring Jakarta Batch processing, JMS messaging patterns, message-driven beans, JAX-WS web services, and Java Connector Architecture for enterprise system integration.
172
+
173
+ #### Persistence Layer
174
+
175
+ Data persistence patterns using JPA entities with CRUD operations, complex entity relationships, composite keys, inheritance strategies, and JPQL queries for database interactions.
176
+
177
+ #### Presentation Layer
178
+
179
+ Web tier implementations including servlets, JAX-RS REST APIs, WebSocket endpoints, server-sent events, file uploads, filters, listeners, and real-time communication patterns.
180
+
181
+ #### Security Layer
182
+
183
+ Authentication and authorization patterns featuring Jakarta Security identity stores, form-based and basic authentication, EJB security, role-based access control, and password hashing.
184
+
185
+ ---
186
+
187
+ ### Whole Applications
188
+
189
+ Complete, functioning applications that demonstrate the coordination and interaction between multiple layers.
190
+
191
+ #### CargoTracker
192
+
193
+ Domain-Driven Design cargo shipping tracker with Jakarta Faces, CDI, Enterprise Beans, JPA, REST, Batch, and JMS. Showcases aggregates, repositories, and domain events following Eric Evans' DDD patterns.
194
+
195
+ Demonstrates Jakarta Faces, CDI, Enterprise Beans, JPA, REST, Batch, JSON Binding, Bean Validation, and JMS. Showcases end-to-end application architecture with multiple interfaces (web UI, REST API, file scanning) and complex domain modeling including aggregates, repositories, and domain events. Implements the cargo tracking example from Eric Evans' DDD book.
196
+
197
+ #### Coffee Shop
198
+
199
+ Event-driven microservices with Orders, Barista, and Kitchen services via Kafka. Demonstrates MicroProfile stack, reactive messaging, distributed transactions, and eventual consistency.
200
+
201
+ Microservices architecture with Orders, Barista, and Kitchen services communicating via Apache Kafka. Demonstrates MicroProfile (Config, Health, OpenAPI, Metrics), JPA with PostgreSQL, JAX-RS REST APIs, reactive messaging patterns, and distributed transaction coordination. Shows event-driven architecture with asynchronous inter-service communication and eventual consistency.
202
+
203
+ #### DayTrader
204
+
205
+ High-performance stock trading benchmark with stateless session beans, JPA optimistic locking, transaction management, and connection pooling. Used for measuring server performance.
206
+
207
+ Online stock trading benchmark application demonstrating real-world Java EE workload patterns. Implements user authentication, portfolio management, stock quote lookup, and buy/sell transactions. Showcases performance-oriented design with stateless session beans, JPA entities with optimistic locking, transaction management, connection pooling, and web service interfaces.
208
+
209
+ #### PetClinic
210
+
211
+ Veterinary clinic management with Jakarta Faces (PrimeFaces), complex JPA relationships, CDI, and Bean Validation. Complete workflows for owners, pets, visits, and veterinarians.
212
+
213
+ Full-featured veterinary clinic management system using Jakarta Faces (PrimeFaces) for the UI layer. Demonstrates CRUD operations with JPA entities showing one-to-many, many-to-one, and many-to-many relationships (owners-pets, pets-visits, vets-specialties). Includes CDI beans, Bean Validation, JSF navigation, complex forms, and master-detail views.
214
+
215
+ #### RealWorld
216
+
217
+ Medium.com clone with MicroProfile JWT, JAX-RS REST API, article management, comments, favorites, tags, and user following. Includes Testcontainers integration tests.
218
+
219
+ Medium.com clone (Conduit) implementing the RealWorld specification with full CRUD operations, JWT authentication, article management, comments, favorites, tags, and user following. Demonstrates MicroProfile JWT, JAX-RS REST API design, JPA with PostgreSQL, password hashing (BCrypt), slug generation, pagination, filtering, and comprehensive exception handling. Includes integration tests with Testcontainers and MicroShed testing framework.
220
+
221
+ ---
222
+
223
+ ## Contact
224
+
225
+ For any questions, feedback, or suggestions, or to submit your own agent results for the leaderboard, please contact the authors:
226
+
227
+ | Name | Email |
228
+ | -------------- | ---------------------------------------- |
229
+ | Rahul Krishna | [i.m.ralk@gmail.com](mailto:imralk+oss@gmail.com) |
230
+ | Bridget McGinn | [bridget.mcginn@ibm.com](bridget.mcginn@ibm.com) |
231
+ | Raju Pavuluri | [pavuluri@us.ibm.com](mailto:pavuluri@us.ibm.com) |
232
+
233
+ ---
234
+
235
+ ## Citation
236
+
237
+ If you use this benchmark in your research, please cite our paper:
238
+
239
+ ```bibtex
240
+ [Placeholder: BibTeX citation will be added when paper is published]
241
+ ```
242
+
243
+ ---
244
+
245
+ ## License
246
+
247
+ Apache-2.0