Method and system for generating functional test cases
The present invention provides a method, system and computer program product for generating one or more functional test cases for testing a software application. One or more use-case activity diagrams are developed for the software application on the basis of a predefined set of rules. The consistency of the use-case activity diagrams is checked automatically. Further, the consistent use-case activity diagrams are validated with one or more users. Furthermore, the one or more functional test cases are generated automatically from the validated use-case activity diagrams.
Latest Infosys Technologies Limited Patents:
- Knowledge artifact analysis system and method
- COMPOUND VERSIONING AND IDENTIFICATION SCHEME FOR COMPOSITE APPLICATION DEVELOPMENT
- METHOD AND SYSTEM FOR PREEMPTIVE DETECTION OF OCCURRENCE OF FAULTY CONDITIONS BASED ON RESOURCE USAGE
- METHOD AND SYSTEM FOR PROVIDING ELECTRONIC NOTIFICATION
- Real time business event monitoring, tracking, and execution architecture
The present invention relates to the field of testing software applications. More specifically, the invention relates to generating functional test cases for testing software applications.
The primary purpose for testing software applications is to identify defects, so that these defects or errors may be corrected. Typically, during the testing phase of a software development life cycle, a software application is tested to identify its ambiguities, incompleteness, and errors. The scope of testing the software application includes examination and execution of a software code in different environments and conditions. It also includes examining the quality aspects of the software code.
Software testing generally includes two critical phases—test planning and test execution. The test planning phase includes creation and maintenance of test cases, data, and scripts. A test case or a test scenario in software engineering generally includes a unique identifier, requirement references from design specifications, preconditions, events, a series of steps or actions to perform, input, output, expected results, and actual results. The test execution phase includes executing the software based on the test plans and test cases, and reporting any errors found to the development team. Thereafter, the development team rectifies the errors either in the design of the software application or in the software code.
Presently, the test execution phase has been significantly automated. Existing test automation frameworks aim at automating the test execution phase. However, the test planning phase is largely performed manually. In many Information Technology (IT) organizations, test cases, data, and scripts are created manually and maintained from Software Requirements Specifications (SRS). With the advancement in the software technology, the complexity of the software applications is increasing significantly, resulting in an increase in the number of test cases. Therefore, the test planning phase is effort intensive and prone to human errors. Further, the existing techniques used for automatic generation of test cases are used for testing embedded software and are not useful in the general application testing domain as the embedded software applications have a wide range of deployment architectures in comparison to the general software applications. Furthermore, the existing techniques generate test cases from unstructured Unified Modeling Language (UML) use-case activity diagrams or UML state diagrams.
In light of the discussion above, there is a need for a method, system and computer program product for automatically generating functional test cases for testing software applications. Further, the method should be computationally efficient.
BRIEF SUMMARY OF THE INVENTIONAn object of the invention is to automatically generate functional test cases for testing a software application.
Another object of the invention is to structure use-case activity diagrams used for generating the functional test cases.
To achieve the objectives mentioned above, the invention provides a method, system and computer program product for generating one or more functional test cases used for testing a software application. A Software Requirements Specifications (SRS) for the software application is analyzed for developing a plurality of use cases. The use cases thus developed are then analyzed for developing one or more use-case activity diagrams based on a predefined set of rules. A plurality of units of behavior is identified from the use cases and is then used for developing use-case activity diagrams. Each use-case activity diagram thus developed is an ordered sequence of a plurality of units of behavior. Further, consistency of each of the use-case activity diagrams is automatically checked. Based on the consistency check, the consistent use-case activity diagrams are validated with one or more users. Finally, one or more functional test cases are generated automatically from the validated use-case activity diagrams.
The method, system and computer program product described above have various advantages. The method provides a systematic approach for structuring use-case activity diagrams. The structured use-case activity diagrams are useful in automatic generation of functional test cases as well as other activities of a software development life cycle such as design of software applications, and so forth. The structured use-case activity diagrams also assist in identifying ambiguities and incompleteness of the SRS at an early stage of the software development life cycle. Additionally, the method provides a systematic approach for generation of functional test cases for system testing which further provides a complete coverage of test cases for identifying errors in software applications. Furthermore, the method provides a computationally efficient and simple method for creation and maintenance of functional test cases, thereby saving cost, time and effort.
The various embodiments of the invention will hereinafter be described in conjunction with the appended drawings, provided to illustrate and not to limit the invention, wherein like designations denote like elements, and in which:
The invention describes a method, system and computer program product for generating one or more functional test cases, also referred to as system test cases, used for testing a software application. One or more use-case activity diagrams are developed for the software application on the basis of a predefined set of rules. The consistency of the use-case activity diagrams is checked automatically, and the consistent use-case activity diagrams are validated with one or more users. Further, one or more functional test cases are automatically generated from the validated use-case activity diagrams.
At step 102, one or more use-case activity diagrams for the software application are developed based on a predefined set of rules. A use-case activity diagram is a graphical representation of the expected behavior or functionality or use case scenario of the software application. The use-case activity diagram is an ordered sequence of activities modeling the functional behavior of the software application. In various embodiments of the invention, the use-case activity diagrams are defined in various modeling languages such as Unified Modeling Language (UML), Business Process Modeling (BPM) and so forth. The use-case activity diagram is represented as a cyclic directed graph containing a single start node and one or more ending nodes. Further, every path between any two nodes of a use-case activity diagram is a directed path. An exemplary snapshot of a use-case activity diagram is depicted in
In an embodiment of the invention, the development of the use-case activity diagrams includes structuring of the use-case activity diagrams into an ordered sequence of units of behavior. Further, the predefined set of rules used for developing the use-case activity diagrams is based on decomposing or slicing of the behavior represented by the use-case activity diagrams. The behavior is sliced into the plurality of units of behavior. In an embodiment of the invention, the predefined set of rules is defined by a software developer. The development of the use-case activity diagrams based on the predefined set of rules is described in detail in conjunction with
Each use-case activity diagram that is developed based on a predefined set of rules includes the ordered sequence of a plurality of units of behavior. A unit of behavior consists of an indivisible logical unit of input, processing of the input, a set of conditions, and an output. The input is provided by either by a user, a system developed for executing the functional test cases or a software application. For example, a trigger from an electronic timer on reaching a set time can be used as an input. Further, the set of conditions includes zero or more conditions specified by a user. In an embodiment of the invention, the set of conditions are specified by a business user(s) or person using the software application. Furthermore, the output is based on the processing of the input and the set of conditions by the system developed for executing the functional test cases. Once the input is received, it is processed by the system. In an embodiment of the invention, the system developed for executing the functional test cases includes a data processing unit. Based on the processing of the input and the set of conditions that are true, the output is generated by the system. An exemplary snapshot of a unit of behavior is depicted in
At step 104, consistency of the use-case activity diagrams developed at step 102 is checked. The consistency of the use-case activity diagrams is checked automatically without any manual intervention. The consistency check of the use-case activity diagrams includes checking whether the predefined set of rules has been followed or not during the development of the use-case activity diagrams. In other words, the consistency check refers to checking whether each use-case activity diagram is structured or not, i.e., whether each use-case activity diagram includes a complete and an ordered sequence of multiple units of behavior or not. The process of checking the consistency of the use-case activity diagrams has been explained in detail in conjunction with
At step 106, the consistent use-case activity diagrams are validated with one or more users. The use-case activity diagrams that are updated at step 104, based on the consistency check, are also validated with the users. In an embodiment of the invention, the use-case activity diagrams are validated with the business user(s). In another embodiment of the invention, the use-case activity diagrams are validated with the software developer. The validation of the use-case activity diagrams includes checking whether the entire business functionality of the software application is covered or not. In an embodiment of the invention, the validation of the use-case activity diagrams is performed manually by the business users. In another embodiment of the invention, the validation of the use-case activity diagrams is performed manually by the software developer. The client reviews and validates each path in the structured use-case activity diagram. The validation is performed in terms of a complex behavior being composed of a logical or ordered sequence of multiple units of behavior.
At step 106, the validated use-case activity diagrams are updated or refined on the basis of one or more requirements or inputs of the users. If it is determined that a validated use-case activity diagram does not cover one or more aspects of the business functionality of the software application, the particular use-case activity diagram is updated. The use-case activity diagram is updated to incorporate the inputs/feedback provided by the business users and therefore, covers the entire the business functionality of the software application. In an embodiment of the invention, the use-case activity diagram is updated by adding one or more units of behavior in the use-case activity diagram. Each unit of behavior thus added represents at least one step used to obtain the business functionality of the software application. In another embodiment of the invention, the use-case activity diagram is updated by correcting error(s) in the use-case activity diagrams.
At step 106, the criticality of the multiple units of behavior in the use-case activity diagram is also identified. In an embodiment of the invention, the criticality of the units of behavior is divided into various levels such as highly critical, moderately critical, and lowly critical. The units of behavior are accordingly marked as highly critical, moderately critical, and lowly critical in the corresponding use-case activity diagrams. It will be evident to a person skilled in the art that the criticality of the units of behavior can be categorized into various other levels having different representation(s). Each unit of behavior is classified based on the criticality of the particular unit of behavior. In an embodiment of the invention, the criticality of the units of behavior is identified manually by the software developer. In another embodiment of the invention, the criticality of the units of behavior is identified manually by the business user(s).
In an embodiment of the invention, at step 106, a plurality of use-case activity diagrams for one or more software applications are linked together. The linking of the use-case activity diagrams facilitates the reusability of the use-case activity diagrams. The one or more use-case activity diagrams generated for a software application may be reused in another software application. Further, the use-case activity diagrams generated for a software application can be linked to one or more use-case activity diagrams of the same or different software application. The linking of the use-case activity diagrams is explained in detail in conjunction with
At step 108, one or more functional test cases are generated from the validated use-case activity diagrams. Further, the functional test cases are generated from the use-case activity diagrams that are updated at step 106 based on the validation by the one or more users. Furthermore, the functional test cases are generated from the linked use-case activity diagrams. The functional test cases are generated automatically without any manual intervention. In an embodiment of the invention, the functional test cases are generated automatically using a tool developed by Infosys Corporation, the assignee of the present application. In another embodiment of the invention, the functional test cases are generated automatically using different tools such as Conformiq Qtornic, UniTESK and the like. The tool facilitates a software developer to automatically generate functional test cases from the structured, consistent, and validated use-case activity diagrams.
The functional test cases are generated from the use-case activity diagrams represented in the form of cyclic directed graphs. The functional test cases are generated by traversing each path of the use-case activity diagram represented in the form of cyclic directed graphs. The nodes of the use-case activity diagram are identified using one or more identification tags. The nodes are processed for generating the functional test cases. The processing of the nodes is based on the identification tags of the nodes. The nodes and their identification tags have been explained in conjunction with
The automatic generation of the functional test cases includes the use of a test case generation algorithm. An exemplary test case generation algorithm can be implemented by using the following code:
The test case generation algorithm performs a depth-first search of the use-case activity diagram and extracts all paths of the use-case activity diagrams. Since a use-case activity diagram is a cyclic graph, all cyclic sub-paths of the use-case activity diagram are traversed for a predefined number of times. The predefined number of traversals varies from one to a finite number. The number of traversals of the cyclic sub-paths is selected by the software developer or the software tester. Further, for each path extracted from the use-case activity diagram, the test case generation algorithm slices the path into an ordered sequence of units of behavior. The paths thus extracted are used to generate the functional test cases. Each unit of behavior in a particular path is extracted and represented as a single test case step. Further, the path starting from a start node or an initial node to an end node or a final node consists of multiple units of behavior and is extracted and represented as a single test case. Therefore, the number of test cases generated for a particular use-case activity diagram is equal to the number of paths in the use-case activity diagram and the number of all cyclic sub-paths traversed. Exemplary snapshots of test cases corresponding to a particular use-case activity diagram are depicted in
At step 108, the generated functional test cases are further prioritized based on the criticality of the units of behavior. In an embodiment of the invention, based on the classification of the units of behavior, the corresponding test cases are also marked as highly critical, moderately critical, and lowly critical. Based on the classification of the functional test cases, they are prioritized for their use and applicability in testing the software application.
The use-case activity diagrams are developed for generating one or more functional test cases used for testing a software application, as explained in conjunction with
At step 202, Software Requirements Specifications (SRS) for the software application is analyzed. The SRS provides a complete description of the behavior or the functionality of the software application to be developed. The SRS includes one or more functional requirements for the software application in terms of the level of interactions of the users with the software application. The SRS is provided by one or more users of the software application. In an embodiment of the invention, the SRS is provided by the business users. The analysis of the SRS is performed manually by the software developer.
At step 204, a plurality of use-cases is developed for the SRS. A use case describes functional requirements of the software application. Therefore, a single use case or multiple use cases can be developed for a single SRS. In an embodiment of the invention, the use cases are identified from the SRS. The use cases are developed or identified manually by the software developer.
At step 206, the plurality of use cases developed at step 204 are analyzed. Each of the plurality of use cases for a software application is analyzed for developing the use-case activity diagrams. The analysis of the use cases includes identification of a plurality of units of behavior from the multiple use cases. The units of behavior have been explained in detail in conjunction with
At step 208, the one or more use-case activity diagrams are developed based on a predefined set of rules. Each use-case activity diagram corresponds to a functionality of one or more use cases of the software application. For example, a use-case activity diagram corresponding to the validation of a Personal Identification Number (PIN) of a debit card or a credit card can be used for the use cases corresponding to different ATM operations as well as different credit card operations. Further, the functionality of each use-case of the software application can be represented using multiple use-case activity diagrams. For example, a use case for different operations at an ATM can be represented using different use-case activity diagrams for the corresponding operations to be performed.
A use-case activity diagram represents the behavior or functionality of the corresponding one or more use cases. The plurality of units of behavior identified at step 206 is used for the development of the use-case activity diagrams. The use-case activity diagrams thus developed are such that each use-case activity diagram is an ordered sequence of the plurality of units of behavior. In an embodiment of the invention, the development of the use-case activity diagrams includes structuring of the use-case activity diagrams. The multiple units of behavior identified at step 206 are structured into an ordered sequence and are therefore used for developing the use-case activity diagrams. Further, each use-case activity diagram includes all exceptions that are possible for a particular functionality or use case scenario represented by the use-case activity diagrams.
-
- Select academic semester
- Display courses available in the selected semester
- Select desired academic course
- Check if the prerequisite is satisfied by a student
- If the student satisfies the prerequisite, display a message, ‘Student added to the class’
- If the student does not satisfy the prerequisite, display a message, ‘Prerequisite not satisfied’
As explained in conjunction with
UI: Select academic semester
SP: System reads the available courses for selected semester
SO: Display courses available in the selected semester
UI: Select desired course
SP: System reads the prerequisite for the selected course
C: If a student satisfies the prerequisite
SO: System displays ‘Student added to class’ message
SO: System displays ‘Prerequisite not satisfied’ message
In an embodiment of the invention, the processing of the inputs is performed implicitly by the system and is not denoted explicitly in the use-case activity diagrams. Therefore, the system processing nodes (denoted by SP) are optional, and are hence not denoted in the use-case activity diagrams.
Since each use-case activity diagram includes multiple units of behavior, the different nodes of the use-case diagram are also included in the units of behavior, as illustrated in conjunction with
In an embodiment of the invention, the use-case activity diagrams are represented in the Unified Modeling Language (UML). The UML facilitates creation and addition of two types of nodes in addition to the nodes included in the use-case activity diagram. The two types of nodes added to the use-case activity diagrams are a start node (denoted by SR) depicted as 302 in snapshot 300 and an end node or a stop node (denoted by ST) depicted as 304 in snapshot 300. The use-case activity diagram includes a single start node, but can have multiple stop nodes. Further, the use-case activity diagrams include two additional types of nodes—fork node and join node. The fork node and the join node have been explained in conjunction with
The nodes of the use-case activity diagram are also marked based on the criticality of the units of behavior included in the use-case activity diagram. Each activity or task of the unit of behavior is also categorized based on its criticality. Therefore, the user task nodes and/or the system task nodes of the use-case activity diagram are marked with [H], [M], and [L], where H represents highly critical, M represents moderately critical and L represents lowly critical activity or task. It will be evident to a person skilled in the art that the criticality of the nodes can be represented using different alphanumeric notations. Further, the test cases are generated with a criticality depending on the criticality of the tasks/activities involved in the use-case activity diagrams corresponding to the respective test cases. For example, a test case has a high criticality if one of the tasks in its use-case activity diagram is marked as highly critical.
The graphical representation of the functionality of use cases in the form of use-case activity diagrams facilitates decomposition or slicing of the use cases into an ordered or logical sequence of multiple units of behavior. The slicing also facilitates the exceptions to be recorded in the form of units of behavior in the use-case activity diagrams.
The graphical representation of the use cases in the form of use-case activity diagrams also facilitates checking the consistency of the use-case activity diagrams. The use-case activity diagrams are structured according to the predefined set of rules into an ordered sequence of units of behavior. These structured use-case activity diagrams should satisfy the following consistency properties or consistency rules:
-
- There is only one start node (denoted by SR) in the use-case activity diagrams.
- Every path from the start node to a stop node (denoted by ST) contains an ordered sequence of one or more units of behavior. This path includes cyclic sub-paths traversed for one to a finite number of times.
- Each unit of behavior in the use-case activity diagrams begins with one or more consecutive user input nodes (denoted by UI), followed by one or more consecutive system processing nodes (denoted by SP), and zero or more condition nodes (denoted by C), and finally concludes with one or more consecutive system output nodes (denoted by SO).
- Each use-case activity diagram should include one start node, one stop node, one user input node and one system output node.
- Each flow or path, main or alternate, should terminate to a stop node.
- Each user task node, system task node or a condition node should be connected through transitions between the nodes.
- Each fork node needs to have one incoming and multiple outgoing transitions. It cannot have one incoming and one outgoing transition.
- Each join node needs to have one outgoing and multiple incoming transitions. It cannot have one incoming and one outgoing transition.
- A system output node should be followed by either a user task node or a stop node.
- A user task node should be followed by another user task node, a system task node, and a system output node.
- A condition node should be followed by another condition node, a system task node or a system output node.
UI: Select desired course
SP: System reads the prerequisites for the selected course
C: If a student satisfies the prerequisites
SO: System displays ‘Student added to class’ message
Similarly, two other units of behavior are identified from the use case ‘select desired academic courses’.
As explained in conjunction with
In addition to the different types of nodes, the use-case activity diagram includes a different type of node—a fork node, depicted as 502 in snapshot 500. A fork node is a type of node which has a single input path and multiple output paths. The paths that follow the fork node in a use-case activity diagram include activities that can be processed simultaneously. For example, in the use-case activity diagram depicted in snapshot 500, once a person has logged in successfully, different operations such as withdraw cash, change PIN, and so forth, can be performed simultaneously. If the fork node is absent in the use-case activity diagram, the different activities although unrelated are represented sequentially, and therefore, need to be sequentially processed. Further, the functional test cases for the use cases that pass through the fork node are tagged as the execution of these functional test cases is synchronized with the execution of other functional test cases.
The use-case activity diagram also includes another type of node known as join node, depicted as 504 in snapshot 500. A join node has multiple input paths and a single output path. The paths that precede the join node include activities that can be processed simultaneously. For example, in the use-case activity diagram for the use case ‘operating an ATM’ illustrated in
Functional test cases 602 also referred to as test scenarios, include one or more preconditions, criticality, and one or more test steps. The preconditions for a functional test case, hereinafter referred to as test case, refer to the conditions that need to be checked before the execution of the test case. For example, declaration of variables used in one or more tasks, assigning values to variables, checking or comparing values of the variables, and so forth. Criticality refers to the importance of the execution of a test case and is determined on the basis of the criticality of units of behavior, as explained in conjunction with
The test steps are described in terms of description details, input, conditions, expected output, actual output, and remarks. The description details provide information on whether the test case is synchronized with other test cases or not. The test cases for the use cases that pass through the fork node are marked as synchronized with other functional test cases. In an embodiment of the invention, the input required for each and every test step is provided by the user. In another embodiment of the invention, the input required for each and every test step is obtained from a system. The conditions refer to the checks that need to be performed while executing the particular test steps. The expected output of a test step refers to the output for the test step based on the input and the conditions. The output is generated by a system executing the functional test step or test case. For example, if an ATM card is entered as input and the condition ‘Card inserted properly’ is true, then the expected output is to display a message to enter the PIN. The actual output of a test step refers to the output that is generated by the system on executing the test step. It will be evident to a person skilled in the art that the actual output can be different from the expected output. The remarks are the comments provided by the software developer or the testing team on the basis of the expected output and the actual output. For example, functional test case 602a illustrates a test case corresponding to a use case in which a user wants to change a PIN of an ATM card. Functional test case 602a includes test steps for the various units of behavior in a path of the use-case activity diagram. The path corresponds to successfully changing a PIN of an ATM card. Similarly, functional test cases 602b, 602c, 602d, 602e, and 602f correspond to the different paths in the use-case activity diagram for the use case ‘operating an ATM’.
The functional test case illustrated in conjunction with
A plurality of use-case activity diagrams for similar or different software applications can be linked together. The linking of the use-case activity diagrams facilitates reusability of the use-case activity diagrams in different software applications for the same or a different organization. The use-case activity diagrams are linked together by calling a use-case activity diagram in another use-case activity diagram. The linking of the use-case activity diagrams is performed for multiple use-cases that have a set of common activities. The common activities are then represented as a use-case activity diagram which is further used by the different use-case activity diagrams. For example, for ATM operations in a bank, the activities for validating the user PIN are common for various activities, for example, withdrawing cash, changing a PIN, depositing money, and so forth. Therefore, the activities for validating the user PIN are considered as one use case and represented by a single use-case activity diagram. This use-case activity diagram is then used by the use-case activity diagrams for different use cases, for example, cash withdrawal, change PIN, and so forth, as illustrated in conjunction with
In an embodiment of the invention, the use-case activity diagram to be linked or inserted is identified by prefixing ‘UC’ in the description of the node in the use-case activity diagram, as illustrated in conjunction with
The linking of the use-case activity diagrams also addresses the scalability issue of the use-case activity diagrams for a large and complex use case functionality or behavior. The large functionality is decomposed into a set of sub-functionalities and separate use-case activity diagrams are developed for each of the sub-functionalities. All use-case activity diagrams can then be linked to the main use-case activity diagram developed for the main use case, thereby reducing the clumsiness in the use-case activity diagrams.
Development module 902 is configured for enabling at least one user to develop one or more use-case activity diagrams for the software application. The use-case activity diagrams are developed on the basis of a predefined set of rules. The use-case activity diagrams have been explained in detail in conjunction with
The development of the use-case activity diagrams includes structuring of the use-case diagrams into the ordered sequence of units of behavior. Further, the predefined set of rules used for developing the use-case activity diagrams is based on slicing of the behavior represented by the use-case activity diagrams. The behavior is sliced into the plurality of units of behavior. Each use-case activity diagram represents a complex behavior of the software application. The predefined set of rules is based on decomposing or slicing the complex behavior into multiple units of behavior. The development of the use-case activity diagrams based on the predefined set of rules is described in detail in conjunction with
Development module 902 is further configured for enabling the user to analyze a Software Requirements Specifications (SRS) for the software application. The SRS provides a complete description of the behavior or the functionality of the software application to be developed. The SRS is provided by one or more users of the software application. In an embodiment of the invention, the SRS is provided by the business users or the clients. In an embodiment of the invention, the analysis of the SRS is performed manually by the software developer.
Development module 902 is further configured for enabling the user to develop a plurality of use cases for the SRS. In an embodiment of the invention, the user developing the plurality of use cases is a software developer or a software tester. A use case describes functional requirements of a software application. Therefore, a single use case or multiple use cases can be developed for a single SRS. In an embodiment of the invention, the use cases are identified from the SRS. The use cases are developed manually by the software developer.
Development module 902 is further configured for enabling the user to analyze the plurality of use cases for developing the use-case activity diagrams. The analysis of the use cases includes identification of a plurality of units of behavior from the multiple use cases. Each use case describes or represents a complex behavior of the software application. The analysis of the use case includes decomposition of the complex behavior described by the use cases into multiple units of behavior as explained in detail in conjunction with
Consistency checking module 904 is configured to check the consistency of the use-case activity diagrams developed by development module 902. The consistency check of the use-activity diagram includes checking whether the predefined set of rules is followed or not during the development of the use-case activity diagrams. The consistency check of the use-case activity diagrams has been explained in detail in conjunction with
First updating module 906 is configured for enabling the user to update the use-case activity diagrams based on the consistency check performed by consistency checking module 904. If consistency checking module 904 determines that a use-case activity diagram is inconsistent, then the particular use-case activity diagram is updated by first updating module 906, in order to make it consistent with the predefined set of rules.
Validation module 908 is configured for enabling the user to validate the consistent use-case activity diagrams with one or more users. Further, the use-case activity diagrams updated by first updating module 906 are validated with one or more users. In an embodiment of the invention, the use-case activity diagrams are validated with the business users or the clients. The validation of the use-case activity diagrams includes checking whether the entire business functionality of the software application is covered or not. The validation of the use-case activity diagrams has been explained in detail in conjunction with
Second updating module 910 is configured for enabling the user to update the validated use-case activity diagrams based on one or more requirements of the users. The use-case activity diagram is updated by adding one or more units of behavior in the use-case activity diagram, as explained in conjunction with
Identification module 912 is configured for enabling the user to identify the criticality of each of the multiple units of behavior in the use-case activity diagram. In an embodiment of the invention, the units of behavior are marked as highly critical, moderately critical or lowly critical by the user in the corresponding use-case activity diagram, as explained in conjunction with
Linking module 914 is configured for linking a plurality of use-case activity diagrams for one or more software applications. The linking of the use-case activity diagrams facilitates the reusability of the use-case activity diagrams. The linking of the use-case activity diagrams has been explained in detail in conjunction with
Test case generation module 916 is configured for generating one or more functional test cases from the validated use-case activity diagrams. Further, the functional test cases are generated from the use-case activity diagrams updated by second updating module 910. Furthermore, the functional test cases are generated from the use-case activity diagrams linked by linking module 914. The functional test cases are generated automatically by test case generation module 916 without needing any manual intervention. The automatic generation of the functional test cases has been explained in detail in conjunction with
Prioritization module 918 is configured for prioritizing the functional test cases generated by test case generation module 916. The functional test cases are prioritized on the basis of the criticality of the units of behavior corresponding to the functional test cases. The prioritization of the functional test cases has been explained in conjunction with
In an exemplary embodiment of the invention, the assignee of the present application, Infosys Corporation, has implemented system 900 as a software tool developed using JAVA as a programming language. The tool is configured for generating the functional test cases from the structured use-case activity diagrams developed using the Unified Modeling Language (UML). The tool takes use-case activity diagrams as input from three sources-task flow diagrams developed using Influx© by the same assignee, Infosys Corporation; activity diagrams developed using IBM® Rational Rose; and activity diagrams developed using Microsoft® Visio®. Further, the tool produces the functional test cases in a format such as a Hyper Text Markup Language (HTML) format, an Extended Markup Language (XML) format, a text (TXT) format, and a Microsoft® Excel format. The output format thus generated by the tool complies with various test management tools, such as Mercury Quality Control, so that the test cases that are generated using the tool can be easily loaded in different test management tools environment.
The tool extracts the metadata from activity diagrams or use-case activity diagrams. The metadata extracted includes information, for example, identification number (ID), description, transition information of activity diagrams such as user input, decision, process and output from the input. The activity diagrams are inserted as input into the tool in formats such as XML Meta data Interchange (XMI) in Influx© task flow diagrams, Petal file (PTL) in Rational Rose, and Extended Markup Language (XML) in Microsoft® Visio®. The metadata thus extracted from the activity diagrams is in the form of XMI. The data is then validated using XML schema for its correctness and completeness. The required node information is extracted by parsing the validated XML using a Document Object Model (DOM) parser. A graph is constructed using the information of nodes extracted from XML. The graph is then used to generate paths by the tool. The paths are generated from the graph using one or more exemplary algorithms listed in conjunction with
The method, system and computer program product described above have various advantages. The method provides a systematic approach for structuring use-case activity diagrams. The structured use-case activity diagrams are useful in automatic generation of test cases as well as other activities of a software development life cycle such as design of software applications, and so forth. The structured use-case activity diagrams also assist in identifying ambiguities and incompleteness of the SRS at an early stage of the software development life cycle. Further, the method provides a systematic approach for generation of functional test cases for system testing which thereby provides a complete coverage of test cases for revealing errors present in the software. Furthermore, the method provides an efficient and easy method for creation and maintenance of functional test cases, thereby saving cost and time spent. Further, the functional test cases generated by the method are easy to maintain as compared to the functional test cases developed and maintained based on text and Microsoft® Excel.
The system for generating functional test cases for testing a software application, as described in the present invention or any of its components, may be embodied in the form of a computer system. Typical examples of a computer system include a general-purpose computer, a programmed microprocessor, a micro-controller, a peripheral integrated circuit element, and other devices or arrangements of devices that are capable of implementing the steps that constitute the method of the present invention.
The computer system comprises a computer, an input device, a display unit and the Internet. The computer further comprises a microprocessor, which is connected to a communication bus. The computer also includes a memory, which may include Random Access Memory (RAM) and Read Only Memory (ROM). The computer system also comprises a storage device, which can be a hard disk drive or a removable storage drive such as a floppy disk drive, an optical disk drive, etc. The storage device can also be other similar means for loading computer programs or other instructions into the computer system. The computer system also includes a communication unit, which enables the computer to connect to other databases and the Internet through an Input/Output (I/O) interface. The communication unit also enables the transfer as well as reception of data from other databases. The communication unit may include a modem, an Ethernet card, or any similar device which enable the computer system to connect to databases and networks such as Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN) and the Internet. The computer system facilitates inputs from a user through an input device, accessible to the system through an I/O interface.
The computer system executes a set of instructions that are stored in one or more storage elements, in order to process the input data. The storage elements may also hold data or other information as desired. The storage element may be in the form of an information source or a physical memory element present in the processing machine.
The present invention may also be embodied in a computer program product for generating functional test cases for testing a software application. The computer program product includes a computer usable medium having a set of program instructions comprising a program code for generating functional test cases for testing a software application. The set of instructions may include various commands that instruct the processing machine to perform specific tasks such as the steps that constitute the method of the present invention. The set of instructions may be in the form of a software program. Further, the software may be in the form of a collection of separate programs, a program module with a large program or a portion of a program module, as in the present invention. The software may also include modular programming in the form of object-oriented programming. The processing of input data by the processing machine may be in response to user commands, results of previous processing or a request made by another processing machine.
While the preferred embodiments of the invention have been illustrated and described, it will be clear that the invention is not limit to these embodiments only. Numerous modifications, changes, variations, substitutions and equivalents will be apparent to those skilled in the art without departing from the spirit and scope of the invention, as described in the claims.
Claims
1. A method for developing one or more functional test cases used for testing a software application, the method comprising:
- a. developing one or more use-case activity diagrams for the software application, the development being based on a predefined set of rules, each of the one or more use-case activity diagrams comprising an ordered sequence of a plurality of units of behavior;
- b. automatically checking consistency of the one or more use-case activity diagrams;
- c. validating the consistent use-case activity diagrams with one or more users; and
- d. automatically generating the one or more functional test cases from the validated use-case activity diagrams.
2. The method of claim 1, wherein developing the one or more use-case activity diagrams comprises:
- a. analyzing a Software Requirement Specifications (SRS) for the software application, the SRS being provided by the one or more users;
- b. developing a plurality of use-cases for the SRS; and
- c. analyzing the plurality of use-cases for developing the one or more use-case activity diagrams, wherein analyzing the plurality of use-cases comprises identifying the plurality of units of behavior from the plurality of use-cases.
3. The method of claim 2, wherein each of the one or more use-case activity diagrams represents a behavior of at least one of the plurality of use-cases.
4. The method of claim 3, wherein the predefined set of rules is based on slicing of the behavior of the plurality of use-cases, the behavior being sliced into the plurality of units of behavior.
5. The method of claim 1 further comprising updating the one or more use-case activity diagrams based on the consistency checking.
6. The method of claim 5, wherein the updated use-case activity diagrams are validated with the one or more users.
7. The method of claim 1, wherein the one or more use-case activity diagrams are developed by a software developer.
8. The method of claim 1, wherein a unit of behavior comprises an input, processing of the input, a set of conditions and an output based on the processing and the set of conditions.
9. The method of claim 1, wherein each of the one or more use-case activity diagrams is defined in Unified Modeling Language (UML).
10. The method of claim 1 further comprising linking a plurality of use-case activity diagrams for one or more software applications, wherein the linking facilitates reusability of the plurality of use-case activity diagrams.
11. The method of claim 10, wherein the one or more functional test cases are generated from the linked use-case activity diagrams.
12. The method of claim 1 further comprising updating the validated use-case activity diagrams based on one or more requirements of the one or more users.
13. The method of claim 12, wherein the one or more functional test cases are generated from the updated use-case activity diagrams.
14. The method of claim 1 further comprising identifying criticality of each of the plurality of units of behavior.
15. The method of claim 14 further comprising prioritizing the one or more functional test cases based on the criticality of the plurality of units of behavior.
16. A system for developing one or more functional test cases used for testing a software application, the system comprising:
- a. a development module configured for enabling at least one user for developing one or more use-case activity diagrams for the software application, the development being based on a predefined set of rules, each of the one or more use-case activity diagrams comprising an ordered sequence of a plurality of units of behavior;
- b. a consistency checking module configured for automatically checking consistency of the one or more use-case activity diagrams;
- c. a validation module configured for enabling the at least one user for validating the consistent use-case activity diagrams with one or more users; and
- d. a test case generation module configured for automatically generating the one or more functional test cases from the validated use-case activity diagrams.
17. The system of claim 16, wherein the development module is further configured for enabling the at least one user for:
- a. analyzing a Software Requirement Specifications (SRS) for the software application, the SRS being provided by the one or more users;
- b. developing a plurality of use-cases for the SRS; and
- c. analyzing the plurality of use-cases for developing the one or more use-case activity diagrams, wherein analyzing the plurality of use-cases comprises identifying the plurality of units of behavior from the plurality of use-cases.
18. The system of claim 17, wherein each of the one or more use-case activity diagrams represents a behavior of at least one of the plurality of use-cases.
19. The system of claim 18, wherein the predefined set of rules is based on slicing of the behavior of the plurality of use-cases, the behavior being sliced into the plurality of units of behavior.
20. The system of claim 16 further comprising a first updating module configured for enabling the at least one user for updating the one or more use-case activity diagrams based on the consistency checking.
21. The system of claim 20, wherein the updated use-case activity diagrams are validated with the one or more users.
22. The system of claim 16, wherein the one or more use-case activity diagrams are developed by a software developer.
23. The system of claim 16, wherein a unit of behavior comprises an input, processing of the input, a set of conditions and an output based on the processing and the set of conditions.
24. The system of claim 16, wherein each of the one or more use-case activity diagrams is defined in Unified Modeling Language (UML).
25. The system of claim 16 further comprising a linking module configured for linking a plurality of use-case activity diagrams for one or more software applications, wherein the linking facilitates reusability of the plurality of use-case activity diagrams.
26. The system of claim 25, wherein the one or more functional test cases are generated from the linked use-case activity diagrams.
27. The system of claim 16 further comprising a second updating module configured for enabling the at least one user for updating the validated use-case activity diagrams based on one or more requirements of the one or more users.
28. The system of claim 27, wherein the one or more functional test cases are generated from the updated use-case activity diagrams.
29. The system of claim 16 further comprising an identification module configured for enabling the at least one user for identifying criticality of each of the plurality of units of behavior.
30. The system of claim 29 further comprising a prioritization module configured for prioritizing the one or more functional test cases based on the criticality of the plurality of units of behavior.
31. A computer program product for use with a computer, the computer program product comprising a computer usable medium having a computer readable program code embodied therein for developing one or more functional test cases used for testing a software application, the computer readable program code performing:
- a. developing one or more use-case activity diagrams for the software application, the development being based on a predefined set of rules, each of the one or more use-case activity diagrams comprising an ordered sequence of a plurality of units of behavior;
- b. automatically checking consistency of the one or more use-case activity diagrams;
- c. validating the consistent use-case activity diagrams with one or more users; and
- d. automatically generating the one or more functional test cases from the validated use-case activity diagrams.
32. The computer program product of claim 31, wherein the computer readable program code further performs updating the one or more use-case activity diagrams based on the consistency checking.
33. The computer program product of claim 31, wherein the computer readable program code further performs linking a plurality of use-case activity diagrams for one or more software applications, wherein the linking facilitates reusability of the plurality of use-case activity diagrams.
34. The computer program product of claim 31, wherein the computer readable program code further performs updating the validated use-case activity diagrams based on one or more requirements of the one or more users.
35. The computer program product of claim 31, wherein the computer readable program code further performs prioritizing the one or more functional test cases based on criticality of the plurality of units of behavior.
Type: Application
Filed: Jan 15, 2009
Publication Date: Jul 15, 2010
Patent Grant number: 8161459
Applicant: Infosys Technologies Limited (Bangalore)
Inventors: Ravi Prakash Gorthi (Bangalore), Kailash Kumar Prasad Chanduka (Bangalore), Anjaneyulu Pasala (Bangalore)
Application Number: 12/321,133
International Classification: G06F 9/44 (20060101);