Prompt Engineering Basics for Beginners


In today’s world of AI, anyone can become a programmer by simply giving commands to an AI model. For beginners, this feels magical—type a few lines and watch the AI generate code, write stories, or even explain complex concepts.
But there’s another side to the story. When people try to use AI for specific automation tasks like coding or testing, the excitement often turns into frustration. The AI doesn’t give exactly what we want. Why? Most of the time, the problem is not the AI—it’s the prompt we provide.
Why Prompts Matter?
At first glance, writing a prompt feels like plain English. What could possibly go wrong? The truth is—everything can go wrong if the AI doesn’t fully understand your intent.
Think of an LLM (Large Language Model) as a multi-talented professional. This professional can code, write, design, explain, or even act as a teacher. But unless you remind them of their role and boundaries, they may drift off into a different direction.
This is where context comes in.
Building Context: The Mental Model
To make an AI focus on your task, you need to layer context step by step.
Imagine a dartboard.
The center (bullseye) is your exact goal.
The outer circles represent broader context.
To hit the bullseye, you first move through the outer layers, narrowing down until the AI is perfectly aligned with your task.
Example: Generating Test Scenarios
Let’s say we want AI to generate test scenarios. Here’s how to layer the prompt:
Specify the Role of the AI
- “You are a software tester.”
Set the Domain
- “The domain is insurance.”
Narrow to a Sub-Domain
- “Focus on vehicle insurance.”
Define the Task Clearly
- “Your task is to understand the user story and generate test scenarios.”
Provide Steps or Expectations
- “Break down the task by identifying acceptance criteria, expected errors, boundary conditions, and edge cases.”
Provide Examples (if needed)
- “Here are two example test cases. Follow the same style and generate more.”
Weak Prompt vs. Strong Prompt
Weak Prompt | Strong Prompt |
“Write test scenarios for insurance.” | “You are a software tester. Focus on vehicle insurance. Based on the user story, generate positive, negative, and edge case test scenarios. Ensure you cover acceptance criteria, error handling, and boundary conditions. Here are two example test cases—continue in the same format.” |
As you can see, the strong prompt gives role + domain + subdomain + task + steps + examples. The result is usually far more relevant and usable.
Quick Checklist for Writing Better Prompts
Whenever you’re writing prompts, remember this checklist:
✅ Set the role of the AI
✅ Define the domain & subdomain
✅ State the exact task
✅ Break it into steps or rules
✅ Provide examples if needed
Conclusion
Prompt engineering is less about magic words and more about clarity and structure. By layering context—role, domain, task, steps, and examples—you’ll find that AI becomes a reliable assistant rather than a frustrating black box.
Start simple, practice often, and always remember—the better your prompts, the better your results.
Subscribe to my newsletter
Read articles from Krishna directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
