1. To know negative or positive test cases first you need to know the scenarios.
2. To know negative scenarios you need to know the validations on various fields.
3. Depending on validations, choose a test design techniques to decide on the data that you are going to use while testing.
4. Form combinations on this data.
5. Rank the combinations.
6. Select the combinations for testing.
7. Write the test cases.
Example: Login Screen.
1. It has two fields: ID & Password.
2. ID has to be valid employee ID (numeric) and password has to be matched with a stored one.
3. User can click on Cancel if wants to discontinue. Upon clicking on Cancel the application closes. (In case web application either browser closes or the tab closes.)
4. Upon clicking on Forgot Password link another form gets displayed.
5. Upon successful login, user gains the access of system.
6. Upon 3 consecutive unsuccessful attempts the User gets blocked, user gets appropriate message and upon clicking on that message the application closes.
7. After entering ID & Password, Submit button gets enabled.
Now, what are Positive and Negative scenarios?
Positive Scenarios:
1. ID & Password matches and user clicks on SUBMIT button.
2. Clicking on Cancel Button.
3. Clicking on Forgot Password.
Negative Scenarios:
1. ID is wrong, Password is correct.
2. ID is correct, Password is wrong.
3. ID is blank, Password is correct. (In this case SUBMIT Button should not be enabled)
4. ID is correct, Password is blank. (In this case SUBMIT Button should not be enabled)
5. ID & Password both are blank. (In this case SUBMIT Button should not be enabled)
6. ID & Password both are wrong.
Implied Scenario (Default):
1. When Login screen is displayed, cursor should be blinking on ID field. (ID field should be focused)
Now, if you want to write test cases, you have to select the data. For which you have to apply Test Design Techniques. I assume that this testing is for functional (Black Box / Dynamic) testing. So, you may choose Equivalence Partitioning / Equivalence Class Technique
For ID Classe:
1. {Valid ID: Existing valid numeric ID in database}
2. {Invalid ID: Non Existing numeric ID in database, ID containing at least one value which is not a number}
For Password:
1. {Valid Password: Existing valid password in database}
2. {Invalid Password: Non existing password in database}
Now you have to select data to write the test cases.
Valid Data for ID:
A. 1234 (Assume that this is valid ID which exists in database)
Invalid Data for ID:
A. 4321 (Assume that this is invalid ID which does not exists in database)
B. 12A6 (ID containing character)
Valid data for Password:
A. PassWord (Assume that this is valid password for ID 1234 which exists in pairs in database)
B. Password (Assume that this is invalid password for ID 1234)
Now, you have to find out the combinations of ID and Password:
Sr. No. ID Password Valid / Invalid Combination (V = Valid, I = Invalid)
1. 1234 PassWord V (Correct ID, Correct Password)
2. 1234 Password I (Correct ID, Wrong Password)
3. 4321 PassWord I (Wrong ID, Correct Password)
4. 4321 Password I (Wrong ID, Wrong Password)
5. 12A6 PassWord I (Wrong ID, Correct Password)
6. 12A6 password I (Wrong ID, Wrong Password)
Apart from this if you want you can also test other scenarios which I have mentioned above if needed. But before that you have to select the combinations now. Do you think all these combinations and scenarios are necessary to execute? Which you can eliminate? Which will have highest probability of detecting a defect? What will you do, if number of combinations are too much like in thousands?
Comments
Post a Comment