Give test cases for a code that finds a power of a number
Guys this would seem to be the most easiest question to all the experienced members of this forum but i being a neophyte can only put up these many test cases.
1.Check both values are inputted correctly or not.
2.Check for trivial case when x=0 then for any value of n it should return 0.
3.when n=0 it should always return 1 whatever x be.
4.check for negative values of x and n.
i)If n is negative then result should be always less than or equal to x.
5.Check first for smaller values of x and n i.e for 2,2 3,4 etc.
6.Now check for larger values of n and x and see the results.
Are these test cases correct and Could anybody help me in adding more test cases.
Using Boundary Value Analysis, I would test a combination of following x and n values (asuming the inputs are integers).
Resulting in 7×7 possible combinations or 49 testcases.
Testcases