Skip to content

Learn

Using generative AI in software testing

Learn how to use generative AI in software testing, including practical use cases, implementation strategies, and best practices for QA teams.

generative AI

TL;DR

  • Generative AI in software testing refers to the use of AI tools to author test cases more efficiently.
  • There are many benefits to this approach, including reducing costs and lowering the barrier to entry to the testing effort.
  • There are risks and pitfalls as well, since gen-AI is non-deterministic, and teams must create deterministic ways of leveraging those tools.
  • While generative AI for software testing is valuable, agentic testing is the real game-changer, since it makes the whole test automation process much more autonomous.

Using generative AI in software testing is one of the most promising applications of AI. Individuals and businesses today have grown used to getting software updates faster and faster, and to keep up with that expectation while not letting quality slip is a tough challenge.

This post is a complete guide on using generative AI in software testing. You’ll learn what this is and what its benefits and best practices are. Nothing is perfect, of course, so you’ll also learn about pitfalls and risks you must be aware of.

Last but not least, you’ll read about the differences between generative AI for testing and agentic testing and which one is more valuable for your organization.

Let’s dig in.

What is generative AI in software testing?

At the risk of sounding tautological, generative AI in software testing means applying generative AI technologies to the software testing process, with the goal of gaining more efficiency. 

There are a variety of techniques and tools you can apply when using generative AI to help you with testing, and the landscape is changing very fast.

For instance, teams might use generative AI in multiple phases of the testing process, including the creation of test cases and test plans, running and evaluating automated tests, implementing CI/CD pipelines that run test suites, evaluating the coverage and quality of existing test suites and helping cover the gaps, and much more.

Also, bear in mind that “generative AI” can be quite a big umbrella. There are specific types of generative AI models that are usually used in software testing. LLMs (large language models) are used for generating code-based tests, such as unit, integration, or end-to-end tests.

Another type of model used in software testing is multimodal models that can also process things like screenshots instead of only tests, giving tools that use those models visual capabilities.

Before we cover AI in software testing more deeply, let’s discuss a brief history of software testing and QA (quality assurance)

Generative AI is the latest inflection point in the history of software quality assurance, and it’s arguably the one with potential to cause the biggest impact.

A brief history of the QA revolution

Generative AI is the latest inflection point in the history of software quality assurance, and it’s arguably the one with potential to cause the biggest impact. But there were other relevant milestones before, so let’s quickly cover the main ones to understand the impact gen-AI can bring to it.

The birth of SUnit and the xUnit family

Test automation has existed in some shape or form for several decades, but a crucial milestone was the creation of SUnit. Kent Beck created it in 1989 as a unit testing framework for the Smalltalk language.

Unit testing is a type of automated testing in which we verify the correctness of small parts of the application—the so-called units—individually and assess whether they work correctly in isolation.

SUnit was a game changer because it allowed developers to use Smalltalk to write tests to verify the correctness of Smalltalk code.

As such, SUnit can be thought of as a first step into the long journey of breaking the silo between developers and testers/QA, making testing more of a collaborative effort, and shifting it left.

GUI automation goes commercial

Another milestone came in the 90s, when play-and-record style tools for GUI (graphical user interface) testing started to appear. One such tool was WinRunner, released by Mercury Interactive in 1993, which allowed its users to record GUI interactions and then replay them as test scripts.

Such tools were proprietary and mostly considered niche tooling for a specialist QA team.

JUnit, xUnit and the agile revolution

Based on SUnit, Beck later created JUnit for the Java language, with the help of Erich Gamma.

Inspired by JUnit and SUnit, many tools were created for a variety of languages, and these tools are collectively known as the xUnit family of unit testing frameworks because they all share the same underlying patterns and behaviors.

In the late 90s, Beck released two books that put a highlight on automated testing and unit testing in particular.

  1. The first was Test-Driven Development By Example, in which Beck explained the TDD (test-driven development) methodology, in which unit tests are used to drive the development of the code.
  2. The other one was Extreme Programming Explained, in which he teaches his Extreme Programming (or XP, for short) software development process. In this method, automated testing and TDD play a key role.

In 2001, Kent Beck, along with 16 other software consultants, published the “Manifesto for Agile Software Development,” which expresses the idea that working software and constant collaboration with the user is more valuable than lots of documentation and rigid upfront planning.

All of those developments together helped consolidate the idea that “developers writing tests” was a natural part of the development process.

CI/CD

In the 2010s, thanks to tools like Jenkins, Travis, CircleCI, and others, it became common to create CI/CD (continuous integration, continuous delivery/deployment) and run your suite of automated tests in those pipelines.

