Task 03 Task 03 Functional error finding practice guide
📥 Practice Input
- •
day7_meeting_notes.md(meeting minutes)
💾 Practice output (Output)
- •
day7_robust_validation.js
1. Story and practice background
On the night of deployment of the reservation app, which had completed connecting payment functions, an alarm went off. Server errors were occurring due to multiple reservations for the same time slot for the same person in the database reservation list. When I opened the source code, the reservation registration function worked honestly, but when an impatient customer double-clicked the 'Confirm Reservation' button on the payment confirmation page, there was no lock device to prevent duplicate submissions, so duplicate data was inserted into the DB.
Even if you press the development completion button, if abnormal or exceptional behavior intervenes, the function will be instantly broken. In this exercise, Codex AI is used as an auditor to conduct a mock test on the completed reservation and login processing function file `day7_feature_validation.js`, assuming abnormal symptoms such as duplicate clicks, insertion of special characters, and abnormal session expiration. Tips for blocking points that can cause defects are provided.
2. Learning objectives
- In addition to correct data entry scenarios, functional defects caused by anomalies (exceptional situations) can be predicted.
- Can explain guard codes for preventing duplicate entry of the same data (Debounce/Throttle) and blocking input values.
- By using AI vulnerability analysis results, you can create robust logic that preemptively prevents errors.
🛠️Practical guide to follow along
- Create file for practice: Click the download button below
day7_meeting_notes.mdfileautomation/Save it within the folder. - Codex Vulnerability Check: Passes the error-causing code to the Codex Client and requests it to create a date validity period collation and button lock.
- Lock mechanism test: Apply the created double submission lock variable `isSubmitting` code and the disabled element and test to see if duplicate registration is blocked.
Download practice materials
Codex request prompt
Task 03 Prompt
Please review the reservation request logic in the provided day7_feature_validation.js file. Please suggest a final verification code that detects 1) the vulnerability of duplicate reservation requests (button pressing) and 2) the possibility of application errors in the past of the reservation date, and adds the disabled state processing and date validity period check to prevent these.
4. Example results
Codex analyzes the meeting transcript and outputs normalized data entity mappings and a Mermaid ERD script as shown below.
| file name | guard logic | Action type | prevent defects |
|---|---|---|---|
| day7_robust_validation.js | isSubmitting lock variable and date collation | Button disabled setting, past date warning | Duplicate repeated hits and past dates accepted randomly |
5. AI utilization points
- Abuse prediction: Estimates the script crash point that will be induced by user actions (multiple hitting, empty input, incorrect format) rather than normal data passage.
- Effectiveness policy design: Check and write in advance the logical structure (Logic Boundary) that must be blocked due to business logic, such as past visual blocking.