TEST CASES FOR HOSPITAL MANAGEMNET SYSTEM
1. Login & Authentication Module
Test Case
Test Scenario Test Steps Expected Result
ID
Enter valid username & password → Click
TC001 Valid login User redirected to dashboard
“Login”
Display “Invalid credentials”
TC002 Invalid login Enter invalid username/password
error
Leave username/password empty →
TC003 Empty fields Display validation message
Click “Login”
Password
TC004 Check if password is hidden while typing Password characters hidden
masking
Session User session expires, redirect
TC005 Stay idle for long → try action
timeout to login
2. Patient Management Module
Test Case
Test Scenario Test Steps Expected Result
ID
TC101 Add new patient Enter valid patient details → Save Patient record created
Duplicate patient Show “Patient already exists”
TC102 Add patient with same ID
entry error
Select patient from list → Click
TC103 View patient details Show correct patient info
“View”
Updated info displayed
TC104 Edit patient details Edit name/address → Save
correctly
Select patient → Click “Delete” →
TC105 Delete patient record Patient removed from system
Confirm
TC106 Search patient Enter patient name or ID Matching records displayed
Mandatory fields Error messages shown for
TC107 Leave required fields blank
validation missing data
3. Doctor Management Module
Test Case
Test Scenario Test Steps Expected Result
ID
TC201 Add doctor Enter valid details → Save Doctor record created
Assign Select specialization →
TC202 Doctor assigned successfully
specialization Save
TC203 View schedule Open doctor schedule Correct appointments shown
Doctor no longer appears in active
TC204 Deactivate doctor Change status to inactive
lists
4. Appointment Scheduling
Test Case
Test Scenario Test Steps Expected Result
ID
Select patient, doctor, date/time →
TC301 Book appointment Appointment booked
Confirm
Show “Slot
TC302 Book slot already taken Try booking at same time
unavailable”
Reschedule
TC303 Change time/date → Save Appointment updated
appointment
TC304 Cancel appointment Click “Cancel” → Confirm Appointment removed
View appointment
TC305 Select patient → View appointments Show correct list
history
5. Pharmacy / Medicine Management
Test Case
Test Scenario Test Steps Expected Result
ID
Enter name, batch, expiry, price → Medicine added to
TC401 Add medicine
Save inventory
Select patient & medicine →
TC402 Issue medicine Stock reduced accordingly
Confirm
TC403 Expiry date check Add expired medicine Show “Invalid expiry date”
Test Case
Test Scenario Test Steps Expected Result
ID
TC404 Low stock alert Medicine quantity < threshold Alert shown to admin
Update medicine
TC405 Edit price → Save Updated in database
details
6. Billing & Payments
Test Case
Test Scenario Test Steps Expected Result
ID
Add services/medicines → Generate
TC501 Generate patient bill Bill generated accurately
bill
Bill total reduced
TC502 Apply discount Enter discount → Save
accordingly
TC503 Partial payment Enter partial amount → Save Remaining balance shown
Invalid payment
TC504 Select invalid mode Error message displayed
mode
TC505 Print receipt Click “Print” Printable bill generated
7. Room / Bed Management
Test Case ID Test Scenario Test Steps Expected Result
TC601 Assign room to patient Select patient → Assign room Room allocated successfully
TC602 Check room availability Search available rooms Correct available list displayed
TC603 Release room Discharge patient → Confirm Room marked as available
TC604 Overbooking test Assign occupied room Error: “Room already occupied”
8. Reports Module
Test Case ID Test Scenario Test Steps Expected Result
TC701 Generate daily report Select “Daily report” → Generate Accurate data shown
TC702 Export to Excel/PDF Click “Export” File downloaded correctly
TC703 Invalid date range Select invalid range Show validation error
9. Security & Access Control
Test Case ID Test Scenario Test Steps Expected Result
TC801 Role-based access Login as nurse → Try admin page Access denied
TC802 SQL injection test Enter ' OR 1=1 -- in login field System prevents injection
TC803 Password change Enter old + new password Password updated successfully
10. System & Performance Tests
Test Case
Test Scenario Test Steps Expected Result
ID
100+ users login
TC901 Load test System remains stable
simultaneously
TC902 Data backup Run backup function Backup completes successfully
TC903 Recovery test Restore from backup Data restored correctly
Browser Interface consistent across
TC904 Test on Chrome, Edge, Firefox
compatibility browsers
TYPES OF TESTING
1. Black Box Testing
Definition:
Testing the system’s functionality without knowing the internal code or logic.
Purpose:
To verify that the HMS meets the user requirements and business rules.
Examples in HMS:
Area Example Test
Login Check valid/invalid credentials
Patient Module Verify new patient registration
Appointment Check that two patients cannot book same doctor/time
Billing Verify total and tax calculations
Reports Check report generation for a given date range
Techniques Used:
Equivalence Partitioning:
Divide input data (e.g., age, bill amount) into valid and invalid partitions.
Boundary Value Analysis:
Test at limits (e.g., age = 0, 1, 120).
Decision Table Testing:
Verify output for di erent combinations (e.g., patient type + insurance type).
State Transition Testing:
Check transitions — for example, from Appointment Booked → Cancelled → Completed.
2. White Box Testing
Definition:
Testing the internal structure, logic, and code of the HMS.
Purpose:
To ensure that all code paths, conditions, and loops work correctly.
Examples in HMS:
Area Test Focus
Billing Module Check internal formula for total = (consultation + medicine + tax)
Authentication Verify encryption and session handling in code
Report Generation Check logic for filtering by date and department
Error Handling Verify that exceptions are properly caught
Techniques Used:
Statement Coverage: Ensure every line of code executes at least once.
Branch Coverage: Test all “if-else” conditions.
Path Coverage: Verify all possible execution paths.
Loop Testing: Ensure loops (e.g., patient record iteration) terminate properly.
3. Gray Box Testing
Definition:
Combines both Black Box and White Box testing — partial knowledge of system internals.
Purpose:
To test data flow and integration between di erent modules.
Examples in HMS:
Check how patient data passes from Registration → Appointment → Billing.
Verify if updates in the Doctor module reflect correctly in Appointment scheduling.
Validate database queries and stored procedures for correct data retrieval.
4. Unit Testing
Definition:
Testing individual components or modules of the HMS in isolation.
Purpose:
To ensure that each module (like Login, Registration, Billing) works correctly by itself.
Examples in HMS:
Test function calculateTotalBill()
Test method validatePatientDetails()
Test class DoctorSchedule()
Tools Used: JUnit, NUnit, PyTest (depending on language used)
5. Integration Testing
Definition:
Testing how di erent modules interact and exchange data.
Purpose:
To detect interface defects between linked modules.
Examples in HMS:
Integration What to Test
Patient ↔ Appointment Check that correct patient info is displayed during booking
Appointment ↔ Doctor Verify doctor’s schedule updates dynamically
Doctor ↔ Pharmacy Test that prescribed medicines are available in stock
Billing ↔ Reports Confirm that generated reports reflect correct billing data
Techniques:
Top-Down Integration
Bottom-Up Integration
Big Bang Integration
6. System Testing
Definition:
Testing the entire HMS as a complete system.
Purpose:
To ensure that the system meets both functional and non-functional requirements.
Examples:
End-to-end workflow: Patient registration → Appointment → Billing → Report
Check performance under load
Validate backup and recovery functionality
7. Regression Testing
Definition:
Re-testing the system after changes to ensure that new updates haven’t broken existing features.
Examples in HMS:
After adding a new “Online Payment” module, verify that old billing still works.
After UI redesign, test that appointment booking still functions correctly.
Tools Used: Selenium, TestNG, Jenkins (for automation)
8. Performance Testing
Definition:
Evaluating the speed, scalability, and stability of the HMS under varying load.
Examples:
How long it takes to book an appointment under 100 simultaneous users.
How billing response time changes when database size increases.
How quickly reports generate for large patient datasets.
Subtypes:
Load Testing
Stress Testing
Endurance Testing
Tools Used: JMeter, LoadRunner
9. Security Testing
Definition:
Ensuring confidentiality, integrity, and protection of sensitive medical and personal data.
Examples:
Check for SQL injection in login and search fields.
Verify HTTPS and SSL encryption.
Test access control (e.g., patients can’t access admin panels).
Validate password hashing and token expiration.
Tools Used: OWASP ZAP, Burp Suite, Acunetix
10. Usability Testing
Definition:
Evaluating the user-friendliness and ease of navigation for doctors, nurses, and receptionists.
Examples:
Check that patient registration can be completed within 2–3 clicks.
Test readability of forms on desktop and tablet.
Ensure clear labeling and consistent icons.
11. Compatibility Testing
Definition:
Testing the HMS on di erent browsers, operating systems, and devices.
Examples:
Verify if the system works on Chrome, Firefox, and Edge.
Test UI rendering on mobile and tablet screens.
Check print formats of reports across devices.
12. Acceptance Testing (UAT)
Definition:
Testing conducted by end-users (hospital sta ) to validate that the system meets business
requirements.
Examples:
Doctor confirms that appointment view is accurate.
Pharmacist verifies stock deduction after billing.
Accountant checks that reports match manual records.