Writing use cases

Posted by Jad on June 02, 2007

Today I wanted to start writing the detailed use cases after having sketched most of the wireframe. I’ve been doing my usual research and here are the interesting documents I found for ‘use case’:

Now, some developers might disagree with me, but I opted not to do all the different UML diagrams for 2 reasons:
  1. As for any first version of a product, no matter how much I believe in its success, I prefer investing the least time possible when starting and instead focus on getting it built. When the application prooves to be successful, a complete rebuild can be made, inflicting a higher cost than just upgrading it, but that’s negligeable since it would pay for itself.
  2. I don’t have a complete knowledge of UML to say that it would be a perfectly solid one. I’d rather concentrate on learning more about it instead of playing with it.
That been said, Writing Effective Use Cases inspired me to make an XML for writing those use cases so they could be parsed later on to write documentation, usability tests, etc. And those of course will be reusable.

Here is a sample of the first 3 use cases I wrote.

<usercases>
    <usecase>
        <name>Use Case 1</name> 
        <description>Register User</description>
        <sitting>Instant</sitting>
        <primaryactor>User</primaryactor>
        <scope>System, Beanstream API</scope>
        <level>User goal</level>
        <stakeholders>
            <stakeholder>User</stakeholder>
            <interest>Getting a membership access</interest>
            <stakeholder>System</stakeholder>
            <interest>Saving all valid user data and creating account</interest>
            <stakeholder>Company</stakeholder>
            <interest>Getting paid</interest>
        </stakeholders>
        <minimalguarantee>Sufficient validation to detect wrong inputs and failed payments</minimalguarantee>
        <successguarantee>Beanstream API has acknowledged the purchase, the user's account is created</successguarantee>
        <scenario>
            <step>User selects membership plan</step>
            <step>System gets billing information from user</step>
            <step>System sends data to Beanstream API</step>
            <step>Beanstream API bills user</step>
            <step>System creates user account</step>
            <step>System writes cookie and session for user</step>
            <step>System forwards user to account</step>
        </scenario>
        <extensions>
            <extension>
                <extends>2</extends>
                <xcase>User enters invalid billing information</xcase>
                <step>System alerts user of the error(s)</step>
                <step>System gets new billing information from user</step>
            </extension>
            <extension>
                <extends>4</extends>
                <xcase>Beanstream API transaction fails</xcase>
                <step>System alerts user of the error(s)</step>
                <step>System gets new billing information from user</step>
            </extension>
        </extensions> 
    </usecase>

&lt;usecase&gt;
    &lt;name&gt;Use Case 2&lt;/name&gt; 
    &lt;description&gt;Log User&lt;/description&gt;
    &lt;sitting&gt;Instant&lt;/sitting&gt;
    &lt;primaryactor&gt;User&lt;/primaryactor&gt;
    &lt;scope&gt;System&lt;/scope&gt;
    &lt;level&gt;User goal&lt;/level&gt;
    &lt;stakeholders&gt;
        &lt;stakeholder&gt;User&lt;/stakeholder&gt;
        &lt;interest&gt;Accessing his account&lt;/interest&gt;
        &lt;stakeholder&gt;System&lt;/stakeholder&gt;
        &lt;interest&gt;Identifying and authorizing the user&lt;/interest&gt;
    &lt;/stakeholders&gt;
    &lt;preconditions&gt;
        &lt;precondition&gt;User must have a valid account&lt;/precondition&gt;
    &lt;/preconditions&gt;
    &lt;minimalguarantee&gt;Sufficient validation for existing account and right credentials&lt;/minimalguarantee&gt;
    &lt;successguarantee&gt;System has authorized access, user gets access to account&lt;/successguarantee&gt;
    &lt;scenario&gt;
        &lt;step&gt;System gets credentials from user&lt;/step&gt;
        &lt;step&gt;System writes cookie and session&lt;/step&gt;
        &lt;step&gt;System logs access datetime&lt;/step&gt;
        &lt;step&gt;System redirects user to account&lt;/step&gt;
    &lt;/scenario&gt;
    &lt;extensions&gt;
        &lt;extension&gt;
            &lt;extends&gt;0&lt;/extends&gt;
            &lt;xcase&gt;System validates session&lt;/xcase&gt;
            &lt;step&gt;System redirects to account&lt;/step&gt;
        &lt;/extension&gt;
        &lt;extension&gt;
            &lt;extends&gt;1&lt;/extends&gt;
            &lt;xcase&gt;User enters invalid credentials&lt;/xcase&gt;
            &lt;step&gt;System alerts user of the error(s)&lt;/step&gt;
            &lt;step&gt;System gets new credentials from user&lt;/step&gt;
        &lt;/extension&gt;
    &lt;/extensions&gt; 
&lt;/usecase&gt;

&lt;usecase&gt;
    &lt;name&gt;Use Case 3&lt;/name&gt; 
    &lt;description&gt;Reset Password&lt;/description&gt;
    &lt;sitting&gt;Instant&lt;/sitting&gt;
    &lt;primaryactor&gt;User&lt;/primaryactor&gt;
    &lt;scope&gt;System&lt;/scope&gt;
    &lt;level&gt;User goal&lt;/level&gt;
    &lt;stakeholders&gt;
        &lt;stakeholder&gt;User&lt;/stakeholder&gt;
        &lt;interest&gt;Retrieving access to his account&lt;/interest&gt;
        &lt;stakeholder&gt;System&lt;/stakeholder&gt;
        &lt;interest&gt;Making sure the request comes from the real account holder&lt;/interest&gt;
    &lt;/stakeholders&gt;
    &lt;preconditions&gt;
        &lt;precondition&gt;User must have a valid account&lt;/precondition&gt;
    &lt;/preconditions&gt;
    &lt;minimalguarantee&gt;Sufficient validation to check existing account&lt;/minimalguarantee&gt;
    &lt;successguarantee&gt;System resets password&lt;/successguarantee&gt;
    &lt;scenario&gt;
        &lt;step&gt;System gets email address from user&lt;/step&gt;
        &lt;step&gt;System sends confirmation email to user&lt;/step&gt;
        &lt;step&gt;User follows email's link&lt;/step&gt;
        &lt;step&gt;System resets password&lt;/step&gt;
        &lt;step&gt;System emails new password to user&lt;/step&gt;
        &lt;step&gt;System logs action&lt;/step&gt;
    &lt;/scenario&gt;
    &lt;extensions&gt;
        &lt;extension&gt;
            &lt;extends&gt;1&lt;/extends&gt;
            &lt;xcase&gt;User enters invalid email&lt;/xcase&gt;
            &lt;step&gt;System alers user with error(s)&lt;/step&gt;
            &lt;step&gt;System gets new email address from user&lt;/step&gt;
        &lt;/extension&gt;
        &lt;extension&gt;
            &lt;extends&gt;3&lt;/extends&gt;
            &lt;xcase&gt;User follows invalid link&lt;/xcase&gt;
            &lt;step&gt;System alers user with error(s)&lt;/step&gt;
            &lt;step&gt;System gives option to manually enter the confirmation code&lt;/step&gt;
        &lt;/extension&gt;
        &lt;extension&gt;
            &lt;extends&gt;3&lt;/extends&gt;
            &lt;xcase&gt;User enters invalid confirmation code&lt;/xcase&gt;
            &lt;step&gt;System alers user with error(s)&lt;/step&gt;
            &lt;step&gt;System gives option to manually re-enter the confirmation code&lt;/step&gt;
        &lt;/extension&gt;
    &lt;/extensions&gt; 
&lt;/usecase&gt;

</usecases>

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments