Lesson 3 of 6
Drafting SAP test cases with AI
8 min
Listen to this lesson
This course discusses ACCELQ by name. Matt Angerer, who runs The Sign-Off Table, works at ACCELQ. Disclosure
Most testers will draft with a general assistant long before they have Joule in Cloud ALM. The quality of the draft depends on three things you control: what you give the model, what format you ask for, and how you check what comes back. sap-aiq-201 taught a general prompt pattern; here we apply it to the specific job of an SAP test case and to the gaps AI drafts reliably have.
Give it the right sources
- The requirement or user story with its acceptance criteria, exactly as approved. For Contoso: "Purchase orders over $25,000 require approval through flexible workflow; orders up to $25,000 are released without approval."
- The process flow: the solution process flow diagram or a text description of its steps and variants, including who does what.
- The SAP Best Practices test script for the scope item, if your process starts from one, such as J45 Procurement of Direct Materials (check the scope item and script for your release in SAP Signavio Process Navigator).
- Your configuration facts: company code 1710, plant 1710 Detroit, purchasing organization 1710, purchasing group 001, supplier Lakeside Components, material CMC-RTR-200 at a $42.00 PO price.
- Your test case template: the fields your SAP Cloud ALM upload or manual entry needs.
Tell the model that these sources are the only authority and that anything else must be marked as an assumption. That one instruction removes most invented apps and fields, because the model now has a sanctioned way to say "I don't know".
Gaps AI drafts reliably have
| Gap | What it looks like | How to catch it |
|---|---|---|
| Invented SAP detail | An app, transaction, field or message that doesn't exist or isn't activated in your system | Reviewer opens each app named in the steps in the test system; ASSUMED markers |
| Vague expected results | "The system processes the order correctly" | Require a visible outcome: document number, status, workflow item, message |
| Missing negatives | Only happy paths; no rejection, no wrong data, no missing authorization | Ask for coverage tags and count error and edge cases per requirement |
| Boundaries off by one | Tests at $20,000 and $30,000 but not $25,000.00 and $25,000.01 | Ask explicitly for both sides of every threshold |
| Missing follow-on documents | Stops at the purchase order; ignores goods receipt, invoice, accounting document | Give the full process flow and ask what each step creates |
| Wrong org data | Generic company codes and plants from training data | Supply configuration facts and check every org value against them |
| Copied requirement errors | The test case faithfully repeats an error in the requirement | Review with the process owner, not just against the requirement |
Seven gaps to look for in any AI-drafted SAP test case.
| Element | Weak AI draft | Reviewed test case |
|---|---|---|
| Title | Test PO approval | PO at $25,000.01 goes to approval; PO at $25,000.00 does not |
| Precondition | User is logged in | Supplier Lakeside Components and material CMC-RTR-200 exist for purchasing org 1710; approver set up in flexible workflow |
| Step | Create a purchase order | Create a purchase order for supplier Lakeside Components, purchasing group 001, net value $25,000.01, and save |
| Expected result | PO is created successfully | PO number issued; status shows it awaiting approval; workflow item appears in the approver's inbox |
| Coverage | Not stated | Edge: upper side of the $25,000 threshold |
The quantities are left for the tester to choose: CMC-RTR-200 at $42.00 does not divide evenly into $25,000.01, so the case needs a price or quantity that hits the exact value, which is the kind of detail the review settles. Write it into the test data rather than leaving it to the tester on the day.
What would you do?
An AI draft for Contoso's PO approval includes a step "Run transaction ME29N to approve the order." Contoso uses flexible workflow for purchase order approval, configured for Fiori. What should the reviewer do?
- Give the model the requirement, process flow, Best Practices script, configuration facts and your template, and tell it they are the only authority.
- Ask for coverage tags, both sides of every threshold and expected results a tester can see in the system.
- Check every AI draft for invented detail, vague results, missing negatives, boundaries, follow-on documents, org data and copied requirement errors.
- When the rule itself looks wrong, fix the requirement with the process owner, not the prompt.
Check your understanding · not graded
Lesson check
1. What does telling the model its sources are the only authority, with ASSUMED markers, achieve?
2. Which expected result is acceptable for a test case?
3. Which pair of values tests the $25,000 PO approval threshold properly?
4. A draft faithfully follows a requirement that contains a wrong rule. Which check catches it?