Original Link: UseCasesAndStories
What is the difference between a UseCase and XP's UserStory?
This is a common question, and not one that has a generally
agreed on answer. Many people in the XP community consider stories
to be a simplified form of use cases, but although I used to hold
this view I see things differently now.
Use cases and stories are similar in that they are both ways to
organize requirements. They are different in that they organize for
different purposes. Use cases organize requirements to form a
narrative of how users relate to and use a system. Hence they focus
on user goals and how interacting with a system satisfies the
goals. XP stories (and similar things, often called features) break
requirements into chunks for planning purposes. Stories are explicitly
broken down until they can be estimated as part of XP's release
planning process. Because these uses of requirements are different,
heuristics for good use cases and stories will differ.
The two have a complex correlation. Stories are usually more
fine-grained because they have to be entirely buildable within an
iteration (one or two weeks for XP). A small use case may correspond
entirely to a story; however a story might be one or more scenarios
in a use case, or one or more steps in a use case. A story may not
even show up in a use case narrative, such as adding a new asset
depreciation method to a pop up list.
Do you need to do both? As in many things, in theory you do but
in practice you don't. Some teams might use use cases early on to
build a narrative picture, and then break down into stories for
planning. Others go direct to stories. Others might just do use cases
and annotate the use case text to show what features get done when.
Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts
Monday, May 6, 2013
TestPyramid
Original link: TestPyramid
The test pyramid is a concept developed by Mike Cohn, described in his book Succeeding with Agile. Its essential point is that "you should have many more low-level unit tests than high level end-to-end tests running through a GUI".
Tests that run end-to-end through the UI are: brittle, expensive to write, and time consuming to run. So the pyramid argues that you should do much more automated testing through unit tests than you should through traditional GUI based testing.
The pyramid also argues for an intermediate layer of tests that act through a service layer of an application, what I refer to as SubcutaneousTests. These can provide many of the advantages of end-to-end tests but avoid many of the complexities of dealing with UI frameworks. In web applications this would correspond to testing through an API layer while the top UI part of the pyramid would correspond to tests using something like Selenium or Sahi..
The test pyramid comes up a lot in Agile testing circles and while its core message is sound, there is much more to say about building a well-balanced test portfolio. In particular a common problem is that teams conflate the concepts of end-to-end tests, UI tests, and customer facing tests. These are all orthogonal characteristics. For example a rich javascript UI should have most of its UI behavior tested with javascript unit tests using something like Jasmine. A complex set of business rules could have tests captured in a customer-facing form, but run just on the relevant module much as unit tests are.
In particular I always argue that high-level tests are there as a second line of test defense. If you get a failure in a high level test, not just do you have a bug in your functional code, you also have a missing unit test. Thus whenever you fix a failing end-to-end test, you should be adding unit tests too.
The test pyramid is a concept developed by Mike Cohn, described in his book Succeeding with Agile. Its essential point is that "you should have many more low-level unit tests than high level end-to-end tests running through a GUI".
Tests that run end-to-end through the UI are: brittle, expensive to write, and time consuming to run. So the pyramid argues that you should do much more automated testing through unit tests than you should through traditional GUI based testing.
The pyramid also argues for an intermediate layer of tests that act through a service layer of an application, what I refer to as SubcutaneousTests. These can provide many of the advantages of end-to-end tests but avoid many of the complexities of dealing with UI frameworks. In web applications this would correspond to testing through an API layer while the top UI part of the pyramid would correspond to tests using something like Selenium or Sahi..
The test pyramid comes up a lot in Agile testing circles and while its core message is sound, there is much more to say about building a well-balanced test portfolio. In particular a common problem is that teams conflate the concepts of end-to-end tests, UI tests, and customer facing tests. These are all orthogonal characteristics. For example a rich javascript UI should have most of its UI behavior tested with javascript unit tests using something like Jasmine. A complex set of business rules could have tests captured in a customer-facing form, but run just on the relevant module much as unit tests are.
In particular I always argue that high-level tests are there as a second line of test defense. If you get a failure in a high level test, not just do you have a bug in your functional code, you also have a missing unit test. Thus whenever you fix a failing end-to-end test, you should be adding unit tests too.
Subscribe to:
Posts (Atom)