This was a turning point in which running an automated suite of tests became feasible and even required for any team that was serious about quality.

AI-assisted test tooling

“AI-assisted” here refers exclusively to pre-LLM AI. From the mid-2010s to circa 2021, many test automation tools started leveraging ML (machine learning) to achieve more robust test suites.

Capabilities of these tools included things like smart locators and flaky test predictions. Tools of this era used AI/ML to make test automation more efficient and robust.

Generative AI tools can author tests based on natural language prompts or acceptance criteria from issues/tickets, which is already a game changer.

Generative AI in software testing

This is the current era we’re in. Starting in late 2022, LLMs took the world by storm, and it didn’t take people long to realize the potential of those tools for testing. Generative AI tools can author tests based on natural language prompts or acceptance criteria from issues/tickets, which is already a game changer.

But since 2025, the move from prompting to using agents has unlocked another level of potential. That’s because agents can now run tests, evaluate error messages, “reason” about failures, and then suggest—and even perform—fixes.

So, we can say that pre-generative AI software testing focused on making test automation more robust. Generative AI software testing makes software testing more autonomous.

gen-ai-transforming-software-testing

How generative AI is changing software testing

Generative AI is changing software testing in many different ways, namely by:

  1. Reducing time to author code-based tests, such as unit and integration tests.
  2. Helping teams quickly cover gaps in coverage.
  3. Analyzing a codebase and suggesting specific test cases and strategies.
  4. Evaluating the feasibility of testing strategies or approaches the team might not be experienced with, such as mutation testing or property-based testing.

Let’s cover some of these in more detail.

1. Generative AI for unit and integration testing

Writing unit and integration tests is a task that, let’s face it, many developers didn’t like but felt forced to do.

Your mileage may vary, but it’s my personal experience that gen-AI is consistently good at writing comprehensive unit/integration tests, in a fraction of the time it would have taken me, and often covering edge cases and scenarios I wouldn’t have thought of.

Even though there are specialized AI tools targeted at generating unit/integration tests, they mostly fell out of favor because most developers stick to whatever AI agent they use for the production code generation itself, be it Claude, Cursor, Codex, or something else.

2. Generative AI for closing coverage gaps

First of all, bear in mind that “test coverage” and “code coverage” are two different things, and you need both.

Anecdotally, one way I’ve been using generative AI to increase code coverage is by asking my agent to measure coverage and then analyze the results, figure out what would be needed to raise it to a certain threshold, and then do it. This approach has been working consistently well.

Regarding the broader “test coverage” concept, gen AI helps me in the following way. I ask it to analyze a codebase and discover portions of the codebase or the feature set that are not currently covered by tests in any of the layers. Then, we proceed to create the tests that will close the gaps.

There is another approach which I, personally, haven’t used yet but have heard of people experimenting with it and found it promising.

That would be designing an agentic loop in which the agent uses a mutation testing tool to calculate the mutation score of a codebase, then edits or creates unit tests until the mutation score reaches the specified goal.

Generative AI here can also act as a bridge to approaches the team has heard about but doesn’t know how to get started with.

3. Generative AI for codebase analysis

This is one area that I find particularly interesting and maybe under-used: the use of gen-AI as an analyzer of your codebase, so it suggests different approaches or techniques for testing.

Generative AI here can also act as a bridge to approaches the team has heard about but doesn’t know how to get started with.

One such technique is property-based testing.

Property-based testing

Property-based testing (PBT) is an approach to testing where, instead of writing specific examples, you define universal properties that must always hold true for your code, and the framework then generates hundreds of random values to test your code against. 

There are developers who have heard of it and liked the concept, but never tried it because they were intimidated by the vocabulary and syntax of the tooling, since PBT can be a bit too “mathy.”

In my Claude skill for unit testing, I added an instruction in which I ask the agent to analyze the code under test and evaluate whether it is a good fit for PBT and then suggest the properties for it—but not implement them right away.

That way, I leverage gen-AI efficiently but also educate myself along the way.

Risk-based testing for legacy code

I also use the agent to analyze legacy, mostly untested codebases and give me a risk-based assessment of which types of testing would make the most sense for the codebase, along with an estimation of effort and risk.

For instance, adding unit tests to a codebase not prepared for it is challenging because there aren’t seams you can use to stub out non-deterministic dependencies.

Doing so would require refactoring, which would itself be risky since you don’t have the safety net of tests—it’s a chicken-and-egg situation.

Maybe, for this specific case, it’d make more sense to first add some integration or even end-to-end tests acting as characterization tests, so we have at least some safety before refactoring our way towards unit testing.

I’ve found generative AI, in the form of coding agents, particularly helpful at that kind of analysis.

