Practical Example: AI Agent Appointment Booking
Let’s understand the testing process using a simple example.
Assume an AI agent can book doctor appointments through an appointment management API.
The user asks:
“Book an appointment with Dr. Sharma tomorrow at 10 AM.”
The QA tester needs to validate the agent’s behavior at different stages.
| Test Case | Action | Expected Result |
|---|---|---|
| TC01 | Request a booking for an available slot | Correct appointment is booked |
| TC02 | Request an unavailable slot | Agent offers alternatives or explains unavailability |
| TC03 | Provide an invalid date | Agent requests a valid date |
| TC04 | Request a booking without identifying the required doctor or clinic | Agent asks for the missing details |
| TC05 | Request a booking without required authorization | Booking is rejected or approval is requested |
| TC06 | Simulate a booking API timeout | Agent verifies the status before retrying |
| TC07 | Repeat the same booking request | Duplicate bookings are prevented when required by the design |
| TC08 | Ask the agent to cancel a booking belonging to another user | Unauthorized cancellation is prevented |
| TC09 | Make the notification service fail after booking | The actual booking status remains accurate, and notification failure is reported |
| TC10 | Complete the booking workflow | Booking details and confirmation are consistent |
These scenarios cover positive, negative, security, boundary, and failure-handling behavior.
The exact expected result should always be aligned with the application’s requirements.
Sample Detailed Test Case
Here is one detailed test case you can use as a starting point.
Test Case ID: AI_AGENT_TC_001
Test Scenario: Verify that the AI agent books an available appointment correctly.
Preconditions:
- The user is authenticated.
- The user has permission to book appointments.
- Dr. Sharma has an available slot tomorrow at 10 AM.
- The booking service is working correctly.
Test Steps:
- Open the AI agent interface.
- Enter: “Book an appointment with Dr. Sharma tomorrow at 10 AM.”
- Observe how the agent interprets the request.
- Verify the doctor, date, time, and other required booking details.
- Complete any required confirmation step.
- Verify the tool call and its parameters in the available test logs.
- Check the appointment database or API response.
- Verify the final message displayed to the user.
Expected Results:
- The agent identifies the correct doctor and requested time.
- The agent asks for missing information or confirmation if required.
- The booking tool receives the correct parameters.
- Exactly one intended appointment is created.
- The stored appointment details are accurate.
- The agent reports success only after verifying that the booking succeeded.
Priority: High
Test Type: Functional, Integration, and AI Agent Testing