Android Generate All Tests
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Bring one Gradle module’s JVM unit test coverage up to a minimum bar — 80% line coverage — in one pass: find every class with no test class at all, or with measured coverage below the bar, then write or extend tests for each until it clears it. Kotlin/Android/Gradle only; it never runs against, or falls back to, any other language or build tool.
Purpose
iru-android-generate-all-tests answers "bring this whole module’s test coverage up to a bar" rather than
"write tests for this one class/task," which is what iru-android-code-one-task and the iru-code pipeline
already handle per task. It uses the Explore agent to build an inventory of testable classes and the module’s
existing test convention, delegates to iru-android-coverage for the exact, measured percentage per class
(never an estimate), and only writes or extends JVM unit test code under src/test/java — it does not add
license headers, KDoc, or run a code-quality pass, and it only touches production source code when a class is
genuinely untestable as written (e.g. no seam to substitute a hard dependency), which it reports explicitly
rather than silently redesigning the class. For a module that renders UI it also adds a UI-test step (Step 5b, per the
UI contract in Building user interfaces): Robolectric + Roborazzi tests for
every existing screen and component that has none, capturing each visual state × the .ui-quality.yml directions ×
themes into .ui-screenshots/ through the module’s testing/UiScreenshots.kt helper and running the Accessibility Test
Framework at the configured level. It follows this catalog’s JUnit 4 + MockK + Robolectric conventions,
grounded in the real Android reference repository, when a project has nothing of its own to learn from.
Kotlin Multiplatform projects are out of scope: when the Kotlin Multiplatform plugin is applied anywhere in the build (a KMP app’s Android host module included), the skill stops and hands the request to KMP Generate All Tests instead.
Plugin
Shipped by the iru-android plugin of the ai-catalog marketplace (install with /plugin install iru-android@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
The Gradle module to scope this run to, or a comma-separated list of specific classes (their module is resolved from each one’s file path). |
|
Outputs
-
New or extended JVM unit test files under
<module>/src/test/javafor every class found with no matching test class, or with line coverage below 80% — following this project’s own JUnit 4/JUnit 5, MockK, and Robolectric conventions, including the SDK-branch test-class split convention where the project already uses it. -
Occasionally, a minimal testability change to a class under test (e.g. extracting an interface, injecting a dependency) — only when a class is genuinely untestable as written, and always called out explicitly rather than folded silently into "tests added."
-
A report: total candidate classes found (and any excluded as having no testable logic), how many already met the bar, before/after coverage per class touched, any class still below 80% after two extension attempts (with its exact remaining uncovered lines and, where apparent, why), and the full-suite test result.
-
For a UI module: Robolectric UI tests for every screen/component without one, the
testing/UiScreenshots.kthelper (created when absent), the screenshot count per kind with any malformed names, the accessibility results and level applied (noneis reported "accessibility: opted out",off"accessibility checks off"), and any test-scope dependency ortestOptionschange made to the module’s build. -
No
src/androidTestinstrumented tests, license headers, KDoc, or code-quality fixes — those remain opt-in, oriru-check-license,iru-android-dokka, and `iru-android-code-quality’s jobs respectively (the JVM UI tests are not instrumented tests and are generated by default).
Execution flow
Dependencies
Invokes
-
Android Coverage — Step 3, and again in Step 6 to re-measure after generation: delegated through the
iru-gate-runneragent so its per-class JaCoCo XML/HTML report never lands directly in this conversation, and so the whole suite runs once per batch rather than once per class. -
Android Test — Step 7, once, to confirm the full JVM unit-test suite still passes after every class’s tests have been written or extended; also delegated through
iru-gate-runner. For a UI module it is run once more withui: jvm(Step 5b) to collect screenshot counts, malformed names and accessibility results.
It stops and redirects Kotlin Multiplatform projects to KMP Generate All Tests (a hand-off, not an invocation).
Invoked by
None from inside this catalog — it is a top-level entry point invoked by a person who wants coverage brought up
across one Gradle module in one pass, independent of the /iru-code//iru-issue pipeline (which handles
per-task test-writing via iru-android-code-one-task).
Related agents
-
Explore— Step 2, to build the class/test-file inventory across the module without reading every source file directly. -
iru-gate-runner— Steps 3, 6, and 7, to runiru-android-coverage/iru-android-testand report back only a compact summary instead of a raw coverage/test log. -
general-purpose(default, nosubagent_typenamed) — Step 5, one per class needing new/extended tests (and, in Step 5b, one per screen/component needing UI tests), dispatched concurrently since each only touches its own test file.
Source
SKILL.md on GitHub — the file this page was generated from.