“Generative AI has become a top priority for the C-suite and has sparked tremendous innovation in new tools beyond foundation models,” according to Arun Chandrasekaran, Gartner.

Benefits of using generative AI in software testing

We’ve covered some of the benefits that gen-AI brings to software testing, albeit implicitly. Let’s now do it in a more explicit way.

When you can generate hundreds of unit tests in a few minutes, the cost-lowering capabilities of AI become undeniable.

1. Gen-AI reduces the time to author tests

The first benefit of using generative AI for software testing goes without saying: the reduction in time. When you can generate hundreds of unit tests in a few minutes, the cost-lowering capabilities of AI become undeniable.

2. Gen-AI reduces the barrier to entry for authoring tests

This one is huge. For many years, test automation tools—particularly the code-based ones—have been the purview of a select few who had the necessary skills to operate them.

Generative AI lowers the entry bar dramatically for authoring tests. That opens doors for a whole new class of people to contribute to the testing effort who were once not capable of doing so.

3. Gen-AI closes coverage gaps

The post already covered how generative AI is a powerful tool to close gaps in both code and test coverage. But let me mention a different angle here.

Before gen-AI, one of the obstacles that often prevented developers from increasing test/code coverage was the lack of stamina. As a developer worked their way through adding more tests, the effort required would grow increasingly larger.

At some point, fatigue would be likely to set in, and the developer would give up. (Consider also that we developers are always under a tremendous amount of pressure from the business to deliver in a timely manner.)

Generative AI agents don’t tire, at least not like humans. Of course, you need to be mindful of things like the context window.

But the amount of work the AI can output before it starts to produce less accurate results is orders of magnitude more than what a human could produce, manually, in the same amount of time.

4. Gen-AI destroys excuses against test automation

I’ll close this section by saying that the biggest benefit of using generative AI in software testing is, by far, the fact that it completely demolishes the excuses people and businesses had against investing in testing:

  • “We don’t have time.”
  • “Our people lack the necessary skills.”
  • “Developers hate writing tests either way.”

The list is not exhaustive, but you get the picture. This is particularly true in the context of truly agentic AI testing, in which AI makes test automation closer to fully autonomous than it’s ever been.

What are the limitations and risks of generative AI in software testing?

Things aren’t all a bed of roses when it comes to gen-AI in testing. It would be dishonest not to cover some of the pitfalls you must be aware of regarding this approach.

When generating tests with AI, your agent of choice might default to patterns that don’t match your team’s preferences or ones you think are outright wrong.

1. AI might default to non-helpful patterns

“Non-helpful patterns” is a bit of a generic descriptor, but let me explain. Have you noticed that, if you go to your AI chat of choice and ask it to generate some code without specifying the language, you’re going to get either Python or JavaScript most of the time?

That’s because the model is biased toward what it’s seen the most in its training data, and Python and JavaScript are immensely popular.

When generating tests with AI, your agent of choice might default to patterns that don’t match your team’s preferences or ones you think are outright wrong.

For instance, when writing unit tests, I tend to prefer tests that don’t over-rely on interaction verification—that is to say, verifying that a certain mock object was called a certain number of times, with such-and-such arguments, and so on.

I think this style of testing produces tests that are tightly coupled to internal implementation details of the SUT, thus making future changes—including refactoring—harder.

Whenever possible, I prefer state-verification tests.

That is to say, the tests assert against the return values of the function/method call we’re testing. I found myself often repeating myself to Claude, having to remind it of my preference. This was one of the reasons that triggered me to develop my unit testing skills.

2. Hallucinated assertions

This is a problem of generative AI in general, not only of generative AI for testing. And it’s an intrinsic part of how these tools operate: in a certain sense, they’re always hallucinating. It just so happens that, some (most) of the time, their “hallucinations” tend to produce useful results for us.

The solution here is to have checks and balances against this. Employ code reviews of tests, both human and AI-driven, using a different agent.

Also, have other types of gates that check the quality of unit tests themselves. The already mentioned mutation testing is a great alternative for that.

What are the best practices for using generative AI responsibly?

Having covered the benefits and then some pitfalls/risks of generative AI for testing, it’s time to mention best practices your team should keep in mind when adopting this technology in software testing.

First, trust but verify. Generative AI is a great tool, and the models keep getting more powerful, but it’s certainly not perfect. Since its output is non-deterministic, it makes mistakes.

Verification needs to be built into your system in some way, from the start. Leverage adversarial AI reviews and also human reviews when it makes sense.

Research ways to generate deterministic guardrails around AI, so you can use its non-deterministic results safely. For instance, static-analysis tools can catch problems caused by AI-generated code.

