Writing a test case
Introduction to Test Cases Best Practices
What is a Test Case ?•A description of inputs, execution instructions and expected results. • •Created for the purpose of determining whether a specific software feature or function works correctly or a specific requirement has been satisfied. •
Anatomy of a Test Case•1. Purpose •a short summary of what is being tested •(Test Requirement) •2. Description •How this test works at a high-level •3. Pre Requisites •What is needed to make this test run •4. Parameters •If data driven, list of data •5. Test Steps & Expected Results •
Standard Naming Criteria
Test Type•Pos – Testing with positive values, expecting a successful test outcome •Neg – Testing with negative values, expecting test to fail •Boundary – Testing to the extreme acceptable limits: upper limit plus 1 and lower limit minus 1, expecting test to fail •Spec Char – Testing using special characters; pass or fail depending on requirement validation criteria
7 Sins of Test Case Design§Making cases too long (too many steps) §Incomplete, incorrect or incoherent setup (pre-requisites) §Leaving out a step or step out of order. §Calling out a field that has changed or no longer exists §Confusion as to whether the tester or system does the next step §Unclear what constitutes a pass or a failure §Failure to clean up after test case (post-conditions)