Development with AWS Services

An AI assistant generates a pricing function and tests that all pass, but both apply a discount before tax contrary to the approved requirements. Which change BEST prevents this shared error from escaping validation?

Show the answer

Correct answerA. Derive expected results independently from the approved business requirements.

AWhy this is right: Requirement-derived expected results provide an independent check on generated behavior.

BWhy not this: A realistic environment does not correct expected results based on the wrong pricing rule.

CWhy not this: Using the generated function as the oracle reproduces its incorrect pricing rule.

DWhy not this: Greater branch coverage can exercise every path without checking the intended business behavior.

Independent expected results grounded in approved requirements can expose a shared mistake in generated code and tests. More coverage does not establish correctness when the test oracle repeats the implementation's error.