How to write testcases for n Factorial? How many testcases will we get?

Showing Answers 1 - 6 of 6 Answers

Amrit

  • Nov 25th, 2006
 

We cah write following test cases

1) verify for result whn n is non-numeric

2) Verify for result when nis negative

3) verify for n= 0 (A valid case)

4) verify for n = 3(A valid case)

  Was this answer useful?  Yes

We get about 13 test cases.

Determine the maximum integer value that the computer can calculate as a factorial.  This value becomes the upper boundary.

POSITIVE TEST CASES

1) Submit integer value at lower boundary [ 0 ]
2) Submit integer value at lower boundary +1 [ 1 ]
3) Submit integer value at upper boundary -1
4) Submit integer value at upper boundary

NEGATIVE TEST CASES

5) Submit integer value at upper boundary +1
6) Submit integer value with leading 0
7) Submit integer value with leading plus sign [+]
8) Submit integer value with leading minus sign [-]
9) Submit integer value with leading space
10) Submit alpha character(s)
11) Submit special character(s) [ex: !@#$^]
12) Submit with only space
13) Submit with nothing entered

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions