After writing code with AI, check that the implementation meets the requirements. Running only examples of normal input can miss important conditions such as boundary calculations, error handling order and input mutation. Choose one small feature and connect its requirements to verification results.
1. Write down the input and output contract first
Check function names, arguments and return values, allowed number and date ranges, and whether external packages or network access are permitted. Return values for invalid input are also part of the contract. Leave unspecified behavior as a question for the requirements author rather than deciding it arbitrarily.
For a coupon feature, identify conditions such as minimum order value, expiration time, previously used coupons and discount caps. Check the source for whether equality passes or fails and how ratio calculations are rounded. Do not assume these conditions apply equally to other services.
2. Separate values before, at and after each boundary
As a hypothetical example, if a feature allows values from 0 to 10 inclusive, you can check points inside and outside the range and at its endpoints, such as -1, 0, 1, 9, 10, 11. These are hypothetical numbers to explain a verification technique, not hidden tests or actual verification results from an Apdex challenge.
Different date strings can represent the same instant, so distinguish display strings from comparison criteria. For amounts, check integers, decimals, out-of-range values and incorrect types against the source requirements.
3. Check cases where two conditions occur together
If two reasons occur together, such as an insufficient amount and expiration, which error should be returned first? Verify the order if the source specifies a priority. An implementation that passes each condition separately can still violate the contract in combination. Derive expected values independently from the requirements before comparing them with actual results; do not copy the implementation's output.
4. Check input preservation and repeated execution
If input mutation is prohibited, compare objects and arrays before and after execution. If the same input must produce the same result, also check for fresh clock reads during execution or reliance on external state. Do not add these conditions as grading criteria to problems that do not require repeatability.
5. Recheck previously passing conditions after a fix
Fixing only a failed item can change other conditions. Record the revised code version and execution environment, and rerun related earlier checks. Distinguish build failures, timeouts and checks that could not be run from wrong answers produced by normal execution. Never record “not run” as a pass.
6. Keep a short evidence table
Fill in the template below yourself. Blank cells mean verification has not yet occurred.
| Source condition and location | Input or situation | Expected result specified by the source | Actual result | Environment and code version | Verdict and remaining limitations |
|---|---|---|---|---|---|
| [Condition] | [Input] | [Expected] | [Fill in after running] | [Environment/version] | [Pass/fail/not run] |
This table explains the scope you checked. Completing it does not prove correctness for every input. Generated tests can also have incorrect expected values, so compare key conditions with the source again.
Practice with a public challenge
Read the public requirements and evaluation criteria in Shopping cart coupon engine on Apdex and try building a verification table. This problem uses a submission specification for applyCoupon in coupon.ts. Other coding problems may have different submission specifications. Check the problem's latest instructions for materials, formats and versions.
In submission results, check the actual evaluation method and policy version shown on screen. Distinguish results assessed by AI quality evaluation from older results awaiting human review, and do not read a provisional state as a final evaluation. The Apdex-style rubric index does not mean actual user satisfaction or the success rate of reuse in other projects. See the Wiki for sign-in requirements for viewing problems and submitting solutions.