Also, when feasible, use the “suggest but don’t implement” approach. That way, developers and other people at the company can keep educating themselves while they leverage the speed of AI. Deskilling is a risk, and it must be prevented.

Finally, don’t forget about security, privacy, and governance. Consult your organization’s policies regarding entering data into public models. If you’re within a highly regulated industry, educate yourself about the laws and regulations you must follow.

genai-vs-agentic-ai

Generative AI vs. agentic AI in software testing

Using generative AI in software testing is distinct from agentic AI.

Generative AI in software testing is what we’ve covered so far: the use of gen-AI to, essentially, generate the kinds of tests that would be created manually by developers and/or QA professionals.

Agentic testing is a different animal completely.

Agentic testing consists of tools—powered by generative AI—that act as autonomous entities for testing: they author, run, evaluate, and maintain test cases.

Such agentic tools have capabilities such as:

  1. Generating end-to-end tests from natural language or requirements
  2. Maintaining existing tests
  3. Designing, executing, and analyzing performance tests
  4. Analyzing coverage and blocking untested code from reaching production

Agentic testing consists of tools—powered by generative AI—that act as autonomous entities for testing: they author, run, evaluate, and maintain test cases.

Case study: how LTM accelerated quality and delivery with agentic testing

LTM (LTIMindtree) is an India-headquartered global technology services company with 90,000 employees. A major Tricentis Tosca implementation partner, LTM delivers digital transformation and business AI solutions to enterprises worldwide.

Problem

LTM was struggling with manual testing processes. These processes were slow and inefficient, requiring too much human effort and harming delivery timelines across all projects.

The need to manually upload Excel spreadsheets added more administrative overhead. Teams also struggled with keeping quality high while delivering fast at the same time.

Solution

The solution for LTM’s challenges was to rely heavily on Tricentis’ agentic test automation capabilities. With Agentic Test Creation, LTM empowered its testers to generate comprehensive test cases from natural language prompts, without the need for manual Excel file uploads or manual test case creation.

Agentic Test Automation goes one step further in the automation ladder by deploying a governed AI agent within Tricentis Tosca. The agent is able to autonomously create and execute test cases, evaluate their results, and even automatically reprocess failed test cases.

If this automatic resolution step should fail, only then would the agent request input from a human. That way, Agentic Test Automation keeps the human in the loop, but it’s also able to act by itself most of the time.

Outcome

The outcomes for this transformation were twofold. First, as expected, efficiency increased, reducing project timelines, optimizing resources, and enabling teams to keep quality high while shipping fast. Secondly, the pilot validated three very advanced AI capabilities of the agent:

  1. Multi-prompt understanding, which allowed the agent to understand complex natural language prompts in their business contexts.
  2. Complex navigation, which enabled the agent to autonomously navigate complex UI workflows. These workflows involved several screens and validation steps without human intervention.
  3. Autonomous resolution, making the agent capable of reprocessing on its own when issues arose during the steps.

Learn more about this transformation here.

Conclusion

The regular use of generative AI in testing, as we’ve covered throughout most of this post, is incredibly helpful, and it’s a valuable tool to have in your toolbelt. But real agentic AI can improve your overall software quality strategy in a way that’s previously unheard of.

If you’re interested in trying an agentic testing platform, you should try Tricentis today. See how the Tricentis AI Workspace helps teams apply AI across the testing lifecycle, orchestrating agents to generate, validate, and govern software quality at AI speed.

This post was written by Carlos Schults. Carlos is a skilled software engineer and an accomplished technical writer for various clients. His passion is to get to the bottom (the original source) of things and captivate readers with approachable and informative technical content.

Author:

Carlos Schults

Guest contributor

Date: Oct. 02, 2026

FAQs

What is generative AI in software testing?

Generative AI in software testing is the use of generative AI tools to make software testing more efficient. It generally consists of using LLM-based tools to quickly generate test cases (e.g., unit tests, integration tests) in a fraction of the time and cost it would take a human to do so.

How is generative AI used in software testing?

Generative AI is being used in software testing in many different forms. It is mostly used to reduce the time needed to author tests. It also helps close gaps in coverage quickly and efficiently. Additionally, it can explore and suggest new test cases and approaches.

What are the benefits of using generative AI in software testing?

The main benefits are reducing the time and effort to author tests, reducing the entry barrier for testing, and closing gaps in coverage comprehensively

What are the risks of using generative AI in software testing?

Generative AI can create problems when generating tests. It can hallucinate and generate invalid results. It might also be biased toward patterns that don’t fit your organization’s conventions. Plus, de-skilling is also a risk for developers.

You may also be interested in...