Could someone please explain the difference between test scenario and test case
I faced this question in interview. Wh开发者_如何学运维en I searched on internet I found different answers. Please provide specific example.
Test Scenarios
Test Scenarios are inputs to test cases. Generation of test scenarios usually takes place in a brainstormig session with project stakeholders, who propose scenarios or ask questions about the way in which the architecture will respond to various situations. Scenarios are used to represent stakeholders' interests and quality attribute requirements. Scenarios should cover a range of anticipated uses of (use case scenarios), anticipated changes (growth scenarios), and unanticipated stresses (exploratory scenarios) to the system.
A good scenario makes clear what the stimulus is that causes it and what responses are of interest. For example, a use case scenario might be: “Remote user requests a database report via the Web during peak period and receives it within 5 seconds.” A growth scenario might be: “Add a new data server to reduce latency in scenario 1 to 2.5 seconds within 1 person-week,” and a exploratory scenario might be: “Half of the servers go down during normal operation without affecting overall system availability.” Scenarios should be as specific as possible, identifying stimuli, responses, and environment.
A scenario described in vague terms such as 'a communication relay node failed' is not really a valid scenario. You need to get (from stakeholders) further details such as the expected operational consequences, the system assets involved, the end-users involved, the potential affects of the scenario on system operation, and the exceptional circumstances that may arise. More details would include which facility or node detects failure, what is the expected automated response to failure (if any), what is the expected manual intervention, which capabilities will be degraded during the outage, and the expected actions taken to return the relay to service.
Scenarios are often prioritized in an iteration and first few scenarios are taken for further test case development.
Test Cases
Test case development usually transforms each of the selected scenarios from a statement and list of bullets into a well-documented test case. The test cases may combine and/or extend the scenarios, add assumptions and clarifications, define issues, and pose relevant questions. Unlike the test scenarios generation activity, the test cases development is an iterative activity in that new test cases are added and old test cases are refined to support a scenario.
First you have to define context of a test case. In a test case involving a communication relay node failure, for example, the context of a test case may define:
- the operation at the time of failure
- what happens immediately after, when the system is reacting to the failure
- degraded operation during the interval when repair is underway
- restoring the system to normal operation
Once you have context in place, you have to explore and document issues and questions that are implied by context. For example, the issue could be "how failure is detected?". Questions could be "What subsystem detects the failure?", "How long does it take to detect the failure?" and "What happens during this interval?". Other quality issues could be related to security, availability, performance etc.
Architects usually review those issues and questions and determine how a system would react to a scenario. They might refine the architecture to help answer the questions. Test cases are refined and new test cases are added. Test case development is considered complete when all answers to questions are documented.
Source: http://www.sei.cmu.edu
In a test case you try to determine if something works as expected under defined conditions. In a test scenario the conditions are based on a hypothetical story. Under this viewpoint the test scenario is a special case of a test case.
精彩评论