How ChatGPT Can Help in Writing Test Cases

Learn how to improve your test case writing process with ChatGPT.

The Intersection Between ChatGPT and Software Testing

The “why” behind the quality assurance process that flows through the software development lifecycle will always be the same: Ensuring that software delivered to customers is fit-for-purpose, secure, and meets customer requirements.

However, the “how” has evolved. Testing has grown with technology, from creating and tracking test cases in spreadsheets and manually drafting testing documentation to leveraging test case templates and utilizing automated testing.

In other words, it’s natural for the software development community to be curious about the impact that ChatGPT will have on the trajectory of software testing.

Put simply, using the platform’s natural language processing and algorithms, QA professionals can use ChatGPT to:

  • Generate answers to questions based on information from its vast database.
  • Create properly formatted and logical code in several languages.
  • Create properly formatted and logical code in several languages.

Exploring ChatGPT for Test Case Writing

So what do all these factors mean for software testers?

Ultimately, if QA professionals know the bounds of ChatGPT, it can be great for:

  • Creating a starting point from which to build more specific test cases.
  • Generating an array of generic test cases based on best practices.
  • Creating testing-related documentation and sources based on user-defined input and specifications in various languages.

Here is the output from ChatGPT when prompted with "Create a test case for adding an accordion on a page":

How ChatGPT Can Help in Writing Test Cases

Although not perfect, the output from ChatGPT is a great starting point, especially for front-end test cases. The output includes the main elements of a test case, provides specific steps, and is written in straightforward language.

Where does ChatGPT test case writing has room to grow?

Some of the more prominent limitations in using ChatGPT for software test case writing include:

  • The system struggles to create tailored test cases based on unique software designs. ChatGPT creates outputs based on already existing content. In other words, it cannot create new content. ChatGPT will rely on test case best practices and information it has been exposed to created before 2022 to generate results. ChatGPT may struggle to create a test case to meet your needs if the function is one of a kind.
  • Subjective or customer-experience-based test cases cannot be generated. ChatGPT cannot handle the subjective, emotional, or aesthetic elements of software testing. Software testers and potential end users will still need to evaluate how well a design meets platform requirements.
  • Output generated by ChatGPT will still need to be reviewed. The output generated by ChatGPT will still need to be reviewed to determine if it meets requirements and is easy to follow.
  • Users need to have an understanding of how ChatGPT works. Software testers will need to understand how and what can be used to prompt ChatGPT. For example, ChatGPT is not designed to handle specific questions about the security requirements of a design element and cannot render code to test for bugs.
  • Content-related test cases cannot be generated. ChatGPT cannot help content authors in writing test cases related to creating content or components in the CMS.

To summarize, there is no denying the power of ChatGPT and its natural language model. Once you recognize the potential for AI to redefine many facets of your personal and professional life, there’s no looking back. However, the limitations of the technology will still require experienced QA professionals and developers to check its work, understand the subjective elements of design, utilize test management tools to manage the overall process, and deliver real-time, unique insights that only humans can provide. I don't think ChatGPT—and other AI-enabled platforms—will replace the need for sound development and QA, but rather be another tool in the toolbox professionals can use to amplify their impact.

Thanks for reading the post!

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting

Meet Ashwinder Kaur

Quality Assurance Lead

👨‍👩‍👦 🏔 🧮

Ashwinder, aka "Ash" is a Quality Assurance Lead dedicated to ensuring high-quality products. She has a Bachelor's of Computer Science & Engineering ad more than 7 years of QA experience under her belt. Ash loves to spend time with her family, sightseeing (especially the Rocky Mountains), and enjoys solving math problems with her son.

Connect with Ashwinder