0% found this document useful (0 votes)
15 views10 pages

State Transition Diagram Test Design

The document provides instructions for a lab exercise on designing test cases using state transition diagrams. It includes a sample state transition diagram for reservations of cottages at a resort and defines several use cases and state changes for renting movies from a video store that students are to model with state diagrams and test cases. Students are to draw state diagrams for objects that change state in the video store system and define test cases to verify the handling of state transitions.

Uploaded by

zarrashh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

State Transition Diagram Test Design

The document provides instructions for a lab exercise on designing test cases using state transition diagrams. It includes a sample state transition diagram for reservations of cottages at a resort and defines several use cases and state changes for renting movies from a video store that students are to model with state diagrams and test cases. Students are to draw state diagrams for objects that change state in the video store system and define test cases to verify the handling of state transitions.

Uploaded by

zarrashh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Test Design using state transition diagrams Lab exercise

Black Box Tests – Part II


Designing test cases using State Transition Diagrams

Student names _______________________ and ______________________________

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 10
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.

 Customers may contact you by phone or email to ask about availability, prices and the like.

Page 2 of 10
Test Design using state transition diagrams Lab exercise

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.
Hint: Include only use case details that relate to a change of state.
Diagram

Page 3 of 10
Test Design using state transition diagrams Lab exercise

Reservation

Booking

Page 4 of 10
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.
 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 5 of 10
Test Design using state transition diagrams Lab exercise

Page 6 of 10
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.
Member: Represents a member of the CC Video store.
2. Movie Copy: Represents a physical copy of a movie.
3. Reservation: Represents a reservation made by a member for a specific movie.
4. Loan Record: Represents a record of a movie rental transaction.
5. Late Fee: Represents the late fees associated with members.

Q2. b) Draw state diagrams for each of the object types you identified above. (2.5 pts)
Hints:

Page 7 of 10
Test Design using state transition diagrams Lab exercise

 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.
 Label each diagram by naming the type of object. For example, one diagram will show the states
of a copy of a movie.

Page 8 of 10
Test Design using state transition diagrams Lab exercise

1. Member State Transition Diagram:


States: New Member, Good Standing Member, Member with Fines
Transitions: Joining (New Member to Good Standing Member), Accruing Fines (Good Standing
Member to Member with Fines), Paying Fines (Member with Fines to Good Standing Member)
2. Movie Copy State Transition Diagram:
States: Available, Reserved, Rented
Transitions: Reservation (Available to Reserved), Renting (Available to Rented), Returning
(Rented to Available), Member Cancels Reservation (Reserved to Available)
3. Reservation State Transition Diagram:
States: Active, Canceled
Transitions: Reservation Made (Active), Member Cancels Reservation (Active to Canceled)
4. Loan Record State Transition Diagram:
States: Active, Closed
Transitions: Rental (Active), Return (Active to Closed)
5. Late Fee State Transition Diagram:
States: No Late Fee, Late Fee Incurred
Transitions: Movie Returned Late (No Late Fee to Late Fee Incurred), Late Fee Paid (Late Fee
Incurred to No Late Fee)

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: Member returns a movie late, and the system adds a late fee.
Page 9 of 10
Test Design using state transition diagrams Lab exercise

Criteria: A member returns a rented movie after the due time.


Preconditions: Member 22 has rented "The Matrix" and returns it late.
Action: Member 22 returns "The Matrix" late.
Expected Result: A late fee is added to Member 22's account, and the return status changes to
"Late."
4. Test Case: Member reserves a movie, but it's not available, and the system handles it.
Criteria: A member reserves a movie, but there are no available copies.
Preconditions: Member 33 reserves "Inception," and there are no available copies.
Action: Member 33's reservation is processed.
Expected Result: The reservation record for Member 33 remains, and the movie remains
"Unavailable."
5. Test Case: Member cancels a reservation.
Criteria: A member cancels an active movie reservation.
Preconditions: Member 77 has an active reservation for "Avatar."
Action: Member 77 cancels the reservation for "Avatar."
Expected Result: The reservation record for Member 77 is deleted, and "Avatar" becomes
available.
6. Test Case: A member in good standing rents a movie with a reservation.
Criteria: A member with no fines rents a reserved movie.
Preconditions: Member 44 has no fines, and there's a reserved copy of "The Avengers."
Action: Member 44 rents the reserved copy of "The Avengers."
Expected Result: Member 44's reservation is cleared, and a loan record is created for "The
Avengers."

