# Thread: How to write testcases for n factorial.

1. ## How to write testcases for n factorial.

Can anyone tell me how to write test cases for n factorial (n!)?

2. ## Re: How to write testcases for n factorial.

I am a developer. So test cases might be different than a testers point of view. But anyway here are the test cases that I would do.

1) Check the core functionality- by giving few values for n ( that are acceptable or between the range).
2)Check boundary conditions like n=0 and n=max. (due to limitations on storage, developer must have placed an upper bound on "n").
3)Try giving negative conditions to check if all exceptions are handled.
Like Making n -ve or giving very high value for n (out of range).

I would call is test complete- once I am done with all these.

Cheers!
Kalayama

3. ## Re: How to write testcases for n factorial.

More test cases depends on application interface.

One more test case is , yes we have the boundation on "n", but still allowed value of "n" can generate the value that can't be hold by memory registers because "n!" is multiplication of numbers keeping decreasing by 1.

test by giving decimal numbers.
Even by alphabets and special characters also.
also use +x, where x can any positive integer.See, whether it is accepted or not.etc.

4. ## Re: How to write testcases for n factorial.

Well yes! As Brijesh pointed out , we can give blizzare values like alphabets and decimals... Hmmm... I missed that. Ofcourse Brijesh is a testing professional.

And well, No wonder I am not a test engineer

Cheers!
Kalayama

5. ## Re: How to write testcases for n factorial.

Originally Posted by jainbrijesh

More test cases depends on application interface.

One more test case is , yes we have the boundation on "n", but still allowed value of "n" can generate the value that can't be hold by memory registers because "n!" is multiplication of numbers keeping decreasing by 1.

test by giving decimal numbers.
Even by alphabets and special characters also.
also use +x, where x can any positive integer.See, whether it is accepted or not.etc.
how a tester have to practice on testcases?how he will be perfect in writing a testcase?

6. ## Re: How to write testcases for n factorial.

Originally Posted by sumath_620
how a tester have to practice on testcases?how he will be perfect in writing a testcase?
See, test case writing is [creativity+experience]. As you say "how he will be perfect in writing a testcase?" I want to tell only one thing "No one is perfect and nothing is perfect", I am still doing my practice on writing test cases.

7. ## Re: How to write testcases for n factorial.

Originally Posted by jainbrijesh
See, test case writing is [creativity+experience]. As you say "how he will be perfect in writing a testcase?" I want to tell only one thing "No one is perfect and nothing is perfect", I am still doing my practice on writing test cases.

"I am still doing my practice on writing test cases." so how ur practicing is there any methods or ideas u want to give on writing testcases?

8. ## Re: How to write testcases for n factorial.

use testing techniques, Test as new application as you can (whenever you have time), like newly launched websites etc.

9. ## Re: How to write testcases for n factorial.

apart from writing testcases for userinterface
i dont have any idea about wrinitg testcases for an applications
like for security,integation,etc plz help

10. ## Re: How to write testcases for n factorial.

How to write test case for date format mm/dd/yyyy? what are the attributes should be considered here?

11. ## Re: How to write testcases for n factorial.

Hi Sachin,

Whenever writing testcases for Date format fields, keep in mind 2 things -
1) Testing the specified format of date itself
2) Testing other input values apart from Date and Time type

While testing Date formats say for instance mm/dd/yyyy, we could check -
Format Validations

1) See if date is entered as specified, system should accept and proceed ahead
2) Try changing to format to either dd/mm/yyyy or yyyy/mm/dd. Be careful while checking for dd/mm/yyyy that we enter dates greater than 12.
3) Try entering dates as mm/dd/yy.... Check if year can be entered as just 2 places
4) Try changing the date seperator. Use '.' or '-' instead of '/'
5) Try reversing the slashes
6) Try entering Alphanumeric or alpahbetic characters

Functional Validations
1) Check if Leap year validation of Feb is maintained.
2) Check if Feb can be entered with 29 days in a normal year
3) Try entering Long range of futuristic or backward dates to ascertain the boundaries of Date value.

Cheers....

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•