Tuesday, January 26, 2010

Test cases for Calculator

1 Check for the visibiltiy of all buttons (0-9, Backspace, CE, C, M+, MS, MR,MC,1/x,sqrt, .,%, +,-,*,/,=,+/-,
All buttons must be visible
2 Check addition button in calcultor
Click on button '2' then click on addition(+) button press '3' then click on Equal (=) button.
It must display 5.
3 Check substraction button.
Click '6' then click on Substraction(-) button press '3' then click on Equal (=) button.
It must display 3.
Click '3' then click on Substraction(-) button press '6' then Click on Equal(=) button.
It must display -3.
4 Check Multiply(*) button
Click '3' then click on Multiply(*) button press '3' then Click on Equal(=) button.It must display multiplication result as 9.
5 Check Division(/) button.
Click '6' then click on Division(/) button press '2' then Click on Equal(=) button.
It must display division result as 3.
Click '6' then click on Division(/) button press '0' then Click on Equal(=) button.
It must display Error messeage as "Cannot divide by Zero".

6 Check 1/x button function.
Click on '2' then press 1/x button then click on Equal(=) button
It must display "0.5" as rusult because 1 divide by 2 it must display 0.5

Click on '1/x' directly
It must show error message as Cannot divide by zero because it takes 0 as a x value.

7 Check "%" button Function.
check 500*10 then click on "%" button.
It must display 10% value of 500 i.e 50.

8 Check "CE" button functionality
Click '4' and click on "+" button then Click on '2' and then click on CE button
It must Clear the last value we enter so it must clear '2' and if we enter '3' and click on Equal(=) button it must display 7.

9 Check "C" button Functionality.
Click '4' and click on "+" button then Click on '2' and then click on "C" button. It must clear all values.

10 Check MS Button functionality
Click on '4' then click on MS button
It must store '4' in memory and display M as flag in left hand corner label.

11 Check MR Button functionality
Check Flag for Memory button if it shows 'M' then click on MR button.
It must show the memory value.

12 Check MC Button functionality
Click on MC button.
It must clear the value of memory. And Clear the label Flag 'M' to blank.

13 Check M+ Button functionality
Click on '4' then click on MS button then click on '5' and press M+ button.
It must display '9' as result when we click on MR button because it must add the current value '5' into the memory value. i.e '9'.

14 Check Backspace button functionality.
Enter '123456' in calculator and click on backspace button.
It must clear last value enter i.e. 6'

15 Check status of calulator
It must display '0' by default when we open a calulator.

1 comment: