Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you test a calculator? [closed]

Tags:

testing

How will you test a calculator? Any thoughts?

thanks,

=== Sorry that I did not elaborate this question much at the beginning. Now, I want to give more backgrounds about this. This question was asked during a technical interview for a programmer position. So I suppose they were looking for some really "smart" answers or some good approach to test such application...

Thanks again.

like image 377
Jay Avatar asked Jul 12 '10 18:07

Jay


People also ask

How do you test a function on a calculator?

Check if the calculator is a normal calculator or a scientific calculator. Verify that all the buttons are present and text written on them is readable. Check the arithmetic operations are working fine- +, -, /, * etc. Verify that BODMAS is applied in case of complex queries and the correct result is returned.

How do you test a calculator?

To test the calculator, give it the known inputs and check that it computes the known outputs. You then also need to test that each button has the desired effect on the internal stack.


3 Answers

  • Exercise the interface. Does it do what you expect?
  • Exercise the functionality. Does it do what you expect?
  • Exercise boundary conditions. Does it handle division by zero? How does it handle really big and really small values? Are there rounding errors that crop up?
like image 197
John Avatar answered Sep 22 '22 15:09

John


by throwing it against a wall, if it breaks... then it wasn't meant to be.

like image 31
jeremiah Avatar answered Sep 23 '22 15:09

jeremiah


Besides normal calculations...

Divide by zero.

Make sure negative numbers work

Check if rounding is correct

like image 27
Ed B Avatar answered Sep 21 '22 15:09

Ed B