Files
louiscklaw dc9c9468ce update,
2025-02-01 02:00:51 +08:00

29 KiB

ID Test Case Name Procedure Expected Output Screen Dump Result
1 Display all employees in the system 1. Start program.
2. input 1 for display all employee
All employees' information including their employee ID, name, salary and department should be displayed

Pass/ Fail
2 Add an employee with name "Pika Chiu, salary 15000 and wortks in IT department into the system 1. In the employee management system menu, input '2' to add an employee
2. Input 'Pika Chiu' for employee's name Input "15000" for salary
3. Input "IT" for IT department
A success message "Employee Added Successfully" should be displayed

Pass/ Fail
3 Remove an employee with valid employee id 1. In the employee management system menu, input '3' to Remove an employee
2. Input 'IVE00006' for employee's id
A success message "Employee Removed Successfully" should be displayed

Pass/ Fail
4 Update an employee with valid employee id 1. In the employee management system menu, input '4' to Update an employee
2. Input 'IVE00005' for employee's id
3. Input '99999' for employee's salary
A success message "Employee Updated Successfully" should be displayed

Pass/ Fail
5 Display company statistics 1. In the employee management system menu, input '5' to Update an employee
1. a list of all employee information listed
2. total number of staff listed
3. staff with highest salary listed
4. staff with lowest salary listed
5. average salary listed


Pass/ Fail
6 exiting system 1. In the employee management system menu, input "ENTER"(enter key) to exit system
1. system exit


Pass/ Fail
7 main menu invalid input handling 1. In the employee management system menu, input "~" to main menu
1. screen showing "input digit contains non-int value, accepted values are 1,2,3,4,5" alert to user


Pass/ Fail
8 main menu invalid input handling 1. In the employee management system menu, input "a" to main menu
1. screen showing "input digit contains non-int value, accepted values are 1,2,3,4,5" alert to user


Pass/ Fail
9 Add an employee (invalid employee name) 1. In the employee management system menu, input '2' to add an employee
2. Input 'a1' for employee's name (this is invalid name)
3. Input '123' for employee's name (this is invalid name)
4. Input '4a' for employee's name (this is valid name)
5. Input 'apple' for employee's name (this is valid name)
6. Input "99999" for salary
7. Input "IT" for IT department

1. showing "ERROR: sorry but the employee name should not contain digit" alert to user
2. keep asking "Please input employee's name, Enter to return:" until valid name get
3. after getting apple as name, get back to normal employee adding flow


Pass/ Fail
10 Add an employee (invalid employee salary) 1. In the employee management system menu, input '2' to add an employee
2. Input 'apple' for employee's name (this is valid name)
3. Input "aaaaa" for salary (invalid input as contains text)
4. Input "11111" for salary (valid input)
5. Input "IT" for IT department

1. showing "ERROR: Employee's salary contains non digit value" alert to user
2. keep asking "Please input employee's salary, Enter to return:" until valid salary get
3. after getting valid salary, get back to normal employee adding flow


Pass/ Fail
11 Add an employee (invalid employee department) 1. In the employee management system menu, input '2' to add an employee
2. Input 'apple' for employee's name (this is valid name)
3. Input "11111" for salary (valid input)
4. Input "Marketing" (invalid input)
5. Input "IT" (valid input)

1. showing "ERROR: Not a valid department, the valid options are HR, IT, Admin, Finance" alert to user
2. keep asking "Please input employee's department, Enter to return:" until valid department get
3. after getting valid department, show "* Employee Added Successfully"


Pass/ Fail
12 Remove an employee (invalid employee id, not existing) 1. In the employee management system menu, input '3' to remove an employee
2. Input 'IVE00007' for employee's id (this is invalid id, not exist)
2. Input "IVE00006" for employee's id (valid input, existing id)

1. showing "ERROR: sorry but the input id not found" alert to user
2. keep asking "Please input employee's id, Enter to return:" until valid id get
3. after getting valid id, show "* Employee Removed Successfully"


Pass/ Fail
13 Remove an employee (invalid employee id, invalid format) 1. In the employee management system menu, input '3' to remove an employee
2. Input 'III00007' for employee's id (this is invalid id, not exist)
2. Input "IVE00006" for employee's id (valid input, existing id)

1. showing "ERROR: sorry but the input id not found" alert to user
2. keep asking "Please input employee's id, Enter to return:" until valid id get
3. after getting valid id, show "* Employee Removed Successfully"


Pass/ Fail
14 Remove an employee (invalid employee id, invalid format) 1. In the employee management system menu, input '3' to remove an employee
2. Input 'a' for employee's id (this is invalid id)
2. Input "IVE00006" for employee's id (valid input, existing id)

1. showing "ERROR: sorry but the input id not found" alert to user
2. keep asking "Please input employee's id, Enter to return:" until valid id get
3. after getting valid id, show "* Employee Removed Successfully"


Pass/ Fail
15 Remove an employee (invalid employee id, invalid format) 1. In the employee management system menu, input '3' to remove an employee
2. Input '11111111' for employee's id (this is invalid id)
3. Input "IVE00006" for employee's id (valid input, existing id)

