Task 03 Task 03 Find Feature Errors Lab Guide
📥 Lab input
- •
day7_meeting_notes.md(meeting notes)
💾 Lab output
- •
day7_robust_validation.js
1. Story and lab background
On the night the booking app with payment was released, the alarm went off. The same person was booked twice for the same time slot, and server errors were pouring in. Looking at the code, the booking function worked as written — but when an impatient customer double-clicked 'Confirm booking' on the payment confirmation page, there was no Lock to prevent duplicate submits, so duplicate data went into the DB.
Even after you press "dev done," features break instantly when abnormal or exceptional actions come in. In this lab, you use Codex AI as an auditor to run mock tests on the finished booking and login function file `day7_feature_validation.js`, assuming abnormal situations like double clicks, special characters and unexpected session expiry, and get ways to block likely defect points.
2. Learning goals
- Predict feature defects caused by abnormal behavior (exceptions), beyond correct input scenarios.
- Explain guard code that blocks duplicate entry (Debounce/Throttle) and bad input.
- Use AI's weakness analysis to write solid logic that prevents errors in advance.
🛠️ Follow-along lab guide
- Create the lab file: press the download button below and save
day7_meeting_notes.mdin theautomation/folder. - Codex weakness check: give the error-causing code to Codex Client and ask it to write date validity checks and a button lock.
- Test the Lock mechanism: apply the generated double-submit lock variable `isSubmitting` and disabled element, then test that duplicate bookings are blocked.
Download lab materials
Codex request prompt
Task 03 Prompt
Review the booking request logic in the provided day7_feature_validation.js. Detect 1) the weakness of duplicate booking requests (rapid button clicks) and 2) the chance of errors from booking dates in the past, and suggest final validation code that adds a Disabled state and date validity checks to prevent them.
4. Example output
Codex analyzes the meeting notes and outputs a normalized data entity mapping and Mermaid ERD script like below.
| File | Guard logic | Behavior | Defect prevented |
|---|---|---|---|
| day7_robust_validation.js | isSubmitting lock variable and date check | Set button disabled, warn on past dates | Rapid repeat clicks and past dates accepted |
5. AI use points
- Predict Abuse: estimates where user actions outside the normal data path (rapid clicks, empty input, wrong formats) will cause script crashes.
- Validation policy design: checks and writes in advance the Logic Boundaries the business must obviously block, like past times.