Saturday, January 12, 2008

Use cases and robustness analysis

Use cases or user stories? Use cases are bigger and require more work. User stories are quicker and easier, more agile. That may be ok if you have other agile practices in place. If you have a customer or functional expert available to the team at all times, user stories may work quite well. But if you don't, you may need something heavier, like use cases.

It also depends on the complexity of the requirements. If the requirements are simple, use cases are not necessary. But for complex requirements, I think use cases are better suited than user stories. They help the customer to think through the requirements earlier, and they give the developers better understanding of what the system is supposed to do.

But use cases are not agile! Yes, they may be. Agile doesn't mean lightweight, it means rightweight. It means you adapt the process to the project. A large, complex project needs a heavier process than small and simple ones.

RUP had an activity called robustness analysis to analyze model, view and controller objects from use cases. I never really understood the purpose of this, until recently I read a book called Use Case Driven Object Modeling with UML. I strongly recommend this book for everyone using use cases and/or object oriented analysis. It argues against many popular opinions about use cases that they should be abstract and not deal with the user interface. These kind of abstract use cases don't give the developers the information they need, leaving them to make their own assumptions about how the system should work.

This doesn't mean that the use cases should include user interface design, but some specification of the user interface is necessary. Not only is this necessary to keep the developers on track, it also helps to make the use cases better.

The book explains how drive the object design from the use cases, resulting in a good object model that is consistent with the requirements.

No comments: