Test generated code against expected results derived independently from requirements. Do not let the implementation, its explanation and its tests all define correctness using the same unverified assumptions.
Write the oracle before reviewing code
An oracle is the rule or reference used to decide whether an output is correct. Practical editorial advice: have the requirement owner approve a small set of expected results before asking an AI tool to implement the behaviour.
For calculations, work examples out separately. For permissions, start from an approved role specification. For forms, state accepted and rejected inputs. If requirements are ambiguous, record the ambiguity rather than treating the generated behaviour as the answer.
This matters especially when an interface looks convincing: a neat total in rupees can still encode the wrong business rule.
Build expected-result records
Consider a hypothetical delivery rule: merchandise below ₹999 attracts a ₹49 delivery fee; ₹999 or more gets free delivery. Negative amounts are rejected. Assume inputs use integer paise and discounts are outside this example.
Use these records instead of a renderer-dependent table:
- Case A: input 0 paise; expected fee 4900 paise; reason: below threshold.
- Case B: input 99899 paise; expected fee 4900 paise; reason: just below threshold.
- Case C: input 99900 paise; expected fee 0; reason: threshold is inclusive.
- Case D: input 99901 paise; expected fee 0; reason: above threshold.
- Case E: input minus 1 paise; expected validation failure; reason: invalid amount.
For each record, add actual output, pass/fail, implementation identifier and evidence location. Do not replace the expected value after seeing a failure unless the requirement owner changes the rule.
Challenge the same assumption twice
Check both the calculation and the displayed result. A correct internal fee can still be displayed with the wrong unit. Test the server-facing behaviour separately where the application design requires it.
Add one mutation question: would the suite fail if “at least ₹999” became “more than ₹999”? If not, the tests are missing the decisive boundary.
Stop release when a requirement has no agreed expected result or an important boundary fails. Next, resolve the specification or fix the implementation, then rerun unchanged cases.
Use saved versions as context
Lovable documents that project content includes chat, preview, code, version history and settings, and that edits are saved automatically to version history. That history provides change context; it is not evidence that an oracle passed.
If access is needed, check the coding catalog for access format and saved terms before buying. Marketplace account/code/token offers are not proof of official subscription equivalence.
Sources and scope
Source material checked 29 October 2026; features/policies may change. Lovable project overview establishes project contents and saved edit history. The oracle method and delivery examples are editorial advice, not claimed Lovable testing capabilities.