DEV Community

Cover image for AI Can Write Tests. But Are We Testing the Right Things?
Rimon Nassory
Rimon Nassory

Posted on Edited on

AI Can Write Tests. But Are We Testing the Right Things?

AI is changing how we approach software testing. But generating more tests doesn't necessarily mean delivering better software.

AI Is Making Test Automation Faster

Over the past year, I've been exploring how AI can improve our QA processes, especially when working with Playwright and automated regression testing.

And one thing is clear: AI can be incredibly helpful.

It can generate test scenarios, write automation scripts, suggest edge cases, and help investigate failing tests.

Tasks that previously took hours can sometimes be completed much faster.

But I've started asking myself an important question:

Are we actually improving software quality, or are we just generating more tests?

More Tests Don't Always Mean Better Quality

Imagine asking AI to generate tests for a new feature.

It produces 20 automated tests. They all pass. CI is green.

Looks great, right?

But what if the requirements were incomplete?

What if an important business rule was never discussed?

Or what if the AI generated tests based on how the implementation works, rather than how it should work?

You can end up with a perfectly green test suite that validates the wrong behavior.

And that's where I believe QA becomes even more important.

QA Needs to Be Involved Earlier

Traditionally, QA is often involved when a feature is ready for testing.

But with AI accelerating development, waiting until the end becomes even more risky.

If developers can generate working implementations faster, unclear requirements can become working code just as quickly.

That's why I believe QA should be involved before development begins.

We need to ask questions like:

  • What is the expected behavior?
  • What could go wrong?
  • Which edge cases are we missing?
  • What are the risks?
  • How do we know the feature is actually correct?

Once we understand these things, AI becomes much more powerful.

Instead of asking AI to guess what needs testing, we can give it clear expectations and let it help us turn them into reliable automated tests.

AI Should Support QA, Not Replace Judgment

I'm also interested in concepts such as LLM-as-a-Judge and self-healing tests.

Both have exciting potential, but they introduce new questions.

Should an AI automatically fix a failing test?

How do we know it isn't hiding a real regression?

And who verifies that an AI-generated test actually checks the correct behavior?

I believe the answer is a combination of AI assistance, deterministic checks, and human judgment.

AI can help us work faster, but we still need to understand what we're validating.

Final Thoughts

I don't think the future of QA is about writing more automated tests.

It's about finding better ways to prevent defects, identify risks earlier, and make sure we're building the right things.

AI can help us test faster. QA must help us test smarter.

I'm curious how other teams are approaching this.

Are you using AI mainly to generate more tests, or are you also changing how QA is involved in the development process?

Top comments (3)

Collapse
 
prachitparikh profile image
Prachit Parikh •

Your point about AI writing tests from how the implementation works, not how it should work, is the one I'd underline. One cheap guard: generate the tests from the acceptance criteria, not the code, and keep a two-column map of criterion to the tests that prove it. A criterion with no test is a gap. A test with no criterion is either a missing requirement or noise, and that second list is where the business rule nobody discussed tends to show up.

Collapse
 
rimonnassory profile image
Rimon Nassory •

Great point! I really like the idea of mapping acceptance criteria directly to tests. It also reinforces why QA should be involved early in refinement, before development starts. That way, we're not just verifying what's been built, but challenging whether we've defined the right behavior in the first place. Thanks for sharing!

Collapse
 
prachitparikh profile image
Prachit Parikh •

Agreed on getting QA into refinement. One cheap way to make it stick: before a story leaves refinement, the tester adds one example of how they'd try to break it. If nobody can write that example, the criterion is still too vague to build against.