The fictional quoting rules
These are practice rules, entirely fictional:
- Base production fee: 200 CNY per item
- No discount for up to 10 items; 5% off for 10–49 items; 10% off for 50 items or more
- If rush delivery is needed (delivered within 3 days), add 10% of the total
- When a single order’s total exceeds 5000 CNY, shipping is free; otherwise shipping is 30 CNY
Three sets of test inputs (fictional)
| Quantity | Rush | Expected result |
|---|---|---|
| 5 items | No | Base 1000 + shipping 30 = 1030 CNY |
| 30 items | No | 6000 × 0.95 = 5700 + free shipping = 5700 CNY |
| 60 items | Yes | 12000 × 0.9 = 10800 × 1.1 = 11880 + free shipping = 11880 CNY |
Calculate these three sets correctly with a calculator first, then have AI build it. Clear expected results are what make checking possible.
Step one: write the requirements on one page
The requirement note has three things: input (quantity, whether it’s a rush order), rules (the four above), output (price, discount, shipping, rush fee, total and a one-line explanation). Then write three boundaries: what happens if the quantity is 0 or negative, what happens if it exceeds 9999 items, and how the result is rounded.
Step two: have AI generate the first version
Send the one-page note and the three sets of test inputs to AI together, ask it to first generate a web page that outputs a result from the inputs, and to self-check against the three test sets. After you get the first version, don’t rely on its “self-check passed” — click through it yourself.
Step three: check against the manual result
Enter each of the three test inputs once and compare item by item with the expected results above: base price, discount, shipping, rush fee, total. If any item doesn’t match, write back “what was input, what was expected, what was actually returned” and have AI fix it. After the fix, rerun all three.
Step four: add edge cases
Once the three sets match, try the boundaries: enter 0, -3 and 10000, and see whether it gives an error message or a strange number. What boundaries need is a clear message, not a silently wrong price.
Step five: check, publish, keep a record
- Check: is the amount rounded to the cent, is the explanation clear
- Publish: put it at an address people can reach and have a colleague try it
- Record: save the rules, test cases and change log as a document; next time you change the rules, change the document first, then the tool
What this case practises
It isn’t “building a quoting tool” but four things: writing rules that only you understand as requirements someone else can implement, checking with test cases, handling boundary cases, and recording the method for reuse. These four carry over to the next task.
Questions
Is this a real client project?
It is a fictional paper-based teaching example. The quoting rules, orders and amounts are all practice data and do not point to any real client or business.
Why not just use spreadsheet formulas?
A spreadsheet is great for personal calculation; making it a small web tool gives colleagues or clients an entry point that does not touch formulas, and it practises writing the rules clearly and checking boundaries. Whether to make it a web page depends on who uses it.
Can a complete beginner follow this?
Yes. The point of the example is to state the rules clearly, have AI generate it, then check against the manual result; AI writes the formulas and the page, and you check them.