Stop asking AI to generate test cases: how to integrate AI into your engineering workflow

3
calendar_today agoschedule2 min read
— Originally published at dev.to

Every time a new feature or fix comes up, some people do the same thing. They open their favorite AI chat, copy the requirement or the PR description, paste it in, and ask "generate test cases for this feature". Then they copy the output back into their test management tool or their notes.

There is nothing wrong with using AI this way, it works. I do think there is something wrong with having a manual flow around it. You have to remember to do it, you have to copy and paste the context every single time, and the AI only knows what you decided to paste. If you forget a detail, or if the feature touches something you did not think to mention, the AI will not know either.

Instead of manually going to an AI chat every time, you can integrate that same LLM into your workflow, so it runs automatically and already has the context it needs.

One example I built recently at work is a GitHub workflow that runs on the PR level.

Every time a developer opens a PR implementing a feature or a fix, we have a label called "ai:generate-test-cases". When someone adds this label, it triggers a GitHub workflow that runs a script calling an LLM. This script reads the full PR diff, the comments, and even external links using MCPs, to gather as much context as possible. Then it drops a comment on the PR with a list of possible test scenarios, the risk level of that change, and whether the developer already added automated tests for it. This way we can focus on the areas that matter the most.

Traditional workflow
Requirement
    ↓
Copy
    ↓
Paste into AI chat
    ↓
Generate Test Cases

Integrated workflow
Pull Request
    ↓
Label added
    ↓
GitHub Action
    ↓
LLM reads diff + context
    ↓
PR Comment with:
- Test scenarios
- Risk level
- Test coverage insights

Test case suggestions are just one output of this. The same context, the diff, the comments, the linked docs, could just as easily be used to flag risk, or check if something important was missed. Generating test cases is just the first thing I built with it.

This is opt-in by design. It will not generate anything on infra related PRs, or any PR where the label is not added. You choose which PRs need test case suggestions. This is useful not only for QAs, but also for developers who want to make sure they covered the main scenarios, and it can surface an outcome or edge case you had not thought about.

Of course this does not replace human judgment. It is a tool to help organize and prioritize scenarios, not a guarantee that every hidden path has been covered. We should always use our own experience to decide what is worth testing and what is not, since it is impossible to test everything.

AI is much more valuable when it becomes part of your engineering workflow instead of another browser tab. Test case generation is just one example of that.

If this is something you want to try or adapt to your own workflow, the repo is public and I am happy to talk through how it works.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

Stop Mocking Everything: How to Test API Resilience in Your Terminal (Curl + Chaos Proxy)

aragossa - Dec 5, 2025

Your Backup Data Knows More Than You Think. HYCU aiR Is Finally Asking It the Right Questions.

Tom Smithverified - May 14
chevron_left
146 Points3 Badges
Brazilrebeqa.io
2Posts
0Comments
I work as a Senior QA Engineer at Sardine, a fintech focused on fraud prevention and compliance. My ... Show more

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!