# How to compute the total number of test cases from test case table

I am doing black box testing. I have listed test cases in a table. How can i compute the total number of test cases? Is there any formula?

My test case inputs are as follows (test cases)

``````1 # of input string is 2
2 # of input string is 1
3 # of input string is 4
4 length of string is 10
5 length of string is 15
6 length of string is 13
7 length of string is 9
8 length of string is 16
9 string alphabets are between a~z
10 string alphabets are other than a~z (special characters)
11 string alphabets are other than a~z (numeric values)
12 String is in lower case a~z
13 String is in lower case A~Z
``````
• If you are doing equivalence class partitioning on a string field, why do you have so many of the same (or equivalent) values? For example test 1-8 are all equivalent. Also why do you want to compute the total number of test cases? The value in doing equivalence class partitioning is to REDUCE the total number of tests you need. May 23, 2017 at 16:57
• @ChrisKenst actually1 - 8 test cases from each class boundary and middle values as well. The main focus here is not equivalence class partitioning, main focus is to compute total number of test cases from these possible inputs. iam editing my question to remove partitioning that is making some problem May 24, 2017 at 1:30

Assuming you are looking at some kind of input, I presume your test case variables here are organized a little like this:

• Number of strings - 1, 2, 4
• Total length - 9, 10, 13, 15, 16
• Character set - alpha, special characters, numeric
• Casing - lowercase, uppercase

Your dependencies and limitations are probably:

• Only alpha character sets can have casing
• more than one string must include a separator (probably the space key)
• Number of strings and total length variables cannot be combined
• Character set and casing can be combined

That means you have:

• 3 possible string counts
• 5 string lengths
• Because character sets don't combine against themselves (that is, it's useless to have alpha + alpha as a character set variable) you have 7 possible character set groupings:
• alpha
• numeric
• special characters
• alpha + numeric
• alpha + special
• numeric + special
• alpha + numeric + special
• 3 casing sets
• Upper case
• lower case
• mixed case (upper + lower)

That makes the total number of character set + casing combinations 12: 3 casing options multiplied by the 4 character set groupings containing alpha characters.

So, if you choose to test each possible combination of string count, string length, character set, and casing you will have:

``````(number of strings)*(length)*(character set + casing)
``````

or:

``````3*5*12 = 180 test cases
``````
• Wonderful explanation. thank you very much. I was bit confused with some thing like, do i need to add 26 different possible alphabetic counts and 33 possible special characters and 10 possible numeric values May 25, 2017 at 8:29
• Very clear explanation @Kate Paulk. Already one year has passed but this post helped me a lot. I might be wrong or don't properly understand the formula used to compute the total number of test cases, but it seems like the 3 remaining character set(numeric, special and numeric + special) has not been counted in the applied formula? Nov 23, 2018 at 17:45