<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Proposed Method in Agile Practices to Create Requirements Documentation and Test Cases</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Palash Bera</string-name>
          <email>pbera@slu.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Abhimanyu Gupta</string-name>
          <email>abhimanyugupta@slu.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Saint Louis University</institution>
        </aff>
      </contrib-group>
      <fpage>113</fpage>
      <lpage>121</lpage>
      <abstract>
        <p>Two problems are common in agile based software development approaches. First, software requirements change frequently and therefore they are difficult to maintain and document. Second, test case development takes time and effort and thus the testing process is often delayed. To provide solution to these problems, we suggest using Action-Triad method for capturing the software application requirements. This method can be used to create conceptual models that can be used as documentation in agile development. The method can also create requirements traceability matrix (RTM) and test cases. When the requirements change, the conceptual models, RTM, and test cases can be regenerated. The method is demonstrated here using a case study.</p>
      </abstract>
      <kwd-group>
        <kwd>Requirements Documentation</kwd>
        <kwd>Conceptual Models</kwd>
        <kwd>Test Case</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Agile practices advocate on iterative and test-driven software development strategy
where the focus is on working software and not on extensive documentation [1, 2].
Agile practices focus on capturing the requirements through user stories which are
constantly updated in the development cycle [
        <xref ref-type="bibr" rid="ref14">3</xref>
        ]. In a survey on agile practice, [4]
found that most organizations struggle to identify requirements and maintain the
changes in the requirements. A test case is a set of inputs, execution conditions, and
expected results to verify that a software program is compliant to specific
requirements [5]. Agile practices suggest that test cases based on the requirements should be
written prior to the codes written by the developers [6]. However, based on a case
study, [1] found that incremental software development was not tested as test
implementation was too slow. Developing test cases from the requirements took lot of time
and effort. As a result, much testing was postponed until the later stages of the
project, resulting in generating large number of software defects.
      </p>
      <p>Kaner [7] mentions that designing good test cases is a complex art as the process of
test creation is subjective and is based on testers’ domain knowledge. Also there is no
clear method in writing test cases. For example Kaner mentions that if an application
has 20 variables, then should we create one test case combining all variables or
multiple test cases for each variable. In agile development, creating test cases is
particularly challenging as the application changes frequently during the development process.
Based on the above discussion, two questions can be raised in the context of agile
practices: (1) how to document requirements in a standardized way so that the
requirement changes are captured quickly? and (2) how to create test cases consistently
and quickly prior to software application development? To answer these questions,
this paper proposes an action based method for capturing requirements in a structured
way and creating test cases based on these requirements. The structured requirements
can be documented and changes in the requirements can be controlled through the use
of the method. The method can be also used for creating test cases thus test cases can
be created before the software application is developed. In section 2, this method is
described and in section 3, a sample case study is presented. Section 4 is the
discussion section where the benefits for practice are discussed.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Action Triad method</title>
      <sec id="sec-2-1">
        <title>Dimension Instance</title>
      </sec>
      <sec id="sec-2-2">
        <title>An agent is an entity that can interact with objects or other agents [8].</title>
        <p>A function represents activities that are performed by agents.</p>
        <p>An object represents non-agents in the domain with which the agents act.</p>
        <p>Objects can be tangible (e.g. Phone) or intangible (e.g. Web site).</p>
        <p>Dimensions describe the objects or agents in measurable form.</p>
        <p>Dimensions have instances that are generally expressed in text or numbers.</p>
        <p>Software application requirements can be decomposed into a set of triads. These
triads can have precedence (i.e. function of one triad needs to be performed earlier than
the other). Additional concepts - instances, scenario, expected results, and
requirement ID are identified that are relevant to software testing. A dimension can have
multiple values or instances. Each instance can have a positive or a negative scenario.
Positive scenario means that the action with the specific instance can be performed
successfully. If the user cannot perform the action successfully with a specific
instance then the scenario is negative. For example, if password is null then the null
instance is considered as a negative scenario as the action login (dimension of which
is password) cannot be completed successfully. Expected results indicate the outcome
when an action is taken using a specific instance (e.g. null password should result in
incomplete login).</p>
        <p>When the action triads are processed by a software tool then two types of outputs
