Would you approve these AI-generated redemption tests?
Instruction: Identify the oracle problem and replace the tests with independently expected outcomes at the relevant boundaries.
The independent specification permits redemption only when age is at least 18, verification is True, and the supplied current time is strictly before expiry. All inputs are already validated: age is an integer, verification is boolean, and times are integer ticks in the same time system. The function must not read the wall clock. An AI-generated implementation uses age > 18 and now <= expires. Its test assigns expected = can_redeem(*case), then asserts a second call equals expected.
expected = can_redeem(*case)
assert can_redeem(*case) == expectedUpdated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
I would not approve that test as evidence of conformance. It asks the same implementation for both the expected and actual result, so a deterministic bug can validate itself...
Related Questions
-
easy
-
easy
-
easy
-
easy
-
easy
-
easy