Wednesday, January 20, 2010

Write test cases for door?

Consider that the door has some set of states


a. Open and Locked


b. Closed and Locked


c. Open and Unlocked


d. Closed and Unlocked


The door can be in one of these states.





The door would have some operations associated with it:


a. Open the door


b. Close the door


c. Lock the door


d. Unlock the door


e. Pass some stuff thorugh it





You can have one of the oprations one on the door when it is in any state. Try to have the combinations of the states and operations and the expected output such as :


1: Current state : Closed and Unlocked


Operation : Pass some stuff thorugh it


Expected result : Error (some noise)


Next State : Closed and Unlocked


2: Current state : Open and Unlocked


Operation : Pass some stuff thorugh it


Expected result : The stuff that goes from one side is the same that comes out of the other side


Next State : Open and Unlocked


3: Current state : Closed and Unlocked


Operation : Lock the door


Expected result : The door gets locked. If the operation open is perfromed it would result in error.


Next State : Closed and Locked


. . .





Remember some these combinations would signify valid scenarios while some would depict invalid behaviour (in which the error would be encountered).





You can add some attributes/properties to the door also such as :


dimensions, colour etc. and extend you case sets such as passing stuff throygh


the door with dimensions bigger than the door.








Use your experience and imagination and create the test cases.Write test cases for door?
Interesting post...are you looking for help in writing test cases? If so, it would help to know what type of door.





I'll assume front door. Here's some tests


- Close door softly with and without door knob


- Slam door hard with and without door knob


- Open door


- Lock door/Unlock door


- Attempt to open when locked


- Knock on door

No comments:

Post a Comment