are generated- a set of conceptual models and tables and set of test cases. Conceptual
models are generally graphical representations (e.g. UML Use Case and BPMN
process models) of the domain that need to be reflected in the Information Systems [9].
Conceptual models are used for documenting the features of the domain that needs to
be reflected in the Information Systems [9]. [10] mention that conceptual models
could be highly relevant in agile development methods as agile development requires
efficient communication between the stakeholders. The conceptual models and their
descriptions can be used as requirements documentation in agile development. Using
the precedence of the triads, a high level BPMN process model can be created and
using the agents and the action performed by them, UML Use Case model can be
developed. The dimensions of the functions can be used to create test case steps and
the instances can be used in these test cases. As a large combination of instances can
create large number of test cases therefore an optimization engine (part of the
software tool) could be used to come up with minimum number of test cases that can
cover maximum combination of instances. As the action triad method captures the
requirements ID, therefore a requirements traceability matrix (RTM) can also be
generated. RTM maps the requirements with the test cases. A set of guidelines is
proposed so that application requirements can be captured in to set of action triads. These
guidelines are:
 Decompose an application to be developed to sets of action triads.
 Indicate the sequence of the action triads for the application.
 Ensure that each action triad is unique for an application under testing.
 Ensure that each dimension has an instance with at least one positive scenario.
In this method, functions must have dimensions but agents and objects may not.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>A Case Study</title>
      <sec id="sec-3-1">
        <title>Description</title>
        <p>The user needs to provide a valid username and password to successfully
login to the application.</p>
        <p>After the user logs into the application, then she is taken to the browse 1.2
application page where the user can click on different reports.</p>
        <p>On clicking the logout button the user gets an alert to logout. If the user 1.3
clicks on yes then she is logged out otherwise on clicking cancel the user
is taken back to the browse application page.</p>
        <p>A user has a valid username (John) and a valid password (1234!). 1.4
The screen shots of the interface of the application are shown in Figure 1.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Requirement ID</title>
        <p>1.1
The outputs of the action-triad method are described next. In Figure 2, high level Use
Case and BPMN diagram are generated from the method. As the agent –user is
associated with two actions therefore the Use Case shows these two actions. Login
application is followed by the logout application and they are shown accordingly in the
BPMN. It is to be noted that these models are high level as detailed level information
(e.g. join operators in BPMN) is not captured in the method.</p>
        <p>User</p>
        <p>Login Application
Logout Application</p>
        <p>User</p>
        <p>Login Application</p>
        <p>Logout Application
Fig. 3: Action path model for Login function
Select valid LoginUsername
Select valid LoginPassword
Based on the triad information, the tool uses an optimization engine to create test
cases with specific steps. A test case generally contains specific steps that testers need
to perform to test a certain function of an application. Along with the steps, a test case
contains test objective, expected results, and traceability (i.e. which steps correspond
to specific part of the requirements) [11]. The engine optimizes the dimensions and
their instances to create test cases. The dimensions (column 1 of table 3) become test
case step descriptions and the instances (column 2 of table 3) become the values of
these descriptions. As all the instances will not fit into one test case therefore the
optimization engine will create multiple test cases ensuring that a pair of instances is
covered in at least one test case. To make the test case step description readable,
specific user actions (e.g. enter or click) are used in the step descriptions. In the tool,
each dimension can be classified as: text, dropdown, and button. These keywords are
linked to action words that users perform to test the application. For example, if text is
selected as a dimension type then the keyword “Enter” will be used in the test case
step description. Thus a test case step description could be “Enter John as
LoginUsername” where John is an instance of the dimension LoginUsername (type is
text). Similarly when dimension type is button then the keyword “click” is used in the
step description.</p>
        <p>For the case study described here, the action triad method generated 5 test cases (1
positive and 4 negative) for the login function. Table 4 shows two test cases of login
function that are generated using the action-triad method. Each test case has a
description, step number, step description, expected results, and traceability. The step
description has specific actions with specific values (e.g. Enter “John” as
LoginUserName). However, each test case is different as different combinations of
instances are used. If one of the instances has a negative scenario then the test case is
considered negative meaning the actions mentioned in the test case should not be
successfully executed. If no instances have negative scenarios then the test case is
considered as positive meaning the actions mentioned in the test case should be
executed successfully.</p>
        <p>Each test case starts with the instances of the dimensions (e.g. UserPassword and
UserUsername) of the entities (e.g. user). This step is considered as a pre-requisite i.e.
the condition that is required before the test case can be run. A pre-requisite step does
not have expected results and traceability.</p>
        <p>Each test case can have only one negative instance scenario. This is because from a
