Skip to content

CodingIdeaEN

Unit test suggestion helper

Demo idea: suggests missing unit tests for functions changed in a fictional codebase.

Esempi BestIAPublished on 24 November 2026
Maturity
Idea
Category
Coding
Entry language
English
Published
24 November 2026

01The problem

Developers in this invented project ship changes without tests for edge cases, and regressions appear weeks later.

02The solution

An editor command lists the changed functions, proposes test cases with inputs and expected results, and generates a draft test file.

The AI core of the project

03Role of AI

For ideas this describes the intended use.

Intended use: a language model proposes edge cases and draft tests; the developer runs and edits them before committing.

04Technical architecture

README.md

TestScout — unit test suggestions in the editor

Demo idea.

Overview

An editor extension command lists the functions changed since the last commit and proposes edge cases and a draft pytest file. Nothing is written to disk or committed automatically.

Architecture

text
[Editor command "Suggest tests"]
      |
      v
[git diff HEAD] + [language server symbols] --> changed functions
      |
      v
[Context builder] signature + body + existing tests (max 6k tokens)
      |
      v
[LLM API] --> { cases: [...], test_file: "..." }
      |
      v
[Untitled editor tab] --> developer runs pytest locally

Stack

PartTechnology
ExtensionTypeScript, editor extension API
Analysisgit CLI, language server (document symbols)
Testspytest, hypothesis (suggested for numeric inputs)
AIintended: LLM via API

Output contract

json
{
  "cases": [{ "name": "empty_list_returns_zero", "input": "[]", "expected": "0", "why": "boundary" }],
  "test_file": "import pytest\n..."
}

Guardrails

  • Only the selected functions leave the machine; files matching .env*, secrets/** are excluded.
  • Generated tests must import only the module under test (checked before opening the tab).
  • Configurable model endpoint for teams that self-host.

—Images

  • Illustration: changed functions in an editor with suggested unit tests marked as passing