What is the Test Case?
A Test Case is a set of actions executed to verify a particular feature or functionality of your software application. The Test Case has a set test data, precondition, certain expected and actual results developed for specific test scenario to verify any requirement.
A test case includes specific variables or conditions, using which a test engineer can determine as to whether a software product is functioning as per the requirements of the client or the customer.
What is a Test Scenario?
A Test Scenario is defined as any functionality that can be tested. It is a collective set of test cases which helps the testing team to determine the positive and negative characteristics of the project.
Test Scenario gives a high-level idea of what we need to test.
Example of Test Scenario
For an eCommerce Application, a few test scenarios would be
Test Scenario 1: Check the Search Functionality
Test Scenario 2: Check the Payments Functionality
Test Scenario 3: Check the Login Functionality
Example of Test Cases
Test cases for the Test Scenario: "Check the Login Functionality" would be
- Check system behavior when valid email id and password is entered.
- Check system behavior when invalid email id and valid password is entered.
- Check system behavior when valid email id and invalid password is entered.
- Check system behavior when invalid email id and invalid password is entered.
- Check system behavior when email id and password are left blank and Sign in entered.
- Check Forgot your password is working as expected
- Check system behavior when valid/invalid phone number and password is entered.
- Check system behavior when "Keep me signed" is checked
Why do we write Test Cases?
Here, are some important reasons to create a Test Case-
- Test cases help to verify conformance to applicable standards, guidelines and customer requirements
- Helps you to validate expectations and customer requirements
- Increased control, logic, and data flow coverage
- You can simulate 'real' end user scenarios
- Exposes errors or defects
- When test cases are written for test execution, the test engineer's work will be organized better and simplified
Why do we write Test Scenario?
Here, are important reasons to create a Test Scenario:
- The main reason to write a test scenario is to verify the complete functionality of the software application
- It also helps you to ensure that the business processes and flows are as per the functional requirements
- Test Scenarios can be approved by various stakeholders like Business Analyst, Developers, Customers to ensure the Application Under Test is thoroughly tested. It ensures that the software is working for the most common use cases.
- They serve as a quick tool to determine the testing work effort and accordingly create a proposal for the client or organize the workforce.
- They help determine the most critical end-to-end transactions or the real use of the software applications.
- Once these Test Scenarios are finalized, test cases can be easily derived from the Test Cases.
Test case vs. Test scenario
Here, are significant differences between Test scenario and a Test Case
|Test Scenario||Test Case|
|A test scenario contains high-level documentation which describes an end to end functionality to be tested.||Test cases contain definite test steps, data, expected results for testing all the features of an application.|
|It focuses on more "what to test" than "how to test".||A complete emphasis on "what to test" and "how to test.".|
|Test scenarios are a one-liner. So, there is always the possibility of ambiguity during the testing.||Test cases have defined a step, pre-requisites, expected result, etc. Therefore, there is no ambiguity in this process.|
|Test scenarios are derived from test artifacts like BRS, SRS, etc.||Test case is mostly derived from test scenarios. Multiple Test case can be derived from a single Test Scenario|
|It helps in an agile way of testing the end to end functionality||It helps in exhaustive testing of an application|
|Test scenarios are high-level actions.||Test cases are low-level actions.|
|Comparatively less time and resources are required for creating & testing using scenarios.||More resources are needed for documentation and execution of test cases.|
Best practices of Creating Test cases
- Test Cases should be transparent and straightforward
- Create Test Case by keeping the end user in the mind
- Avoid test case repetition
- You need to make sure that you will write test cases to check all software requirements mentioned in the specification document
- Never assume functionality and features of your software application while preparing a test case
- Test Cases must be readily identifiable
Best practices of creating a Test Scenario
- Test scenarios are mostly single line statement that tells what should be tested
- Scenario description should be simple and easy to understand
- A careful assessment of the stated requirements should be done
- The required tools and resources for testing need to be accumulated before the beginning of the testing process
- A Test Case is a set of actions executed to verify a particular feature or functionality of your software application
- A Test Scenario is defined as any functionality that can be tested
- Test scenarios are derived from test artifacts like BRS, SRS, etc.
- A test case is mostly derived from test scenarios. Multiple Test case can be derived from a single Test Scenario
- Both Test case and Test Scenario are indispensable in STLC process