# Prompt Engineering for Testing | CO-STAR Method | Write Better AI Prompts (Hands-On)

## Метаданные

- **Канал:** Automation Step by Step
- **YouTube:** https://www.youtube.com/watch?v=1hwN7unPmHs
- **Дата:** 27.04.2026
- **Длительность:** 10:57
- **Просмотры:** 4,230
- **Источник:** https://ekstraktznaniy.ru/video/50059

## Описание

TOPICS
00:00 Introduction
00:30 What is Prompt Engineering
01:15 Basic Prompt Demo (Login Test Cases)
02:57 3 Pillars of Effective Prompting
03:51 Improved Prompt Demo (Better Output)
07:55 What to Always Ask Before Writing Prompts
08:21 CO-STAR Method Explained
10:00 Advanced Prompt Demo (Real-World Example)
----

Short - https://youtu.be/JNMpXh1Fx2c?si=PpYu3DkJ3pvOqP-0

Struggling to get good results from AI?

In this video, you’ll learn what a prompt is and how prompt engineering helps you get better, more accurate results—especially in software testing

👉 You’ll learn:

What is a prompt (simple explanation)
What is prompt engineering
Why AI gives poor output sometimes
How to write better prompts using real examples
CO-STAR Method
Step-by-step demo using ChatGPT

We’ll use real testing scenarios like login and signup to make it practical and easy to understand

👉 This is a hands-on session—learn by doing, not just watching

Perfect for beginners, testers, and anyone using AI tools



## Транскрипт

### Introduction []

Hello and welcome. I'm Raghav. In this session, we are going to go very basic step-by-step and we will learn what's prompt engineering, how do we use prompt engineering for testing, and we will learn the Co-Star method using which you can make your prompt very, very clear and effective, and you can make use of AI very, very efficiently for your jobs. This is going to be very easy and very interesting. We will understand each concept and go step-by-step, and you can also take the quiz after this session. Let's get started and see what's prompt

### What is Prompt Engineering [0:30]

engineering. So, prompt engineering is the way, the art, or the science by which you communicate with AI effectively. So, you can communicate with AI in any ways. You can just write a simple question and you will get some output, but it will be very generic, very vague, and if you really want the best possible outputs and the best possible use of AI, you need to learn prompt engineering by which you can give more clarity and ask specific and very good questions and so that you can get effective replies from AI. So, let's say if you say, "What uh if you say write test cases for login to AI? " It will generate the output. Let me

### Basic Prompt Demo (Login Test Cases) [1:15]

go to Chat GPT. You can go to any AI tool, Chat GPT or let's say Gemini or whatever you're using. If I say, "Write test cases for login and hit enter. " And it will give you the output. It will tell you all the functional test cases, whatever are the different scenarios. It will try to cover everything, but still it is very vague, very generic, and not specific to what you need, not specific to your application or your project requirements. Instead of this, if you say, "Generate five positive and five negative test cases for login and you don't need any explanation, you just need the exact test cases. " You can also add that add five test cases for positive scenarios, five for negative, and five for edge. So, this is a better prompt, more clearer, and you can get better responses here. Still, if you go ahead and say, "Generate five BDD test case scenarios for login with email validation and password rules in a table format. " So, now it is more clear. You have said what exactly you need, what are the constraints, and what format do you need your test cases in. Okay, so this is how you will you can improve your prompt, and we will learn this is still very basic. We will learn how exactly you can write very, very good prompts for AI. So, a prompt is any question, any instruction, anything that you ask AI, that is a prompt. And we have to learn how to ask or make our prompts better. Okay, with this knowledge, let's go and see. So, we know what's prompt engineering and we have discussed few prompts. Now, the three main pillars of

### 3 Pillars of Effective Prompting [2:57]

prompts is clarity. It should be very clear. If you tell AI what exactly you need, what is the format, what is your use, what is your need, you will get much better responses. You can provide the context like why, where, which platform, where exactly you want to run it, what application you are using, etc. And if there are any constraints like you need only this particular structure, you need in a table format, you need to use only this particular language, all these boundaries or constraints. So, clarity, context, and constraints. So, whenever you are designing your question, you just think of these things that what exactly you need, and then what is the context, where exactly you are going to use it, and what are the constraints or boundaries. Now, you can design your prompts according to this, or you can ask AI itself that this is what I need, and according to this, tell me what should I ask. For example

