Thursday, October 25, 2012

Post 4_Writing Use Cases.

Okay Now lest focus on writing Use Cases.

So What do you understand by Use Cases? and why do we write them at all ?

Use Case is a step by step description how the user and system interact to accomplish a goal, where user can be human or another system. They are part of System Requirement Specification (SRS) document.

Use Cases provide the writer and reader with following benefits:
  1. Simple to write
  2. Easy to understand for stakeholders to validate requirements
  3. Scenario's mentioned can be easily converted into test cases
Type of Use Cases:
  • Primary / Sunny day Use Cases : 20% of the use cases are used by 80% of the activity
  • Rainy day Use Cases : Prioritize them as per the development cost in something not likely to happen.
Use Case has the following parts to it :

- Descriptive Name

- Description: This is the purpose of Use case to exist.

- Trigger: Initiator of the use case. It need not happen for sure. Its just that this particular event triggers the start of the use case. This can be a business rule or it can be an external event. for example: Providing customer support periodically OR Customer calling for customer service.

- Precondition: There are two types of precondition:
  1. A precondition is the state of the system and its environment that is required before the use case can be started. For example:: Appointment should exist in the system before the patient can visit the Doctor.
  2. CRUD ( Create, Retrieve, Update and Delete). These are trivial requirements. Define them but dont spend to much time on them.
- Actor: Its a role performed by the user. It could be a buyer, seller, paypal (another system), agent. Actors are outside the system and must interact with atleast one use case. There are two type of actors:
  1. Primary Actor: For whom the system is build
  2. Secondory Actor: They exist for the Primary actor.
- Postcondition: The state of the system after the use case is executed. There can be multiple Post conditions depending upon whether al business rules have been or how the system acts.

- Basic Flow: Course of events that happens when everything goes well. Happy Flow. No errors, no exceptions.

- Alternate Flow:
  1.  Error or exceptional flow that occurs at any step of the basic flow. Example: Session time out.
  2. Additional flow not necessarily error based,  a flow that could happen. Example: While investor trying to invest, system gives a warnings that Stock Market will close in 10 minutes.
- Assumptions: They can be easily confused with Pre-condition. They are outside the scope of any requirement. Assumption is a condition which system assumes to be true (or false) since it does not have a way of verifying them at run time when the Use Case is executed. For example: (a) User authentication information is maintained within the authentication system. (b) All Actors communicate in English.

Use Case Diagram :
  • Actor
  • Use Case
  • Genernalization : Reusing Use Cases
    • Extends
    • Includes
  • Show type and sub type of actors
  • Relationships
    1. Between Use Cases
    2. Between Actor and Use case
We will cover Use cse diagram in UML post.

No comments:

Post a Comment