A8-StateMachineLab (1)
docx
keyboard_arrow_up
School
Centennial College *
*We aren’t endorsed by this school
Course
1212
Subject
Industrial Engineering
Date
May 5, 2024
Type
docx
Pages
15
Uploaded by GeneralExplorationCoyote32
Test Design using state transition diagrams Lab exercise
Black Box Tests – Part II
Designing test cases using State Transition Diagrams
Student names: Abishek Dhakal Id: 301292884
Student name: Sandesh Bhandari Id: 301313075
Contents
Q1 (2.5 pts) Draw a state transition diagram for a reservation or booking record
................................................
3
Q2.a ) List the type of objects that have changing state (1 pts)
..............................................................................
7
Q2. b) Draw state diagrams for each of the object types you identified above. (2.5 pts)
......................................
8
Q2.c) Identify criteria and define a test case to verify correct handling for four different state transitions. For example, two test cases are listed here. Add four more (1 pts each). (4 pts)
........................................................
9
Page 1 of 15
Test Design using state transition diagrams Lab exercise
Instructions Work in pairs – groups of two – and discuss (create a private chat) with each other as you complete the exercise. Marking
This assignment is marked out of 10. It has 2 questions.
Question one requires just one diagram is worth 2.5.
Question two requires a set of diagrams and four test cases. It is marks out of 7.5. Due
Submit in eCentennial your joint solution before next Monday’s class.
Question 1 (2.5 pts)
You own a small resort of summer cottages and ask a local software developer to create a reservation system you can use to manage bookings. Before accepting the software you test it thoroughly. You have 20 cottages that you refer to as #1, #2 … #20 and operate the resort for 12 weeks over the months of June, July and
August. Weekly rental for each cottage is $1000 per week. The rental period is from noon on a Sunday to noon on the following Saturday. You clean and prepare for the next customer each Saturday afternoon and Sunday morning.
Assume all customers stay one week. For each of the 20 cottages and each of the 12 weeks, the use cases may occur. Big hint:
the states of a reservation are shown in bold.
Use cases:
To start, the reservation system marks all cottages as available
for all weeks.
Page 2 of 15
Test Design using state transition diagrams Lab exercise
Customers may contact you by phone or email to ask about availability, prices and the like. 1.
The system lets you add information about potential customers to your mailing list.
A customer contacts you by phone or email to reserve a cottage or a certain week.
o
If the requested cottage and/or week are not available, you suggest alternatives. o
When you and the customer agree on a cottage and week, and the system lets you indicate that the cottage is reserved
.
Upon reserving, the customer must send you a deposit of $250 if the arrival date is more three weeks ahead.
o
If the deposit arrives within seven days, the cottage is marked as booked
.
o
If the deposit does not arrive within seven days, the system cancels the reservation and the cottage
becomes available
for rental to another customer.
Full payment is due three weeks before the arrival date. That means a customer who reserved with a deposit of $250 must pay the balance of $750 at least 21 days before arriving. A customer who books late (less than 21 days before arriving) must pay the full amount of $1000 within seven days of reserving.
o
When the balance of rental payment arrives, the system lets you mark the cottage as rented
.
o
If the balance of rental payment does not arrive 21 days before the arrival date:
The system cancels the booking and the cottage becomes available
.
You keep the deposit (if the customer paid it).
A customer may cancel a reservation or booking.
o
The system lets you indicate the cottage is available
again.
o
If the customer cancels more than 3 months (90 days) before the arrival date, you return all money paid - deposit and balance of payment (if paid).
o
If the customer cancels between 3 months and 3 weeks of the arrival date (89-21 days) you keep the deposit and return the balance of payment (if paid).
o
If the customer cancels within 20 days of the arrival date, you keep all money paid.
On the arrival date, the cottage becomes occupied
. o
If the customer does not turn up, you honour the booking anyway, in case the customer arrives late.
Q1 (2.5 pts) Draw a state transition diagram for a reservation or booking record. Consider that the diagram is the same for all 20 cottages and all 12 weeks, but shows the state of a booking for
one cottage and one week. Page 3 of 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Test Design using state transition diagrams Lab exercise
Hint: Include only use case details that relate to a change of state.
Diagram
Page 4 of 15
Test Design using state transition diagrams Lab exercise
Page 5 of 15
Test Design using state transition diagrams Lab exercise
Question 2 (7.5 pts)
CC Video store rents movies. You are testing the IT system that maintains the inventory of movies, customers, rentals and reservations.
CC Video rents movies by the day, for a fee of $5. All rentals are for one day and the customer pays before taking the movie out of the shop. Returns are due by 6 pm on the next day. Customers return movies by handing the rented copy to staff or dropping it into in a return box. The late fee is $6.00 for every day or part day overdue. Except for high demand movies, the store usually waves the fee for returns just a few hours late. All customers are members. Joining is free, but involves showing ID. The IT system assigns a member number and then uses member number together with last name and phone number to verify identity. All members in good standing (with no unpaid fines) can rent movies. Members can also reserve movies to be picked after 6 pm on the same day. The store must keep enough copies on reserve to satisfy all reservations. Use Cases / Requirements
A.
A member rents a movie with no reservation. Staff do the following:
Validate that the customer is a member
Check for outstanding fines. The member must pay all fines before renting.
Check that a copy is in stock and available for rental.
Take payment and give the member a copy of the movie.
Add a loan record to the system.
B.
A member returns a movie
Staff do the following:
Check whether the return is late. o
If the return is late and the customer is present, waive the fine or make the member pay.
o
If the return is late and the customer is not present, use the system to add the fine to the member’s record.
Remove the loan record from the system.
Return the copy of the movie to available stock.
C.
A member reserves a movie. Staff do the following:
Validate that the customer is a member.
Check that an unreserved copy is in stock. Page 6 of 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Test Design using state transition diagrams Lab exercise
Record that a copy of the movie is reserved. If two or more members reserve the same movie, the store must put more than one copy on reserve.
Page 7 of 15
Test Design using state transition diagrams Lab exercise
D.
A member rents (collects) a reserved movie. Staff do the following:
Validate that the customer is a member who made the reservation.
Check for outstanding fines. The member must pay all fines before renting.
Check that a copy is in stock.
o
If a copy is in stock and reserved by this member, clear the reservation record. o
If there is no copy in stock but one is reserved by this member, apologize to the member and note a glitch in the system.
Take payment and give the member a copy of the movie.
Add a loan record to the system.
E.
A Member cancels a reservation. Staff do the following:
Validate that the customer is a member who made the reservation.
Locate the reservation record and clear it
F.
Automatic system action:
At the end of each business day, the system checks for reservations for that day that were not converted to rentals and automatically clears them. Instructions
Complete the following about changes in state that occur while this application is running. Hints:
Make up a database schema (in reality you would probably ask the developers):
What database tables are required for the application?
When are rows added or deleted and what columns in those tables change as the use case scenarios unfold?
Q2.a ) List the type of objects that have changing state (1 pts)
1.
Customers
2.
Movies
3.
Copies Of Movies
4.
Staffs
5.
Loans
Q2. b) Draw state diagrams for each of the object types you identified above. (2.5 pts)
1.
Customer
Page 8 of 15
Test Design using state transition diagrams Lab exercise
2.
Movies
Page 9 of 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Test Design using state transition diagrams Lab exercise
4.
Staffs
Page 10 of 15
Test Design using state transition diagrams Lab exercise
5.
Loans
Hints:
You need one diagram for each type of object. Some diagrams may be very simple, but draw them anyway for this exercise.
Do not draw the diagram the flow of use cases or scenarios. Individual steps in different use cases may change the state of one object. State transition diagrams cut across use case scenarios. Page 11 of 15
Test Design using state transition diagrams Lab exercise
Label each diagram by naming the type of object. For example, one diagram will show the states of a copy of a movie
.
Page 12 of 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Test Design using state transition diagrams Lab exercise
Q2.c) Identify criteria and define a test case to verify correct handling for four different state transitions. For example, two test cases are listed here. Add four more (1 pts each). (4 pts)
1.
Test case: member in good standing can rent a movie (no reservation required).
Criteria:
A member with no fines can rent can rent any movie for which a copy is available, without reservation.
Preconditions:
Member 13 has no fines or reservations. Five copies of “Jaws” are available.
Action:
Member 13 rents “Jaws”.
Expected result:
One less copy of the movie is available than before. A loan record for the copy of “Jaws” exists and is associated with member 13.
2.
Test case: At the end of each day, the system clears reservations.
Criteria:
Reservations for the day are cancelled by the system if the member does not collect the movie by end of the business day.
Precondition:
A copy of “Jaws” is on reserve for Member 108. Action:
The video store closes for the day
Expected result: After the system cleanup, the reservation record for Member 108 to collect “Jaws” is deleted and the copy of “Jaws” is available.
3.
Test case: Late fee is paid by member 105 in store.
Criteria:
Member doesn’t return movie on agreed date
Preconditions: Member is late in drop-off customer is still in the store
Action:
Customer pays late fee
Expected result:
Loan record for member 105 is removed from system.
Page 13 of 15
Test Design using state transition diagrams Lab exercise
4. Test case: Movie reservation is canceled
Criteria
: Reservation of movie is canceled by the customer itself
Preconditions
: customer has reservation if customer reservation is found in system
Action
: automatically removes reservation in system
Expected result
: member reservation is no longer found in the system.
5. Test case: Member rents Avengers movie from reservation
Criteria: Member collects reservation in the store
Preconditions
: Copy of movie is in stock if member has no outstanding fees
Action
: Customer pays for movie
Expected result
: Customer receives copy, and all information of rent is in the system.
6. Test case
: System is cleared of all reservations at end of day
Criteria:
reservation are canceled if member does not show up to claim the reservation
Preconditions
: reservation is made if copy is still in store if store is closed
Action
: System clears reservations
Page 14 of 15
Test Design using state transition diagrams Lab exercise
Expected result:
Reservation is removed from system and movies are changed to “available for rent” status.
End of exercise
Page 15 of 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help