Skip to main content
parwalrahul
Navigator
March 20, 2025
Quiz

Week 3 Exercise - Refining Prompt for Testing Task

  • March 20, 2025
  • 50 replies
  • 722 views

Objective:


The goal of this activity is to help you recognize the characteristics of a well-structured prompt and practice refining prompts to make them clear, specific, and actionable for the testing tasks.

Steps:

  1. Review the Given Prompt: Here’s a poor prompt for a testing task:

    "Give me some test data for this app."
     
  2. Identify Issues: Consider why this prompt might not yield useful results. Think about missing details like the type of app, testing scope, expected tests, usage of the output produced, output format, or any specific testing techniques.
     
  3. Improve the Prompt: Rewrite the prompt to make it more precise and useful
     
  4. Share and Discuss: Share your refined prompt with others and discuss how different refinements impacted AI responses.

50 replies

Ensign
March 26, 2025

The following are the issues due to which it cannot respond: 

Please provide details about the app for which you need test data. Specifically, I need to know:

  1. The type of app (e.g., e-commerce, social media, etc.).
  2. The kind of data you need (e.g., user accounts, product listings, transaction records).
  3. Any specific fields or attributes you want in the data (e.g., name, email, price, date).
  4. The volume of data you require (e.g., number of records).

With this information, I can generate the appropriate test data for you!

 

Refined prompt: Give me some test data for a social media Instagram app. The kind of data I need: user accounts. Specific fields I want in the data ( name, email).

 

AI response: 

Sure! Below is a sample dataset for user accounts that you might use for a social media application like Instagram. The dataset includes the fields you specified: name and email.

 

Sample Test Data for User Accounts

json

[

{"name": "Alice Johnson", "email": "alice.johnson@example.com"},

{"name": "Bob Smith", "email": "bob.smith@example.com"},

{"name": "Charlie Brown", "email": "charlie.brown@example.com"},

{"name": "Diana Prince", "email": "diana.prince@example.com"},

{"name": "Edward Elric", "email": "edward.elric@example.com"},

{"name": "Fiona Gallagher", "email": "fiona.gallagher@example.com"},

{"name": "George Weasley", "email": "george.weasley@example.com"},

{"name": "Hannah Baker", "email": "hannah.baker@example.com"},

{"name": "Isaac Newton", "email": "isaac.newton@example.com"},

{"name": "Jessica Jones", "email": "jessica.jones@example.com"},

{"name": "Kevin Hart", "email": "kevin.hart@example.com"},

{"name": "Liam Neeson", "email": "liam.neeson@example.com"},

{"name": "Mia Wallace", "email": "mia.wallace@example.com"},

{"name": "Nathan Drake", "email": "nathan.drake@example.com"},

{"name": "Olivia Benson", "email": "olivia.benson@example.com"}

]

 

Usage

You can use this data to:

  • Create user accounts in your social media app.
  • Test user registration and profile functionality.
  • Validate email uniqueness during account creation.
  • Simulate user interactions in your testing scenarios.

 

With the help of a refined prompt, AI knows what and how to respond. From my point of view, it is always recommended to provide proper details to AI models so that they can process an accurate solution which can be useful for the users.

Charmi Patel
parwalrahul
Navigator
March 26, 2025

@ameet213 superb! loved the learning style that you followed.

Starting with confusion and ambiguity and ending with effectiveness and clarity.

a nice example of learning and evolution through the bootstrap approach.

i liked the fact that you actually took the time to read and reflect on all the questions asked by gpt after your initial prompt.

kudos! cheers :)

https://testingtitbits.com/
parwalrahul
Navigator
March 26, 2025

@Saravanan s nice one.

you doubled down on the 5W approach and that’s a really nice to way elaborate anything well. 

In real life as well as in the artificial life (i.e. using ai / llm tools). cheers!

https://testingtitbits.com/
parwalrahul
Navigator
March 26, 2025

@Charmi07 nice one. also, i see it generated answers for you in JSON format.

Did you also specifically asked for it or was it because of some previous prompts or chats with the llm tool?

https://testingtitbits.com/
Ensign
March 26, 2025

@Charmi07 nice one. also, i see it generated answers for you in JSON format.

Did you also specifically asked for it or was it because of some previous prompts or chats with the llm tool?

No, I didn’t specify the format, maybe it was because of previous prompts.

Charmi Patel
Specialist
March 27, 2025

Thanks ​@parwalrahul for the assignment.

 

Before GenAI, we used to hear more about it, like, We need your prompt attention to it, prompt response matters, sometimes etc.; 

Usually, a prompt is something quick.

In the GenAI version, it's kind of a request we are submitting for getting a response from any LLM like GPT-4o, Gemini 2.o Flash, Sonnet 3.7, etc.

 

The prompt is a combination of instructions, context, input, and output format(examples as well).

When GPT was launched, it hallucinated more (even now it does, but there are ways to reduce it), and it's similar to a baby but with vast knowledge. 

 

If we give just a prompt, I need information about Apple. Based on its training data, it usually thinks of Apple as a company rather than hoping that it's a fruit and responds like that.

Like how humans were trained, I'm not sure about all of you till I remember there is only A for Apple and B for Ball :)

Back to the assignment, a good prompt should be readable and understandable by humans as well as by any LLM.

 

"Give me some test data for this app." It has some context, one instruction, which makes us hallucinate more than LLM, as new GenAI models are trained to respond to something they think might work for this.

 

