Pulling apart sequence and activity diagrams
I like using sequence and activity diagrams to generate test ideas. When looking at a sequence and activity diagrams, ask yourself what would happen in the system if a specific line didn't happen or didn't happen correctly. For example, if you look at the following example from Donald Bell's article on UML Sequence Diagrams:
If I were to use this to create test cases, I'd ask questions like:
You get the idea. When generating the test ideas, just list them out as you think of them. If you have a sequence or activity diagram of any complexity, you'll get a long list. Afterward, you can work with other project team members to shrink the list down into the scenarios you feel will provide the most value to the project.
If I were to use this to create test cases, I'd ask questions like:
- What happens if the amount doesn't come back?
- What happens if the amount that comes back is in an invalid or unexpected format?
- What happens if the amount that comes back is corrupted, very large, or if the connection is interrupted?
- (similar questions for balance)
- If the balance is less than the amount, what happens if I note the returned check without adding the insufficient fund fee? Can I do that?
- What if, while noting the returned check, I use an invalid check number, use a check that's already been noted previously, or don't pass a check number?
- (etc...)
You get the idea. When generating the test ideas, just list them out as you think of them. If you have a sequence or activity diagram of any complexity, you'll get a long list. Afterward, you can work with other project team members to shrink the list down into the scenarios you feel will provide the most value to the project.