tester’s perspective, if a test case has two or more negative instances (e.g. Username
is null and password is null) then it is not possible to identify the exact cause of
failure of the test (e.g. whether the test failed because password was incorrect or it failed
because the username was incorrect).
The action triad method also creates a standardized form of test cases called- Gherkin
syntax (Figure 4). Gherkin syntax is a business readable language that describes the
behavior of the software. The syntax includes status parameter and the values of
status are either successful or unsuccessful. If a test case has a negative value of an
instance then the status is unsuccessful or else the status is successful. Gherkin syntax
(Figure 4) is a rearrangement of the test cases written in tabular format (Table 4). In
some agile projects, user stories are written in Gherkin syntax and used to generate
automated test scripts using test automation tools.</p>
        <p>Feature: User Login Application
As a User
I want to Login Application
Given UserPassword is '&lt;UserPassword&gt;'
And UserUsername is '&lt;UserUsername&gt;'
When User Login Application
And LoginUsername is '&lt;LoginUsername&gt;'
And LoginPassword is '&lt;LoginPassword&gt;'
And LoginTrigger is '&lt;LoginTrigger&gt;'
Then status of Login should be '&lt;Status&gt;'
Examples:
Scenario Outline: User attempts to Login Application with various input parameters
| UserPassword | UserUsername | LoginUsername | LoginPassword | LoginTrigger | Status |
| 1234! | John | John | 1234! | Login | Successful |
| 1234! | John | John | Password | Login | Unsuccessful |
| 1234! | John | Blank | 1234! | Login | Unsuccessful |
| 1234! | John | JohnInvalid | 1234! | Login | Unsuccessful |
| 1234! | John | John | Blank | Login | Unsuccessful |</p>
        <p>Fig. 4: Gherkin syntax of the test cases for the login function
In agile practices, software development is performed by teams that include business
analysts, testers, and developers [1]. Due to short implementation cycles (sprints) in
agile, the analysts face difficulty in developing requirements documentation. Further
as the application requirements change, the documentation needs to be updated
frequently. The testers in the agile team face the challenge of developing the test cases
prior to the codes written by the developers.</p>
        <p>The proposed action-triad method helps to resolve these challenges by capturing the
requirements in a systemic way. The method generates conceptual models that can be
used for requirements documentation. The RTM and test cases in multiple formats are
also generated in this method. When the application requirements change, the
conceptual models, RTM, and test cases can be regenerated.</p>
        <p>The requirements documentation, RTM, and test cases are currently written manually
but the use of the action-triad method can help the agile teams to develop these
outputs automatically. Thus the software applications can be developed in shorter time.
Currently, the action-triad method is applied to few real-world agile practice based
projects using a software tool. To test the effectiveness of the method, it has to be
applied to complex application development projects and modified as necessary.</p>
        <p>State diagrams as models have also been used for creating automated test cases. A
