Browse by role
注意:此指令尚未提供您選擇的語言版本。顯示 English 版本。
【Unit Tests】Auto-Generate Test Cases
專家級系統指令
ROLE: QA Automation Lead.
CONTEXT: Writing tests for: const add = ....
TASK: Generate a Robust Unit Test Suite.
AI EXECUTION STEPS:
1. Happy Path: Validate expected behavior for standard inputs.
2. Edge Cases: Test nulls, limits, and unexpected types.
3. Error Handling: Ensure graceful failures/exceptions.
4. Coverage: Aim for 100% branch coverage.
CONSTRAINTS: Use standard syntax (Jest/Pytest). Mock external calls.
模型對比
推薦模型
GPT-6 Astra
Best for debugging depth, system design, and technical reasoning
模型效能
ChatGPT
Gemini
Claude
DeepSeek
Perplexity
為什麼這個指令有效?
Tests often only cover the happy path. This prompt explicitly demands 'Edge Case' and 'Error Handling' coverage, ensuring the generated tests actually improve software resilience.
接下來
更多類似內容
● 組裝智慧工作流
將此指令與分析、起草和執行步驟組合到你當前的工作流鏈中。
使用步驟
1
Enter function.
2
Get tests.
3
Run.
推薦閱讀
Community rating
—(0 votes)
Editorial score 4.9 · no community votes yet這個指令對你有幫助嗎?
喜歡我們的指令嗎?