- (Definition): Testing is the process of executing a program with the intent of finding errors
- A good test case is one that has a high probability of detecting an as-yet undiscovered error
- A successful test case is one that detects an as-yet-undiscovered error.
Some more testing principles as given below:
- Test case definition includes expected output.
- Programmers should avoid testing their own programs. Third party testing should be explored.
- Thoroughly Inspect the results of every test.
- Include the test cases for invalid & unexpected input conditions.
- See whether the program does what it is not supposed to do.
- Avoid throwaway test cases. Remember that the test cases serve as a documentation for future maintenance.
- Do not assume that the program is bug free. Positive dissatisfaction of a non-developer, rather a destructive mindset is needed.
- The probability of more errors is proportional to the number of errors already found
It is clear from the definition of testing that:
- Testing cannot prove correctness of a program. It is just a bunch of experiments collected to find out the errors.
- The term like 100% error-free code does not exist. Reason being, it is not feasible to conduct exhaustive testing, thereby proving 100% correctness of the program, which is not possible.
We need to develop an attitude for ‘ego-less programming’ and keep a goal of eliminating as many faults as possible. Statistics on common sense declare that prevention is better than cure. Hence we need to place static testing also in place to capture an error before it becomes a defect in the software at a later date.
Recent agile methodologies like extreme programming addresses these issues better with practices like test-driven programming and paired programming etc.