Whenever data is stored in an application use cases appear. Use cases are crucial to understanding application complexity, clarifying how an application should be built and tested.
Use cases are best explained by an example.
Imagine an application where you sign up for bike rides. You join the website and then fill out a registration form. Then you pay and receive a receipt. There are a number of different screens that need to exist:
- Join a bike ride
- Membership form
- Registration form
- Receipt sent
- Receipt viewed
However, the views do not define the system. For instance, what happens when Payment is abandoned? How does a user complete their registration? Can a user modify a registration? Thus we have the concept of states.
The states in this system are:
- Existing or new user.
- Membership forms exist, are partially completed or do not exist for a user.
- Registrations never made, partially completed or do not exist for a user.
- Payments are never made or complete for a user registration.
- Receipts sent or not sent.
The states are "exist", "do not exist" or "partially exist" for a view.
Given there a seven views with roughly three states each, that means there are 21 different combinations.
How can we make sense of how there work? The answer is a flow chart drawn with humble paper and pencil.
Once you have the Views and the States, you can define a flow chart of use cases. We are old school here and believe you can't beat pencil, paper and sticky tape for creating flow charts. Even if you have to write them out a few times, it's still quicker and clearer than using software. Nothing beats a flow chart to define a complex system and even the most simple looking system have many more options than you'd think.
Flow charts are best created with paper and pencil. It's the fastest way to get them done:
How Flow Charts Help
Drawing flow charts helps define "controllers" in programming languages. They also define test cases which testers can use to ensure what you have built will work in the real world. Flow charts are the fastest way to understand application complexity and create team agreement on how a system should be coded.