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.
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
[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 locallyStack
| Part | Technology |
|---|---|
| Extension | TypeScript, editor extension API |
| Analysis | git CLI, language server (document symbols) |
| Tests | pytest, hypothesis (suggested for numeric inputs) |
| AI | intended: LLM via API |
Output contract
{
"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.