### Improved Prompt Demo (Better Output) [3:51]

I will go here and say, "I want I want to create test cases for login scenario. I am using a mobile app, or I am testing a mobile app. I want five positive, five negative, and five edge cases in table format. Create a good prompt that I can ask AI to get best possible response or output. So, I have said this and I will hit enter and let's see what prompt it will give us. So, you can see it is actually creating our prompt, and here it is a well-crafted prompt, and you can see here. Now, here it is saying act as a QA engineer. So, this is called role prompting. We will also learn about this in the coming sessions that you can actually do role prompting. You can say act as a QA engineer, act as uh S-shaped, act as a automation engineer, and then do this. So, here with strong experience in mobile application testing, create five test cases for a mobile app, and these are the things you need. It is very clear. Then the requirements presented in a clear table format, include all these columns. Now, you can also update it whatever else you need, and it should be realistic, include validation checks, error handling, security, etc. Context, the login requires a username, email, and password. Now, if you have OTP or other login options, you can add it here, and then all the output format, etc. So, see if I just copy this and paste it here, or even if I go to Gemini and paste it here, and let's see what do we get as a output of this prompt. Now, you have understood within few seconds how we have improved our prompts, and you can now see the output. How clear, effective, and useful output we are getting. Okay, everything that we need, everything is presented within few seconds. If I go and check here, if I go to Chat GPT, here again, I will get all these different test cases formatted in table with all the details, and I just have to check them and use them. Of course, with AI, you always have to review and then check and then use. Do not blindly uh rely on it. And you can see how much difference it makes. Okay? So, this is all about how do you communicate effectively with AI so that you get the best possible responses and outcomes. Okay, now let's see prompt engineering for testing, how you can actually use it for testing. We have already seen that this is you can say write test cases for login, which is very generic and give you very vague output. And here, what all we are missing is the clarity, the constraints, the exact what exactly you need to do. The context is not there. The type, limit, format, etc. We are not giving anything. Therefore, we have to improve it using keywords. So, we can say, "Generate what exactly we need, positive, negative, and edge test cases, limit to five for each category, no explanation needed. " You can say that I need a table format, and then you can get much better outputs that we have already seen. Okay? You can ask AI itself how you can improve the prompt as we have done just now, and you will get much, much better outputs. All right.

### What to Always Ask Before Writing Prompts [7:55]

Now, always be very clear, give the context, and the constraints. What do you need? What is the context? What is the platform you are using? What format do you need? Are there any limits? For example, you want to not use some particular language or some particular format, all that things. And then you can ask AI to improve your prompts, and then use those prompt to get the output.

### CO-STAR Method Explained [8:21]

Let's see the Co-Star method. So, what's the Co-Star method for prompting? So, let's say the basic prompt is write test cases for a Avoid this. This is very basic. This will not give you efficient responses. Use the Co-Star method. What's that? C stands for context. You can say, "I'm testing a web application for a high security banking portal. " Or whatever is your need exactly, you can say that in the context. The objective. What is your objective? Now, you have given you have told AI that what is the context. Now, you are saying that what exactly you want. Generate a comprehensive test plan for the login module. Okay, so you would you imagine AI is a machine. It will not know exactly what is you what do you need unless you tell it very, very clearly. So, you have told the context, objective. Then, S stands for style. What style do you want? What format do you want? Then, T stands for tone. Critical and security focused is the tone it should use or the output it should use. Audience, QA team lead. So, for which audience you are getting the response generated. So, this makes a huge difference whether it's for a QA team lead, business people, it will make a huge difference in the outputs. Then, R stands for that it the response. Here, you can say what exactly you need. Provide a list of functional, negative, security test cases, edge test cases that you need, and what all things you want to add, include, or exclude, all that you can add in this response. Okay, let's try to use this. I just

### Advanced Prompt Demo (Real-World Example) [10:00]

copied it and I will paste it here. So, you can see this is what I have pasted. Exactly what we discussed and I am hitting enter and you will see it will it becomes very easy for the AI also. It will use less energy, less power because we have given all the details, the context, what exactly we need, the clarity is there, context is there, constraints are there and it makes it very easy for AI and it will be it will give you better and faster responses and you can directly use them and check them and then use them for your needs. Okay? So, this is how you can use prompts and make your prompts better and this is how we will learn prompt engineering for testing. I hope this was very useful. I will see you soon. Thank you for watching and never stop learning.