End of exercise

Page 10 of 10

Common questions

Powered by AI

The state transition diagram for movie rentals includes states like 'Available', 'Rented', and 'Returned'. A key transition occurs when a rented movie is returned late, where 'Rented' transitions to 'Returned with Late Fee'. The transition reflects that if a movie is returned past the due time, a late fee is incurred. For in-person returns, staff might waive the fee, but if returned via dropbox, the system automatically applies it to the member’s account, updating the state from 'Normal' to 'Late Fee Incurred' .

A cancellation policy in a resort system balances financial risk and customer relations by implementing varying refund policies based on cancellation timing. Early cancellations (more than 90 days before arrival) result in full refunds, maintaining goodwill. Cancellations closer to the arrival date result in partial or no refunds, protecting the business from lost revenue opportunities. This tiered approach mitigates financial risk, as last-minute cancellations would have fewer chances of rebooking, while still maintaining customer goodwill with fair refund policies when possible .

Late return policies impact both customer satisfaction and business operations by balancing customer flexibility with operational efficiency. Allowing waivers for minor lateness but enforcing late fees for significant delays can enhance customer loyalty by showing understanding while maintaining discipline in returns. For business operations, such policies ensure a reliable flow of rental stock, maintaining availability and preventing loss of potential sales due to delayed returns. This balance helps sustain business profitability and customer relationships .

Deposit and payment deadlines ensure financial security and efficient cash flow by securing a portion of the reservation fee early. A required $250 deposit on reservations more than three weeks ahead engages customers to commit seriously. Meeting full payment deadlines (21 days before arrival) ensures that funds are collected in time, allowing for planning and reducing last-minute cancellations. These deadlines also contribute to customer satisfaction by clarifying expectations and avoiding overbookings, which ensures reliability in service delivery .

In CC Video store's inventory management, reservations cause movie copies to transition from 'Available' to 'Reserved'. If a reserved movie is picked up by the member, the state changes to 'Rented'. If the member cancels or fails to pick up the movie by end of the day, it transitions back to 'Available'. This cycle ensures movies are efficiently tracked and inventory levels are maintained, minimizing loss of sales opportunities due to poor inventory control .

To test the state transition from 'Reserved' to 'Available', the key criteria include verifying that a member cancels an existing reservation or a reservation times out without being converted to a rental. For example, if a reservation is not picked up by the end of the business day, the system should automatically clear it. The expected outcomes are that the reservation record is deleted and the movie becomes 'Available' again for rental by other members .

The key states in managing a cottage reservation at a summer resort include 'Available', 'Reserved', 'Booked', and 'Rented'. The state transitions involve: 1. 'Available' to 'Reserved': Occurs when a customer agrees to a reservation. 2. 'Reserved' to 'Booked': Happens when the deposit arrives within seven days. 3. 'Reserved' to 'Available': If the deposit doesn’t arrive in time, the reservation is canceled. 4. 'Booked' to 'Rented': When the full payment is made three weeks before arrival. 5. 'Rented' to 'Available': After the rental period ends and the cottage is vacated. These transitions affect the availability status by ensuring cottages are only made available when not reserved or rented and help manage overbooking .

The automatic system function for clearing unconverted reservations at the end of each day plays a crucial role in maintaining inventory accuracy and availability. By removing reservations that were not picked up, it ensures movies are returned to the 'Available' state, preventing potential bottlenecks and confusion in availability for other customers. This auto-clearance mechanism enhances system efficiency, reduces manual oversight needs, and ensures that the store can accurately advertise available stock .

The state transition diagram for loan records reflects user behavior through states like 'Active' and 'Closed'. An 'Active' loan switches to 'Closed' upon movie return, incorporating user activities of renting and returning movies. These transitions ensure system integrity by automatically updating records to reflect the current status of each loan. This ensures that the system accurately tracks open loans versus available stock and aligns with overdue handling, demonstrating the system’s responsiveness to user transactions while maintaining accurate inventory status .

The requirements for managing member accounts influence the design of state transition diagrams by necessitating states like 'New Member', 'Good Standing', and 'Member with Fines'. Transitions such as joining (New to Good Standing), accruing fines (Good Standing to Member with Fines), and paying fines (Member with Fines to Good Standing) must be captured. This design ensures clear tracking of member statuses impacting their ability to rent, reserve, and manage overdue charges, seamlessly integrating membership management with the rental process .

You might also like