Skip to content
Sign in

FlakyLens

Finds potential stability risks in Java and Kotlin Android tests: fixed waits, unseeded randomness, current-time assertions, and unbounded waits.

Not scanned yet Editor extension 1 installs

Install in

No install steps yet

Follow the steps on the source page.

Finds potential stability risks in Java and Kotlin Android tests: fixed waits, unseeded randomness, current-time assertions, and unbounded waits. Also identifies empty tests and pure Kotlin TODO placeholders. Results appear in the editor and Inspect Code. Static inspections run locally. An optional AI Completion tool window prepares related context locally and sends it to a configured official or compatible provider only on request, using a user-provided API key. Supports Responses, Chat Completions and native Gemini protocols. API charges may apply. Findings indicate risks, not confirmed flaky tests.

Empty block-bodied tests can be selected through Alt+Enter or the editor's Complete Test with FlakyLens AI action. Missing code is retrieved automatically from the test file, then its module and the whole project as needed. Chat follow-ups refine the same test body and preserve retrieved context. Review the inline diff before applying. Existing Unit Test Scenarios skeletons in src/test are assessed by selected scenario, candidate calls and current runtime. Local logic, network tests, mocks and configured Robolectric complete in place. Device-required scenarios can receive a reviewed androidTest migration with AndroidJUnit4, adding a Compose Rule only for Compose UI. Confirmation removes the selected original placeholder and resumes completion on the device test. Other methods and Gradle files are preserved. Environment blockers do not loop through code search. Application is undoable, preserves declarations/imports/other methods and rejects stale targets. Syntax validation is not compilation or test execution.

Get started

  1. Open an Android project, complete Gradle Sync and enable FlakyLens under Settings > Editor > Inspections.
  2. Open a test file. Place the caret on a finding and press Alt+Enter > Show FlakyLens improvement guidance. Local checks do not require running tests.
  3. Use Code > Inspect Code for a batch scan. Customize existing IDE action shortcuts under Settings > Keymap; panel buttons do not have separate shortcut actions.
  4. Optionally open View > Tool Windows > FlakyLens AI. Configure the provider, protocol, address, model and key in AI Settings, then test the connection.
  5. Select an empty test. Start Completion retrieves missing code progressively; chat to refine the candidate, then review and Apply to This Method. More contains settings, request details and Reset.
  6. Run the actual tests through the test gutter or the Android project's Gradle tasks. AI completion is not proof that tests compiled or passed.

中文入门

插件帮助发现空测试和不稳定风险,并解释改进方向;不会自动修复、安装依赖或运行测试。

  1. 从 Plugins 的 Install Plugin from Disk 安装 ZIP,按提示重启,打开项目并完成 Gradle 同步。
  2. 在 Editor > Inspections 启用 FlakyLens;测试代码提示处按 Alt+Enter 查看中英文指导,弹框可放大和复制。
  3. 批量扫描使用 Inspect Code;在 Keymap 为已有 IDE 操作添加快捷键。面板按钮目前不能单独绑定快捷键。
  4. 可选 AI:打开 FlakyLens AI 工具窗口,在“更多 > AI 设置”配置服务并确认连接成功。
  5. 选取空测试后点击开始补全;缺失代码自动按文件、module、项目逐级检索。聊天追加要求或错误以修正同一方法,审查差异后应用;设置、发送详情和 Reset 收在更多中。
  6. 审查并手动落实代码后,使用测试旁运行按钮或 Ctrl+Shift+F10(Windows 常见默认键位)运行;设备测试需正确 runner 和可用设备。

本地检查无需联网或 Key。AI 按用户操作发送所选内容,测试连接也可能计费;结果是未经本地验证的建议。Skill 在插件内只辅助推理,不自动执行工具。

Written by Joobi from the project's own listing. See the source page

24 Nov 2026
Version 1.0.1-SNAPSHOT released. Not scanned yet.

