Test case is a specific sequence of actions associated with a specific set of data elements, all of which exercise a specific function or feature of the procedure/application /system under test.
To write a test case concentrate on one requirement at a time. Based on that one requirement several real life scenarios that are likely to occur in the use of the application by an end user.Although the test cases cover the software requirements, that doesn’t mean the test cases are very good enough. A badly written tests or poor tests do indeed expose a tester to considerable risk.
Identifying good test cases:
1.To identify good test cases we have to empathize with end user scenarios.
2. Apply “deep thinking” -- the famous James Bach exampleThe requirements specification consists of:
a. These are cards.
b.There is a letter on one side and a number on the reverse.
c. If there is a vowel on one side, there will be an even number on the reverse side.
E 7 V 4
While writing test cases for the above requirements we have to deeply think for the non obvious requirements first. Remove obvious and ofcourse things. That is it need not be a vowel on the reverse side if there is a even number on one side.
Lateral thinking is thinking from all the sides. It employs alternative methods of thinking. Rather than progress in logical manner from one thought to another, the aim is to make a leap into very different areas of thought. ie...immediate perceptions are not the ends.
Characteristics of a good test case:
- Potential to find defects: The test case should surface the defects which are yet uncovered.
- Atomic: Tests should have single, clear and specific goal.
- Track able/Traceable: Tests must have identifier also called as naming conventions or naming scheme or nomenclature.
- Comprehensible: Generally tests are written by one TE and are executed by some other TE ( he may be a newly appointed one or may be after a long time other than the author or the author himself may not understand).So they must be understandable and executable by others.
- Self contained or complete: If the TE has to execute the current test case only when the prerequisite is fulfilled. Then in such a case it must be mentioned within the same test case itself.
- Clearly provide environment details: The test cases should include environment or context details .For example operating systems (windows, Linux, UNIX, Macintosh).
- Repeatable: Test cases should be repeatable in nature that is it can be used any number of times.Example “Happy New Year” should be displayed on Jan 1st of any year. The test case must be repeatable for any year.
- Uniqueness: The test case must be unique. There should be no duplicates of the previous.
Test case template consits of:
Sno ID Purpose Priority Description Pre-Condition Type Env. Details Expected Result
Purpose of writing test cases:
1.Test cases are part of the deliverables to the customer. Test case goal is credibility. Typically user acceptance test (acceptance level).
2.Test cases are good documentation for future proof.
3.Test cases are for team internal use. Here the goal of the test case is testing efficiency.
4.Test cases improve the design. The choice of writing test cases as early aspossible in the software development life cycle , as a side benefit of writing test cases we are able to find problems in the requirements as design of an application. Good test cases would be included as one of the requirements in the requirements document.
5.The process of developing test cases makes tester think through the operation of the application.
6.Test cases help us to change code throughout the life time without breaking the existing code. So we can improve the design of the program.
7.Test cases are required for automation process.
8.When new features are added new test cases are to be written to test that particular feature.
The above information drives home the fact that test cases are the biggest investment and greatest asset of a software quality team. To maximize the return on this investment through clever strategies and writing techniques, learn to make cases easy to test, increase productivity and respond to project changes.
Source:
Ashwinpalarthi
Cemkaner:what is a good test case-stickyminds.com
Tech gurus corner-Blog
No comments:
Post a Comment