Difference between requirement, use case, and scenario?



  • I've taken a class on software testing best practices and test design. In the content, they have a model that basically shows that the three items are derived in this way:

    Requirements > Use case > scenarios > test case > test script

    I'm fine with the last two but what are the differences between the first three? Use cases seem to take on the same definition as both requirements and scenarios or at least bounce back and forth. I have not been able to find a clear example that shows:

    this is a requirement statement
    this is a use case of the requirement
    this is a scenario of the use case

    Could someone clear this up and give an example?



  • A requirement is typically a general statement, whereas a use case is typically a specific statement implied or derived from the requirement. A requirement may map to multiple use cases. A scenario might be a set of background assumptions that put a use case in context, or it might be grouping of use cases.

    Here is a contrived example. The requirement is to provide an API that converts a CSV file into a tab-separated file. A scenario might be, "John is a Java developer who deals with potentially large CSV files that are sometimes empty." A use case might be "If the input file is empty, the output file will also be empty" or "The API does not run out of memory while processing a 500Gb file".

    Finally, SQA gets a lot of "What is the different between these terms" kinds of questions. If you hear someone utter some ambiguous phrases, and it's important to understand what they mean (e.g. because a co-worker or your boss used them), ask them what they mean. Among reasonable people, it is always OK to say, "Different people use that phrase to mean different things, so can you be more specific about what you meant?" If you've never heard the phrases before, or you lack confidence, you can do a Google search first, come up with a first approximation of what they mean, and then ask that person to clarify what they meant.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2