1. showing "ERROR: sorry but the input id not found" alert to user
2. keep asking "Please input employee's id, Enter to return:" until valid id get
3. after getting valid id, show "* Employee Removed Successfully"


Pass/ Fail
16 Update an employee (invalid employee id, invalid format) 1. In the employee management system menu, input '4' to update an employee
2. Input '1' for employee's id (this is invalid id)
3. Input "IVE00006" for employee's id (valid input, existing id)
4. Input "11111" for employee's id (valid input)

1. showing "ERROR: sorry but the input id not found" alert to user
2. keep asking "Please input employee's id, Enter to return:" until valid id get
3. after getting valid id, get back to normal update employee flow


Pass/ Fail
17 Update an employee (invalid salary) 1. In the employee management system menu, input '4' to update an employee
2. Input "IVE00006" for employee's id (valid employee id, existing id)
3. Input "a" for salary (invalid input, salary cannot be non integer value)
4. Input "$" for salary (invalid input, salary cannot be non integer value)
5. Input "111" for salary (value input, integer value only)

1. showing "ERROR: Employee's salary contains non digit value" alert to user
2. keep asking "Please input employee's salary, Enter to return:" until valid salary get
3. after getting valid salary, show "* Employee Updated Successfully" to user


Pass/ Fail
18 display highest salary 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '2' to add an employee
3. Input "highest_employee" for name (valid employee name)
4. Input "9999999" for salary (valid highest salary)
5. Input "IT" for department (valid department)
6. Input "5" to check the highest salary got updated

1. showing "highest_employee" in staff name field with highest salary


Pass/ Fail
19 display lowest salary 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '2' to add an employee
3. Input "lowest_employee" for name (valid employee name)
4. Input "10" for salary (valid lowest salary)
5. Input "IT" for department (valid department)
6. Input "5" to check the lowest salary got updated

1. showing "lowest_employee" in staff name field with lowest salary


Pass/ Fail
20 update statistics after adding user 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '2' to add an employee
3. Input "new_user" for name (valid employee name)
4. Input "10" for salary (valid high salary)
5. Input "IT" for department (valid department)
6. Input "5" to check the lowest salary got updated

1. number of staff = "6" + "1" = "7"


Pass/ Fail
21 update statistics after remove user 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '3' to remove an employee
3. Input "IVE00006" for id (valid employee id)

1. number of staff = "6" - "1" = "5"


Pass/ Fail
22 update average after adding user 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '2' to add an employee
3. Input "new_user" for name (valid employee name)
4. Input "10" for salary (valid high salary)
5. Input "IT" for department (valid department)
6. Input "5" to check the average salary got updated

1. average salary changed from $19814.78 to $16,985.53 (average of "7" employee)


Pass/ Fail
23 update average after remove user 1. In the employee management system menu, input '5' get current snap of employee table
2. In the employee management system menu, input '3' to add an employee
3. Input "IVE00001" for id (valid employee id)
4. Input "5" to check the average salary got updated

1. average salary changed from $19814.78 to $15135.64 (average of "5" employee)


Pass/ Fail
24 add employee (cancelling) 1. In the employee management system menu, input '2' to add an employee
2. Input "ENTER"(one key) for name (cancelling the add flow)

1. showing "* Employee Add cancelled"
2. back to the main menu


Pass/ Fail
25 add employee (cancelling) 1. In the employee management system menu, input '2' to add an employee
2. Input "apple" for name (valid name)
3. Input "ENTER"(one key) for name (cancelling the add flow)

1. showing "Please input employee's name, Enter to return:"
2. after receiving valid name, showing "Please input employee's salary, Enter to return:"
3. after pressing "ENTER"(one key), showing "* Employee Add cancelled"
4. back to the main menu


Pass/ Fail
26 add employee (cancelling) 1. In the employee management system menu, input '2' to add an employee
2. Input "apple" for name (valid name)
3. Input "100" for salary (valid salary)
4. Input "ENTER"(one key) for department (cancelling the add flow)

1. showing "Please input employee's name, Enter to return:"
2. after receiving valid name, showing "Please input employee's salary, Enter to return:"
3. after receiving valid salary, showing "Please input employee's department, Enter to return:"
4. after pressing "ENTER"(one key), showing "* Employee Add cancelled"
5. back to the main menu


Pass/ Fail
27 remove employee (cancelling) 1. In the employee management system menu, input '3' to remove an employee
2. Input "ENTER"(one key) for id (cancelling the remove flow)

1. showing "* Employee remove cancelled"


Pass/ Fail
28 update employee (cancelling) 1. In the employee management system menu, input '4' to update an employee
2. Input "ENTER"(one key) for id (cancelling the update flow)

1. showing "* Employee update cancelled"


Pass/ Fail
29 update employee (cancelling) 1. In the employee management system menu, input '4' to update an employee
2. Input "IVE00006" for name (valid name)
3. Input "ENTER"(one key) for salary (cancelling the update flow)

1. showing "Please input employee's id, Enter to return:"
1. showing "Please input employee's salary, Enter to return:"
1. after pressing "ENTER"(one key),
1. showing "* Employee update cancelled"


Pass/ Fail