Optimize AI Test Case Generation: Save Tokens and CostsOptimize AI Test Case Generation: Save Tokens and Costs
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
After using AI extensively for the last 1-2 years, I've noticed an interesting limitation.
When I ask AI to generate 10 test cases for a scenario, usually only 3-4 are highly relevant. The remaining test cases are often generic, duplicated, or based on assumptions that don't match the actual business scenario.
The problem isn't just accuracy—it's also cost(Extra Money, Water, Electricity etc).
Even the irrelevant output consumes tokens, which means: • More tokens used • Higher API costs • More time spent reviewing and filtering responses
I don't think the solution is to stop using AI. Instead, we need to use it more efficiently.
A few things that have helped me: ✅ Provide complete business context and acceptance criteria. ✅ Mention constraints and assumptions explicitly. ✅ Ask for only "Top 5 high-priority test cases" instead of asking for everything. ✅ Generate test cases iteratively rather than in one big prompt. ✅ Ask AI to first identify missing information before generating the answer. ✅ Use AI as an assistant, not as a replacement for domain knowledge.
AI is incredibly powerful, but better prompting and better context are still the keys to saving both tokens and money.
Has anyone else experienced the same thing while using AI for testing or development?
Post image
Victor's avatar
Have you tried testing a feedback loop with specific domain tweaks? Curious if it improved relevance!
Manoj's avatar
Yes, I did experiment with it. Adding domain-specific context, business rules, and constraints definitely improved the relevance of the generated test cases.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started