CodingIdeaEN
Unit test suggestion helper
Demo idea: suggests missing unit tests for functions changed in a fictional codebase.
Esempi BestIAPubblicata il 24 novembre 2026
- Maturità
- Idea
- Categoria
- Coding
- Lingua della scheda
- English
- Pubblicata
- 24 novembre 2026
01Il problema
Developers in this invented project ship changes without tests for edge cases, and regressions appear weeks later.
02La soluzione
An editor command lists the changed functions, proposes test cases with inputs and expected results, and generates a draft test file.
03Ruolo dell'AI
Per le idee descrive l'uso previsto.
Intended use: a language model proposes edge cases and draft tests; the developer runs and edits them before committing.
04Architettura tecnica
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.