Skip to main content

Find test coverage mapping

io.moderne.prethink.FindTestCoverage

Map test methods to their corresponding implementation methods. Uses JavaType.Method matching to determine coverage relationships. Optionally generates AI summaries of what each test is verifying when LLM provider is configured.

Recipe source

GitHub: FindTestCoverage.java, Issue Tracker, Maven Central

This recipe is available under the Moderne Source Available License.

Options

TypeNameDescriptionExample
StringproviderOptional. LLM provider for generating test summaries: openai, gemini, or poolside.poolside
StringapiKeyOptional. API key for the LLM provider.sk-...
StringmodelOptional. Model name to use for generating test summaries.malibu
StringbaseUrlOptional. Custom base URL for the LLM provider.https://divers.poolsi.de/openai/v1/
IntegerrequestsPerMinuteOptional. Rate limit for LLM requests.60

Used by

This recipe is used as part of the following composite recipes:

Usage

This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-prethink in your build file or by running a shell command (in which case no build changes are needed):

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}

rewrite {
activeRecipe("io.moderne.prethink.FindTestCoverage")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

dependencies {
rewrite("org.openrewrite.recipe:rewrite-prethink:{{VERSION_ORG_OPENREWRITE_RECIPE_REWRITE_PRETHINK}}")
}
  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Test mapping

io.moderne.prethink.table.TestMapping

Mapping of test methods to the implementation methods they test.

Column NameDescription
Test source pathThe path to the test source file.
Test classThe fully qualified name of the test class.
Test methodThe signature of the test method.
Implementation source pathThe path to the implementation source file being tested.
Implementation classThe fully qualified name of the implementation class being tested.
Implementation methodThe signature of the implementation method being tested.
Test summaryAI-generated summary of what the test is verifying.
Test checksumHash of the test method code for cache invalidation.