Test cases for arithametical division function?
Question:
Answer:
if divisor = 0
-> say divisor isn't valid
if divisor = 1 (optional)
-> just return the dividend (there's no real need to do the division)
if divisor = -1 (optional)
-> return the negative of the dividend
else
-> perform division and return answer
I hope that's what you were asking for...
You question is somewhat unclear =)
Ur test case should include division by zero case.
it should be between 2 numbers and not just at begining. like that
I m not into testing but i guess u should check for -
1 - Only proper numeric value is inserted
2 - should not allow 0 as divisor
what else.. i can think of these 2 only. It can be increased if you are looking for some specified range of division operation...
Most important test is division by zero.
Then you can different test cases,
1) numerator greater than denominator and vice versa
2) -ve and +ve values for both denominator and numerator.
3) int, float, double in numerator and denominator
More Questions & Answers...