Help us improve
Share bugs, ideas, or general feedback.
From everything-claude-code-mobile
Runs pass@k verification loops on Android unit (JUnit), UI (Espresso), and Compose tests to detect flakiness and ensure reliability before commits, pushes, or releases.
npx claudepluginhub ahmed3elshaer/everything-claude-code-mobile --plugin everything-claude-code-mobileHow this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code-mobile:mobile-verificationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive testing workflow with pass@k metrics for Android development reliability.
Provides Android testing patterns using JUnit5, Mockk, Turbine, and Compose for unit, integration, and UI tests including ViewModel, repository, and screen examples with 80% coverage target.
Guides mobile app testing strategies: unit tests with Jest/XCTest/JUnit, UI automation/integration with Detox/Espresso/Appium, E2E flows. For test setup, device farms, flaky tests.
Expert approach to flaky-test-remediation in test automation. Use when working with .
Share bugs, ideas, or general feedback.
Comprehensive testing workflow with pass@k metrics for Android development reliability.
Single test runs lie.
A test that passes once might fail tomorrow. Verification loops run tests multiple times to reveal:
Pass@k = proportion of test iterations that passed
Pass@3(test) = tests_passed / 3
testLogin(): ✓✓✓ → Pass@3 = 3/3 = 1.0 (100%)
testLogout(): ✓✓✗ → Pass@3 = 2/3 = 0.67 (67%)
testRefresh(): ✗✗✗ → Pass@3 = 0/3 = 0.0 (0%)
Purpose: Fast feedback during development
Usage: /mobile-verify --k=2
Time: ~2 minutes
When: After small changes, before commit
Purpose: Standard confidence level
Usage: /mobile-verify --k=3
Time: ~5 minutes
When: Before push, after feature complete
Purpose: High confidence, flaky detection
Usage: /mobile-verify --k=5
Time: ~10 minutes
When: Before release, after refactor
Purpose: Maximum confidence
Usage: /mobile-verify --k=10
Time: ~20 minutes
When: Production release, critical bugs
Characteristics:
Target Pass@k: ≥ 0.95 (95%)
Common Flaky Causes:
Fix Strategies:
// Bad: Flaky
@Test
fun testLoadData() {
viewModel.loadData()
assert(viewModel.state.value is Loaded)
}
// Good: Stable
@Test
fun testLoadData() = runTest {
viewModel.loadData()
advanceUntilIdle()
assert(viewModel.state.value is Loaded)
}
Characteristics:
Target Pass@k: ≥ 0.80 (80%)
Common Flaky Causes:
Fix Strategies:
// Register idling resources
@IdlingResource
val countingIdlingResource = CountingIdlingResource("api")
// Disable animations
@get:Rule
val disableAnimationsRule = DisableAnimationsRule()
Characteristics:
Target Pass@k: ≥ 0.90 (90%)
Common Flaky Causes:
Fix Strategies:
@Composable
fun TestComposable(content: @Composable () -> Unit) {
CompositionLocalProvider(
LocalInspectionMode provides true
) {
content()
}
}
# 1. Write test
# 2. Quick verify
/mobile-verify --class=NewTest --k=2
# 3. Fix if fails
# 4. Standard verify
/mobile-verify --class=NewTest --k=3
# Verify changed modules only
/mobile-verify --module=$(git diff --name-only | head -1) --k=2
# Full verification
/mobile-verify --k=3
# Thorough verification with flaky detection
/mobile-verify --k=5 --flaky
| Score | Meaning | Action |
|---|---|---|
| 1.0 | Perfect | Celebrate |
| 0.8-0.9 | Excellent | Monitor |
| 0.6-0.7 | Good | Investigate |
| 0.4-0.5 | Fair | Fix needed |
| 0.0-0.3 | Poor | Block release |
Track pass@k over time:
Week 1: Pass@3 = 0.85
Week 2: Pass@3 = 0.87 ↗ Improving
Week 3: Pass@3 = 0.82 ↘ Degraded - investigate!
Week 4: Pass@3 = 0.88 ↗ Recovered
| Pattern | Likely Cause |
|---|---|
| Fails on iteration 1 only | Cold start issue |
| Fails randomly | Async timing |
| Fails on specific iteration | Resource leak |
| Fails in parallel only | Shared state |
/mobile-verify --flaky --k=10
Look for patterns in failures.
@Test
fun flakyTest() = runTest {
val startTime = System.currentTimeMillis()
// ... test code ...
val duration = System.currentTimeMillis() - startTime
Log.d("Test", "Duration: $duration ms") // Check for timing issues
}
Common fixes:
advanceUntilIdle() for coroutinesIdlingResource for network@UiThreadTest for main thread work/mobile-verify --class=FixedTest --k=5
Target: Pass@5 = 1.0
Create checkpoint before verification:
/mobile-checkpoint save pre-verify
/mobile-verify --k=3
Track pass@k in memory:
{
"test-coverage": {
"passAt3": 0.87,
"trend": "improving",
"flakyTests": []
}
}
Learn testing patterns:
{
"id": "test-coroutine-async",
"description": "Always use runTest + advanceUntilIdle for ViewModel tests",
"confidence": 0.95
}
| Context | Pass@k Threshold | Rationale |
|---|---|---|
| Unit tests | 0.95 | Should be deterministic |
| UI tests | 0.80 | More fragile, device-dependent |
| Compose tests | 0.90 | Better than Espresso, more stable |
| Integration tests | 0.70 | Complex, more variables |
| E2E tests | 0.60 | Full system, many variables |
Remember: A test that sometimes passes is worse than no test at all. It gives false confidence.