Let us make it a better one—
Adding context:
As a functional tester, I'm looking to generate test data for an e-commerce website for the search field. This website sells only apparel, accessories, cosmetics, and footwear from different brands.

Sounds good? Then the context is clear, but we didn't provide any specific instructions: provide what the search field accepts, the length, whether the website is only for Indians (it matters as it'll impact the test data), etc.

This search field will accept only characters and numbers (to search any product ID), has of maximum length of 30, and the website is only for Indians.

 

I hope we are good with the prompt. Combine both and send it to LLM. You'll definitely get a good and definite response that's better than the first one.

 

Nowhere did we ask a question here or what exactly we are looking for; we will add that too—I'm looking for your help on generating 10 samples of test data for each fashion category above.

We are on track. We made LLM think and work like a junior you. We will add some touch-ups here.

I want this data to be created in table format for different fashion categories.

 

Here is the final prompt:
As a functional tester, I'm looking to generate test data for an e-commerce website for the search field. This website sells only apparel, accessories, cosmetics, and footwear from different brands.
This search field will accept only characters and numbers (to search any product ID), has a maximum length of 30, and the website is only for Indians.
I'm looking for your help in generating 10 samples of test data for apparel, accessories, cosmetics, and footwear.
I want this data to be created in 4 different table formats for different fashion categories. You can get started by analyzing this step by step.

 

Things I've considered here:
1. Didn't mention what not to generate; rather, focused on what only to generate
2. Tried to be specific about what I want rather than thinking that LLM could handle everything.
3. I have added "step-by-step" at last—it's a zero-shot chain-of-thought. Simple version of deep thinking—mostly for complex tasks, not for this though, but it's nice.
4. LLMs are different and non-deterministic. Even the prompt can add more columns and provide test data in one session and fewer columns in another, but the task can be accomplished.

5.Add the persona as a tester

 

That's all.

parwalrahul
Navigator
March 27, 2025

@Dinesh_Gujarathi wow! this is by far the best explanation and a mini guide on how to create good prompts for specific and context dependent testing activities and task.

 

I would suggest you publish this as a LinkedIn article or on your own blog / GitHub page.

 

this is a good reference that you have created. wonderful work. see you tonight :)

https://testingtitbits.com/
parwalrahul
Navigator
March 27, 2025

@Charmi07 ok, that explains it. Cool! Thanks for answering.

https://testingtitbits.com/
Bharat2609
Ensign
March 27, 2025

Hi ​@parwalrahul 

Regarding the given prompt - "Give me some test data for this app." 


I have listed a few issues with the given prompt - ​​​​​

  1. Lack of Context: It doesn’t specify what "this app" is—its purpose, functionality, or domain (e.g., a banking app, game, or e-commerce platform).
  2. Undefined Scope: It’s unclear what kind of testing the data is for (e.g., unit testing, UI testing, performance testing, or edge cases).
  3. No Expected Output: It doesn’t indicate how the test data should be used or what outcomes are desired (e.g., validating inputs, triggering errors).
  4. Missing Format: There’s no guidance on how the data should be presented (e.g., a list, table, JSON, or raw values).
  5. Ambiguity in Quantity/Complexity: It doesn’t specify how much data is needed or whether it should include typical, boundary, or invalid cases.

Refined Prompt for Better Testing Data Generation

 

As a functional tester, I'm looking to generate test data or a mobile banking app’s login feature to support functional and security testing. I'm looking for your help to generating 5 valid username-password pairs (e.g., typical user credentials), 3 invalid pairs (e.g., wrong password, locked account, SQL injection attempt), and 2 edge cases (e.g., 50-character username, Unicode symbols). I want this data to  be in JSON object with 'valid', 'invalid', and 'edge' keys, where each entry lists the username, password, and a note explaining its test purpose. Ensure the data aligns with common security standards like OWASP recommendations. You can get started by analyzing this step by step.

 

Why This Works:

  • Context: Specifies the app (mobile banking) and feature (login).
  • Scope: Clarifies the testing type (functional testing).
  • Expectations: Defines the types of data (valid, invalid, edge) and quantity (5, 3, 2).
  • Usage: Implies the data will test login success, failure, and boundaries.
  • Format: Requests JSON with categorized entries for clarity and usability

Key Takeaways

  1. Be Specific – Always mention the app type, modules, and test scope.
  2. Define Expected Output – Mention the format like JSON, CSV, or database entries.
  3. Include Test Coverage – Specify valid, invalid, boundary, and edge cases.
  4. Tailor for the Use Case – Differentiate between functional, API, performance, or security testing needs.

 

Bharat
Ensign
March 27, 2025

 

Prompt :Give me some test data for this app

Issues - This prompt is vague and does not clearly type of application, what  are likely input fields, any specific type of data needed, any specific data format required, quantity of test data , if data is required for specific type of testing like BVA, EP , etc.

 

Improved prompt  1:  Please provide test data to perform boundary value analysis tests on a bank login form

Improved prompt 2 :Please provide test data to perform boundary value analysis tests on a bank login form with account number or user name 9 char/digits and password with 10 chars. Also password needs to be a combination of letter, digits, symbols

In both cases , Chat GPT4.0 replied with quite good detailing about how BVA is done and with some assumptions on each fields provided data in excel format as well as JSON format, with valid and invalid data.