state diagram depicts the states that a system can assume and shows the events that
cause and/or result from a change from one state to another [11]. Test cases are
derived from the state diagrams by identifying valid and invalid state transitions [11].
However, there are two main challenges in using such models. First, developing such
models is difficult due to the complexity of state diagrams. As the application gets
complex, the number of states and the transitions grow rapidly creating explosion of
states (a phenomenon called – state explosion [12]). Second, creating optimized test
cases from these models is challenging because of large number of states and the
frequent change in the functionalities of the application. A complex application will
have a large number of states and transitions. Thus modeling such application using
state diagrams is challenging and so is deriving the test cases from the diagrams.
Alternatively, we suggest using ER based Action Triad method as there is no need of
modeling transitions and only the higher state changes are modeled using triads.
Decomposing an application into set of triads is still a modeling skill that modelers need
to apply. However, once the triads are identified, the methodology helps to create the
model elements consistently.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Heeager</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <article-title>Introducing Agile Practices in a Documentation-Driven Software Development Practice: A Cast Study</article-title>
          .
          <source>Journal of Information Technology Case and Application Research</source>
          ,
          <year>2012</year>
          .
          <volume>14</volume>
          (
          <issue>1</issue>
          ): p.
          <fpage>3</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Fowler</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>The new methodology</article-title>
          .
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Beck</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Andres</surname>
          </string-name>
          ,
          <source>Extreme Programming Explained: Embrace CHange</source>
          .
          <year>2004</year>
          , Boston: Addison- Wesley
          <string-name>
            <surname>Professional</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Sillitti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , et al.
          <article-title>Managing Uncertainty in Requirements: A Survey in Documentation-Driven and Agile Companies</article-title>
          .
          <source>in 11th IEEE Int'l Symp.</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Software</given-names>
            <surname>Metrics</surname>
          </string-name>
          .
          <year>2005</year>
          . IEEE Press.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          , IEEE Standard 610, in IEEE Standards Collection: Software Engineering.
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Boehm</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <given-names>B.</given-names>
            <surname>Turner</surname>
          </string-name>
          ,
          <article-title>Management Challenges to Implementing Agile Processes in Traditional Development Organizations</article-title>
          .
          <source>IEEE Software</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <volume>22</volume>
          (
          <issue>5</issue>
          ): p.
          <fpage>30</fpage>
          -
          <lpage>39</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Kaner</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <article-title>Architectures of Test Automation</article-title>
          .
          <source>in STAR West</source>
          .
          <year>2000</year>
          . San Jose, Canlifornia.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Wooldridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <source>Reasoning about Rational Agents</source>
          .
          <year>2000</year>
          , Massachusetts: The MIT Press.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Dobing</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>J. Parsons</surname>
          </string-name>
          ,
          <article-title>Dimensions of UML Diagram Use: A Survey of Practitioners</article-title>
          .
          <source>Journal of Database Management</source>
          ,
          <year>2008</year>
          .
          <volume>19</volume>
          : p.
          <fpage>1</fpage>
          -
          <lpage>18</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Rubin</surname>
            ,
            <given-names>E. and H.</given-names>
          </string-name>
          <string-name>
            <surname>Rubin</surname>
          </string-name>
          ,
          <source>Supporting Agile Software Development Through Active Documentation. Requirements Engineering</source>
          ,
          <year>2011</year>
          .
          <volume>16</volume>
          : p.
          <fpage>117</fpage>
          -
          <lpage>132</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Board</surname>
            ,
            <given-names>I.S.T.Q</given-names>
          </string-name>
          .
          <source>Standard Glossary of Terms Used in Software Testing</source>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <issue>Version 3</issue>
          .1.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Valmari</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <article-title>The State Explosion Problem, Lectures on Petri nets: Advances in Petri nets</article-title>
          .
          <year>1998</year>
          . Berlin-Heidelberg: Springer-Verlang.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>