Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this class diagram clearly define: 12 unit tests (12 pts) 7 integration test

ID: 3828191 • Letter: F

Question

For this class diagram clearly define:

12 unit tests (12 pts)

7 integration tests (14 pts)

1 system test (10 pts)

For the integration and unit tests you may submit either a description of each test or pseudocode. All pseudocode must be commented.

Hints

Make sure to provide a goal for each test along with the expected result(s).

Remember to test that your system passes when it should AND fails when it should.

Make sure to describe how your system tests should be run.

Library -location -librarian id Librarian details librarian id tissue status0 +complaints resolution() -tracking() +calculate fine0 +vendor request0 *payment) general user +register() books database -author book id +update() user vendor -details -book details -user id K +search() +search() +supply book +request() +payment details +complaints +pay fine() registered user +login() +history 0 +unregister()

Explanation / Answer

Answer:

1. Unit test cases: See the test cases below

i) Test case id: 1
   Test case name: Unit test for a user
   Goal: To test whether a user can be created or not.
   Expected Result: The user should be successfully created.
   Description: Try to create a new user with required details. If successful, user will be created, otherwise
   an appropriate message should be displayed.
ii) Test case id: 2
   Test case name: Unit test for general user
   Goal: To test whether a general user can register or not.
   Expected Result: The user should be able to register.
   Description: First create a new user with required details. Then call register() method of "general user"
   class to register the user. After execution of this method, user should be successfully registered. If not,
   then an appropriate message should be displayed.
iii) Test case id: 3
   Test case name: Unit test for registered user
   Goal: To test whether a user is registered or not.
   Expected Result: Serach for a registered user should be successful.
   Description: Call search() method for a given user. If user exists, search will return successful,
   otherwise unsuccessful.
iv) Test case id: 4
   Test case name: Unit test for registered user
   Goal: To test whether a registered user can login or not.
   Expected Result: The user should be able to login.
   Description: For a given registered user, call login() method of "registered user"
   class to login the user. After execution of this method, user should be successfully logged in. If not,
   then an appropriate message should be displayed.
v) Test case id: 5
   Test case name: Unit test for registered user
   Goal: To test whether a registered user can ungister or not.
   Expected Result: The user should be able to ungister.
   Description: For a given registered user, call unregister() method of "registered user"
   class to unregister the user. After execution of this method, user should be successfully ungistered. If not,
   then an appropriate message should be displayed.
vi) Test case id: 6
   Test case name: Unit test for vendor
   Goal: To test whether a vendor user can supply books or not.
   Expected Result: The vendor should be able to supply books.
   Description: For a given vendor, call supplybook() method of "vendor" class to accept order to supply books.
   After execution of this method, order for supplying books should be successfully recorded. If not, then an
   appropriate message should be displayed.
vii) Test case id: 7
   Test case name: Unit test for librarian
   Goal: To test whether a librarian user can issue status or not.
   Expected Result: The librarian should be able to issue status.
   Description: Call issuestatus() method of "librarian" class to issue the status. After execution of this method,
   status should be successfully reported. If not, then an appropriate message should be displayed.
viii)Test case id: 8
   Test case name: Unit test for librarian
   Goal: To test whether a librarian user can calculate fine or not.
   Expected Result: The librarian should be able to calculate fine.
   Description: Call calculatefine() method of "librarian" class to calculate fine. After execution of this method,
   applicable fine should be successfully calculated. If not, then an appropriate message should be displayed.
ix)Test case id: 9
   Test case name: Unit test for vendor
   Goal: To test whether a vendor user can provide payment details or not.
   Expected Result: The vendor should be able to provide payment details.
   Description: For a given vendor, call paymentdetails() method of "vendor" class to display payment details.
   After execution of this method, respective payment details should be successfully displayed. If not, then
   an appropriate message should be displayed.
x) Test case id: 10
   Test case name: Unit test for librarian
   Goal: To test whether a librarian user can perform tracking or not.
   Expected Result: The librarian should be able to perform tracking.
   Description: Call tracking() method of "librarian" class to display tracking details. After execution of this method,
   respective tracking details should be successfully displayed. If not, then an appropriate message should be displayed.
