Converting hundreds of tests from groovy to java
I recently had the opportunity to convert hundreds of tests from Groovy to Java in the OpenTelemetry Java Instrumentation project. Along the way, I wrote some code to track the progress, and started documenting my learnings.
I have published some of my notes in the notes section of this site for anyone interested in converting some tests on their own. I hope you find them useful!
Now for the nerdy stuff, because I love metrics I decided to write a little code to generate some time series metrics for the progress, and then to also do some analysis.
The code for generating the data can be found here: https://github.com/jaydeluca/repo-metrics
Progress tracking (by file count)
The project involved converting code across dozens of different instrumentation modules, and was being tracking with a markdown checklist in the github issue. I wanted to create a visualization in order to see what had been done and what was left to do. I figured one way to do this would be to go through all the files in the project and count the number of test related groovy files and classes.

After a while, it didn’t feel as useful to include the Java count as the project was growing quickly and all new code was being written in Java. Focusing just on the groovy:

Analyzing remaining modules
I then wanted to break things down by instrumentation module to get a better picture of the distribution of where the remaining groovy code was.

| Key | Value |
|---|---|
| spring | 52 |
| jaxrs | 37 |
| servlet | 23 |
| restlet | 22 |
| couchbase | 18 |
| aws-sdk | 17 |
| ratpack | 16 |
| elasticsearch | 15 |
| play | 15 |
| jaxws | 15 |
| vertx | 14 |
| mongo | 10 |
| jdbc | 8 |
| apache-dubbo-2.7 | 7 |
| jaxrs-client | 5 |
| netty | 5 |
| apache-httpclient | 3 |
| opentelemetry-api | 3 |
| grizzly-2.3 | 3 |
| grails-3.0 | 3 |
| undertow-1.4 | 3 |
| kafka | 3 |
| internal | 2 |
| dropwizard | 2 |
| hibernate | 1 |
| rediscala-1.8 | 1 |
| spymemcached-2.12 | 1 |
| twilio-6.6 | 1 |
Conclusion
Since I joined the groovy battle, we have converted over 250 files, with under 300 remaining at the time of this post. Will we finish by the end of 2024? Only time will tell!
UPDATE
This project was completed on January 28, 2025.