Draft a function and tests from written instructions and examples
A draft function with a table-driven test file from the supplied examples and a spec-ambiguity list, kept unmerged.
Choose one of three approaches. The steps for that option appear below.
Choose an option above. On a phone, swipe the tabs left or right to see all options →
GitHub Copilot: proposes rules first, then code
Copilot Chat proposes rules, then a function and tests. You control the rules and the local test run.
You
Gather spec
GitHub Copilot
Propose rules
You
Check the rules
GitHub Copilot
Draft code and tests
You
Run, record, stop
Gather the spec, examples and test framework
Use:You
Have ready: spec text and examples. State the language, version and test framework.
Check
Paste only the spec, examples and your language choices into the editor chat.
Ask for behaviour rules, no code
Use:GitHub Copilot
In Copilot Chat, paste the spec and examples with your language choices. Ask for numbered behaviour rules and unresolved readings, without code.
Details
What to paste into the tool
Task: Proposed behavior rules and spec questions. Use the packet; preserve each example input and expected output; number behavior rules and cite their spec phrase; list ambiguous readings separately; do not choose missing behavior
Check the rules against the original
Use:You
Check every rule and example against the original. Resolve or park each spec question and keep your language and framework choices.
Check
Pause until a developer accepts a rule set. Release the corrected sheet only after the developer accepts its scope.
Request the function and a test file
Use:GitHub Copilot
From your confirmed rules, ask Copilot Chat for one function and a separate table-driven test file. List unresolved cases; disable agent commands.
Details
What to paste into the tool
Task: Draft function source; Draft table-driven test file; Unresolved spec list. Use developer-confirmed rules over earlier proposals; write in the supplied language and framework; encode every supplied example as one input-expected table row; use only permitted dependencies; return files as text and do not run commands
Run everything locally and stop before merge
Use:You
Read the source and tests, check each example is encoded, run tests in an isolated local environment, record failures and ambiguous behaviour, stop before merge.
Check
Treat generated files as review candidates only. Keep the files as an unmerged draft.
JetBrains AI (AI Assistant + Junie): drafts code and tests
You write the rules and ambiguity list. AI Assistant drafts the function and unit tests. You check and run them.
You
Write rules
JetBrains AI (AI Assistant + Junie)
Draft code and tests
You
Check, run, package
Write the rules, ambiguity list and function yourself
Use:You
Read the spec locally, write the confirmed rules, function and ambiguity list yourself without AI, and choose the language and test framework.
Check
Keep implementation local while interpretation remains under developer control. Upload only the reviewed rules and example table.
Draft the function and unit tests
Use:JetBrains AI (AI Assistant + Junie)
Ask AI Assistant for the function from your rules and example table, then use Generate Unit Tests for table-driven tests matching each example.
Details
What to paste into the tool
Task: Draft the function from the confirmed rules and example table below, in the declared language. Then, in the IDE, select the drafted function and run AI Assistant's Generate Unit Tests action, and ask: candidate table-driven tests with example correspondence. Use the declared test framework; encode the supplied input-expected pairs literally; return the function, the test file and the correspondence in text; do not execute tests or invent outcomes. Rules and examples: [paste the rule packet and confirmed example table].
Correct the tests, run them, package the draft
Use:You
Compare the function and each test row with the spec, correct by hand, run tests locally, package function, tests and ambiguity list as a draft.
Check
Return the draft function and test candidates without accepting anything. Complete preparation without accepting a merge.
Cursor: drafts code and tests, you check them
You write the rules. Cursor drafts the code and tests and runs Agent Review. You check everything.
You
Write rules
Cursor
Draft and review
You
Check, run, keep draft
Write the rules, example table and ambiguity list
Use:You
Extract rules from the spec, write an example table and an ambiguity list, choose the language and test framework in the local branch.
Check
Hold the branch as draft work. Give the AI only the prepared rules, example table and notes.
Draft the code, then run Agent Review
Use:Cursor
In the scratch workspace, ask Cursor to draft the function and tests, then run Agent Review manually in Source Control. Keep observations; apply no edits.
Details
What to paste into the tool
Task: Draft the function and table-driven tests from the confirmed rules and example notes below, in the declared language and test framework. Encode the supplied input-expected pairs literally. Work only in this scratch workspace; do not commit or push, and do not invent outcomes. Rules and examples: [paste the drafting packet]. Task: Cursor review observations. Review the local diff only; compare the provided example notes with the function and test rows; identify possible bugs and missing example coverage; leave fixes as suggestions and do not commit or push
Check the code and each observation
Use:You
Check the code and each observation against the spec and local files, correct by hand, run the example tests, keep an unmerged draft.
Check
Leave the drafted files uncommitted. Route the observations to developer review. End with developer-controlled draft files.
Compare the three approaches
Option A: GitHub Copilot: proposes rules first, then code
Best when: You want the rules agreed before any code is written
What it does: Copilot proposes rules and code; you check and run them
Strong at: Chats about code in IDE, CLI and desktop app
Limit: Agent actions need human approval for sensitive steps like running commands
Free plan: Yes
Option B: JetBrains AI (AI Assistant + Junie): drafts code and tests
Best when: You want to write the rules yourself and let AI draft code
What it does: You write rules; AI drafts code and tests; you check
Strong at: AI chat and code completion inside JetBrains IDEs
Limit: Junie limited to JetBrains IDEs and Android Studio
Free plan: Yes
Option C: Cursor: drafts code and tests, you check them
Best when: You want AI review notes on code you can read first
What it does: Cursor drafts and reviews; you check and run the code
Strong at: Runs coding agents that write and change code
Limit: Cloud agents need Premium or above
Free plan: Yes
Before you paste into any AI tool, remove any confidential information. Put it back at the end.