xi) Test case id: 11
   Test case name: Unit test for books
   Goal: To test whether a book can be updated or not.
   Expected Result: The book details should be updated.
   Description: Call update() method of "books database" class to update details of a book. After execution of this method,
   respective book details should be successfully updated. If not, then an appropriate message should be displayed.
xii) Test case id: 12
   Test case name: Unit test for librarian
   Goal: To test whether a librarian user can resolve complaints or not.
   Expected Result: The librarian should be able to resolve complaints.
   Description: Call complaintsresolution() method of "librarian" class to display complaint resolution details.
   After execution of this method, respective complaint resolution details should be successfully displayed.
   If not, then an appropriate message should be displayed.

2. Integration test cases: See the test case below

i) Test case id: 1
   Test case name: Unit test for registered user
   Goal: To test whether a user exits and can login or not.
   Description: First search for a user. If user exists, call login() method of "registered user"
   class to login the user. After execution of this method, user should be successfully logged in. If not,
   then an appropriate message should be displayed.
ii) Test case id: 2
   Test case name: Unit test for registered user
   Goal: To test whether a registered user exists and can ungister or not.
   Expected Result: The user should be able to ungister.
   Description: First search for a user. If user exists, then call unregister() method of "registered user"
   class to unregister the user. After execution of this method, user should be successfully ungistered. If not,
   then an appropriate message should be displayed.
iii) Test case id: 3
   Test case name: Unit test for vendor
   Goal: To test whether payment can be issued against the payment details for a given vendor.
   Expected Result: Payment should be successfully issued to payment against the given payment details.
   Description: First search for a given vendor. If vendor exists, call paymentdetails() method of "vendor"
   class to display payment details. If payment details are displayed appropriately, call payment() method
   of "librarian" class. After execution of this method, respective payment status should be
   successfully displayed. If not, then an appropriate message should be displayed.
iv) Test case id: 4
   Test case name: Unit test for complaint resolution
   Goal: To test whether a user can register a complaint and display complaint status.
   Expected Result: Complaint should be successfully registered and status reported.
   Description: First search for a given user. If user exists, call complaints() method of "user"
   class to register a complaint. If complaint is registered successfully, call complaintresolution() method
   of "librarian" class. After execution of this method, respective complaint status should be
   successfully displayed. If not, then an appropriate message should be displayed.
v) Test case id: 5
   Test case name: Unit test for user
   Goal: To test whether a user can pay fine or not.
   Expected Result: The user should be able to pay fine.
   Description: First call issuestatus() method of "librarian" class to issue the status for a given logged in
   user. Once issue status is received, call calculatefine() method of "librarian" to calculate fine. Once
   fine is calculated, call payfine() method of "user" class. After execution of this method, fine payment should be
   successfully reported. If not, then an appropriate message should be displayed.
vi)Test case id: 6
   Test case name: Unit test for librarian
   Goal: To test whether a vendor can be requested to supply books or not.
   Expected Result: Supply order for books should be issued to requested vendor.
   Description: First call search() method of "vendor" class. If vendor exists, call vendorrequest() method of "librarian" class to request a vendor. If this method is
   successfully executed, call supplybooks() method of "vendor" class. After execution of this method,
   order for supply of books should be successfully recorded. If not, then an appropriate message should be displayed.
vii)Test case id: 7
   Test case name: Unit test for librarian
   Goal: To test whether a book can be updated based on issue status.
   Expected Result: Book details should be successfully updated.
   Description: First call the issuestatus() method of "librarian" class. Then based on issue status, call
   update() method of "Book database" class. After execution of this method, book details should be
   successfully updated. If not, then an appropriate message should be displayed.

3. System test case: The purpose of system testing is to make sure that system as a whole is working fine or not. For this test case, entire cycle starting from user creation, his/her registration, issue request, book issue, book details update can be executed. If the whole cycle completes without any error, then all ok.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote