LLM-Prompts that will take you From Zero To Hero in Software Testing

Monish Correia
4 min readJan 11, 2024

--

Introduction

Welcome to the dynamic world of software testing, where the quest for perfection never ends.

Whether you’re a seasoned tester or a novice eager to dive into the field, one powerful tool that can elevate your testing game is the Language Model, LLM.

In this blog post, let’s explore how LLM-prompts can be your secret weapon, taking you from zero to hero in software testing.

Note: Bonus prompts which I use in my day to day life mentioned at the bottom of this article, so keep reading!!

Understanding LLM-Prompts

LLMs, or Large Language Models, have revolutionized various domains, and software testing is no exception.

These models, like GPT-3.5/4, are adept at understanding and generating human-like text.

By crafting the right prompts, you can harness the full potential of LLMs for software testing.

Crafting Effective Prompts

Before delving into specific LLM-prompts for testing, let’s understand what makes a prompt effective:

  1. Clarity and Specificity: Clearly articulate your testing requirements in the prompt. Vague prompts may lead to ambiguous or irrelevant responses.
  2. Contextual Awareness: LLMs are context-sensitive; ensure your prompt provides the necessary context for accurate responses.
  3. Variety in Querying: Experiment with different phrasings and question structures to uncover a range of test cases.

LLM-Prompts for Software Testing

1. Requirement Analysis:

Prompt:

“As a QA Analyst, analyze the given software requirement and identify potential ambiguities and testability challenges.”

Example:

Given the requirement: “Users must be able to log in using their registered email address or phone number and password.”

  • Ambiguity: What if a user tries to log in with an unverified email?
  • Testability Challenge: How do we simulate concurrent logins to ensure system stability?

2. Negative Test Case Generation:

Prompt:

“Generate negative test cases for the following user story using agile principles. Include detailed steps, data, and expected results.”

Example:

User Story: “Users should be able to recover their password through the ‘Forgot Password’ functionality.”

  • Negative Test Case: Attempt password recovery with an invalid email.
  • Steps: Click on ‘Forgot Password,’ enter an invalid email, and submit.
  • Expected Result: Receive an error message indicating the invalid email.

3. Test Script Identification:

Prompt:

“Identify test scripts based on the provided flow. Include detailed preconditions, actions, sample data, and expected results.”

Example:

Flow: “Successful login should redirect users to their Facebook feed.”

  • Test Script:
  • Preconditions: User has a valid account.
  • Actions: Log in with valid credentials.
  • Sample Data: Email: user@example.com, Password: password123
  • Expected Result: Redirected to the Facebook feed upon successful login.

4. Pairwise Test Cases:

Prompt:

“As a senior QA analyst, design pairwise test cases for the given test basis and conditions. Include detailed steps, data, and expected results.”

Example:

Test Basis: “User Registration”

  • Pairwise Test Case:
  • Conditions: Valid Name, Valid Email, Valid Password
  • Steps: Enter valid name, valid email, and valid password during registration.
  • Expected Result: Successful registration with verification steps.

Bonus Prompts

  1. You are a senior business Analyst. Clarify ambiguity and testability in the following requirement. Make recommendations in an ordered list:
  2. You are a senior QA Analyst. Generate negative test cases using the following agile story as a test basis. Include detailed steps, data, and expected results. Put this in a table format:
  3. Generate test conditions from the following test basis:
  4. You are a senior QA Analyst. Identify test scripts using this flow as a test basis. Include detailed steps, data, and expected results. Put this in a table format:
  5. You are a software architect. Develop negative test scenarios and error conditions for testing this requirement. Neutralize the tone. Output this in a rank ordered bulleted list:
  6. Write Selenium test case in Java for this functionality using page object model (POM) design pattern and JUnit as a unit testing framework. In addition, don’t use the PageFactory
  7. As a data analyst, Generate a python script for generating negative test data for the following requirement.

From Zero to Hero: Embracing LLMs

The examples above demonstrate the versatility of LLM-prompts in addressing various aspects of software testing.

By integrating these prompts into your testing strategy, you can enhance your efficiency and uncover hidden test scenarios.

Conclusion

As you embark on your software testing journey, remember that LLMs are powerful allies.

Craft your prompts thoughtfully, experiment with different queries, and witness how LLMs can elevate your testing prowess. From analyzing requirements to generating test cases, LLM-prompts can indeed take you from zero to hero in the dynamic landscape of software testing.

In conclusion, embrace the potential of LLMs, and let your journey in software testing be both insightful and rewarding.

Happy Testing!

Monish Correia — QA Lead

https://www.linkedin.com/in/monishcorreia/

If you like this article, please show your support clicking the clap button below and follow for more. Thank you! ❤️

https://topmate.io/monish_correia

--

--

Monish Correia

QA Lead | Postman Supernova| K6 Champion| Test Automation | API Testing | Performance Testing | Selenium | K6 | Consultation: https://topmate.io/monish_correia