Added

  • Compose runtime fallback prepares an androidTest preview when local Robolectric fixtures are incomplete and device dependencies already exist; explicit device-choice chat messages can escape environment blockers and resume completion after review.
  • Scenario-specific runtime assessment for existing Unit Test Scenarios skeletons: local logic, network, mocks and configured Robolectric complete in place; only device-required scenarios offer androidTest preparation. Structured runtime evidence and local candidate API checks replace file-wide Android/OkHttp relocation heuristics.
  • Reviewed placeholder migration now removes only the selected original empty method in the same undoable command, preserves other tests, and rejects changes to either previewed file.
  • Reviewed Kotlin androidTest skeleton preparation with AndroidJUnit4, Compose Rule, extension imports, Android-compatible method names, existing-class append protection and automatic conversation continuation for device-required scenarios.
  • Explicit environment replies and legacy structural-blocker detection; permission/source-set/fixture changes no longer trigger repeated context searches or authorization loops.
  • Single-method chat refinement with retained local snapshots, dialogue and latest candidate; continue editing the same method after an explicit application.
  • Structured local-context requests with automatic file/module/project escalation, indexed symbol lookup, no-progress detection and at most six retrieval rounds per user message. No manual source/configuration form is required.
  • Add Reset to clear AI session inputs, attachments, completion targets/proposals and results, cancel local analysis waiting and discard stale discovery callbacks while preserving service settings and project files.
  • Bounded local related-code discovery for selected tests/imported files: resolved symbols, explicitly unconfirmed name/declaration hints and one-level candidate-source dependencies.
  • Cancellable local discovery with dependency provenance, relevant build configuration and automatic name/symbol resolution; initial preparation sends no AI requests.
  • Concise, findings-focused AI replies with configurable native output-token limits (2,048 default), explicit legacy Chat token-parameter support and no automatic truncation retries.
  • Always-on test-only scope instructions for Responses, Chat Completions and native Gemini, independent of optional Skill guidance, with request preview and budget accounting.
  • Link empty-test inspection, editor context action and standalone AI page to a selected-method completion flow, without automatic network requests on selection.
  • Structured body/explanation proposals, missing-context gating, Java/Kotlin syntax checks and explicit diff-confirmed body-only application with undo and stale-document protection.
  • Beginner guide covering plugin assistance, installation, local checks, shortcut setup, AI/context workflows, actual JVM/device test execution and common failure causes; refresh Chinese/English entry documentation and installed plugin description.
  • Separate resizable AI settings dialog (service/credentials and analysis options), inline diff review and preserved results during connection checks.
  • Automatic multi-file snapshots with duplicate removal, project-relative file labels, dependency provenance and snapshot line citations.
  • Full-request details with temporarily unlimited request characters; send only core Skill guidance by default to reduce input overhead.
  • Optional expected-behavior/missing-context input and bundled test-Skill guidance, with explicit non-execution labeling.
  • Official/custom provider presets with editable API addresses, Responses, Chat Completions and native Gemini protocols; endpoint-scoped credentials and visible connection status near the connection button.
  • Validate protocol/URL combinations, avoid duplicate endpoint suffixes, and retain legacy official credentials without forwarding them to custom hosts.
  • Optional FlakyLens AI tool window with Gemini generateContent and OpenAI Responses API support, editable model IDs, Password Safe credentials, explicit code preview, connection checks and cancellable requests.
  • Selected-method AI completion prompts using automatically prepared local context; source changes require explicit application and tests are not executed automatically.
  • Detect sole framework fail calls with explicit implementation-placeholder messages, excluding ordinary failures and custom methods.
  • Explain active/deferred placeholder policy, behavioral TDD limits and JVM/instrumented implementation steps.
  • Separate test-validity inspections from stability risks; detect empty/comment-only tests and pure Kotlin TODO placeholders.
  • Detect no-argument Future.get, CompletableFuture.join, CountDownLatch.await and MockWebServer.takeRequest calls.
  • Acknowledge visible JUnit timeouts and document interruption, cleanup and analysis limits.
  • Standardize guidance as finding, evidence, impact, recommendation and limits.
  • Context-aware improvement guidance via Alt+Enter for Compose, Espresso, coroutine tests and MockWebServer.
  • Seeded-input and controlled-time examples, with separate monotonic-time advice for nanoTime assertions.
  • Regression coverage for framework context isolation and guidance availability without source modification.
  • Local Java/Kotlin inspections for fixed waits, unseeded randomness and direct current-time assertions.
  • Test-source scoping, native inspection settings and suppression support.
  • Regression fixtures for positive and negative cases.

Changed

  • Replace deprecated ReadAction.compute with cancellable coroutine readAction during background context discovery; remove redundant legacy read-action wrappers from retrieval fixtures.
  • Replace missing-context forms and guidance reports with a chat input, short status/questions and inline code results; move request details to More. Preserve local skeleton generation, body-only edits, Undo and stale-session/document checks.
  • Temporarily remove local total-request character limits and the budget control, ignoring previously saved budgets while retaining bounded local discovery and configurable provider output limits.
  • Focus the AI UI on one bound test method with explicit generation, conversational refinement, inline diff and body-only application. Remove review/design entry points, import controls, scope/role/range tables and the Markdown guidance page; place settings and Reset in More.
  • Configure platform versions, compatibility checks, environment-based signing and publishing.
  • Upgrade IntelliJ Platform Gradle Plugin to 2.20.1 and Gradle Wrapper to 9.0.0.
  • Disable searchable options generation and declare a minimum IDE build without an upper bound.
  • Replace the sample random-number tool window with FlakyLens inspections.
  • Target Android Studio platform 243 with Java 21 and optional local IDE builds.
24 Nov 2026Listed on Joobi from JetBrains Marketplace.

Follow this listing's changes (Atom feed)