Hello, I am starting this blog to share my experience as a software tester. I wish to share the real time challenges in my job and current news about software testing. Thanks!!

Your Ad Here

Sunday, June 29, 2008

How to write Test Cases?

This is the question many freshers ask me often. Test Cases should answer two question, one What you are going to test? and How are you going to test it?. Test cases are written to standardize the testing process. Your test cases must cover the requirements. Following are the points to be taken care of when you write test cases:
1. Test Case should be written in such a way that any one should be able to execute them.
2. Your Test Cases must clearly define the requirements, inputs and expected results.
3. Clearly mention every single step of execution separately and every step must have expected and actual results.
4. Maintain one sheet for each requirement(one requirement may have several test cases).
5. Give proper test case id.

Functional Test-Case Design Techniques

1. Equivalence class partitioning
2. Boundary value analysis
3. Cause-effect graphing
4. Error guessing


1. Equivalence Class Partitioning

Partition the program input domain into equivalence classes (classes of data which according to the specifications are treated identically by the program)

The basis of this technique is that test of a representative value of each class is equivalent to a test of any other value of the same class.

identify valid as well as invalid equivalence classes

For each equivalence class, generate a test case to exercise an input representative of that class.
Example: input condition 0 <= x <= max

valid equivalence class : 0 <= x <= max

invalid equivalence classes : x < 0, x > max

3 test cases.

2. Boundary Value Analysis

Design test cases that exercise values that lie at the boundaries of an input equivalence class and for situations just beyond the ends.

Also identify output equivalence classes, and write test cases to generate o/p at the boundaries of the output equivalence classes, and just beyond the ends.

Example: input condition 0 <= x <= max
Test for values : 0, max ( valid inputs)
: -1, max+1 (invalid inputs)

3. Cause Effect Graphing

A technique that aids in selecting test cases for combinations of input conditions in a systematic way.

1. Identify the causes (input conditions) and effects (output conditions) of the program under test.

2.For each effect, identify the causes that can produce that effect. Draw a Cause-Effect Graph.

3. Generate a test case for each combination of input conditions that make some effect to be true.


4. Error Guessing


From intuition and experience, enumerate a list of possible errors or error prone situations and then write test cases to expose those errors.
Your Ad Here