Interview Questions

SDET - The following list outlines a fairly complete test plan for the vending machi?

Software Design Engineers in Test SDET FAQ


(Continued from previous question...)

25. SDET - The following list outlines a fairly complete test plan for the vending machi?

The following list outlines a fairly complete test plan for the vending machine:

1. Test if the coin deposited state is accounted for:
To do this, press all the buttons except the ones for inserting coins.
The correct response from the program should be:


2. Test if the machine can detect if it is empty of all merchandise:
to do this, replace the value in the quantity box for all candies with zero then insert any amount of coins and attempt a purchase by pressing any of the candy buttons.
The correct response from the program should be:
o any amount inserted into the machine returned in the coin return slot
o a popped message box with the message “out of stock” and the same message displayed in the panel display box

3. Test if correct change is given out:
Test if the purchasing algorithm is correct:
To do this, insert an amount which is over the price of a particular candy then purchase the candy by pressing the correctly labeled button. The correct response from the program should be:
o The specified candy listed in the candy slot box
o the quantity of the specified candy decremented by 1
o the coins inserted either placed in the coin reserves or in the spillover bucket
o The correct amount of change given out o with the correct number of coins dropped from the coin reserves to account for the amount of change.

Note: this is far from an exhaustive test of the coin return algorithm. In order to verify that the algorithm is reliable in all potential cases it is necessary to really stress it by putting it through a wider range of input values. To do this, it is common practice to use a driver program. In the driver program we test the algorithm by giving it a large subset of all the possible input values (or the entire set of possible input values if the set is finite and the testing time is acceptable). Another method is to mathematically prove the correctness of the algorithm, but this is more difficult to implement.

4. Test if out of change condition is detected:
To do this, zero out all coin hold boxes in the vending machine then press the coin return button to reinitialize the program. Press the quarter button to insert a quarter.
The correct response from the program should be:
o a popped message box with the message “out of change” and the same message displayed in the panel display box
o The quarter should be dropped into the coin return box.
Note: this is far from a exhaustive test of the coin return algorithm. See the previous item.


5. Test if the price ceiling of the machine is implemented correctly:
To do this, insert up to $2.00 in coins then insert any valid coin to go over the $2.00 limit.
The correct response from the program should be:

o The last coin inserted dropped into the coin return slot.
o a popped message box with the message “Overlimit” and the same message displayed in the panel display box
6. Test if program only accepts valid coins:
To do this, insert an invalid coin.
The correct response from the program should be: The invalid coin dropped into the coin return slot.

7. Test if the machine can detect if a specific candy is out of stock.
To do this, zero out the quantity box of a particular candy then attempt to purchase the candy.
The correct response from the program should be: a popped message box with the message “out of stock” and the same message displayed in the panel display box.


8. Test if the machine can detect if the amount inserted is sufficient for purchasing a particular candy:
To do this, insert an amount which is less than the listed price of a particular candy then attempt to purchase the candy.
The correct response from the program should be: A popped message box with the message “insufficient funds” and the same message displayed in the panel display box.
Next insert enough money to buy the candy and try again to purchase it.
The correct response from the program should be: (see test #3)

9. Test if coin return function works:
To do this, insert any amount into the machine then press the coin return button.
The correct response from the program should be: the amount inserted into the machine dropped into to coin return slot.

(Continued on next question...)

Other Interview Questions