Abstract: A method for generating an automated test harness is disclosed. According to an exemplary aspect the method for generating an automated test harness in a testing environment includes feeding a system model to a model based testing tool for generating a plurality of test cases, receiving the plurality of generated test cases generated as an input by a backend scripter for generating a test suite , an automated test harness and a test data in a predefined scripting language, receiving the generated test suite , automated test harness as an input by a test automation framework for generating a plurality of test execution results for a system under test.
4. DESCRIPTION:
Technical Field of the Invention
[0001] The present invention in general relates to model based testing. More particularly, the present invention is related to an automated system and method to generate an automated test harness in a testing environment.
Background of the Invention
[0002] Model based testing refers to a test automation approach which allows a tester to create a behavioral model of a system under test (SUT). The structure of the behavioral model may be based on characteristics of the SUT and expressed using modeling methods. Model-based testing technologies typically include components that allow a user to create the behavioral model of the SUT, explore the behavioral model, and generate tests from the behavioral model. After generating the tests, it is required to manually write the code for test harness in order to run the test scripts in an automated test environment. For every test cycle, this test harness work may be repetitious, tedious or unintuitive to a tester and adds to the effort required to perform model-based testing.
[0003] One of the most effective techniques to generate the test harness automatically is achieved by adding few details in the model and implementing an intelligent backend scripter. The testing is performed to check the proper functionality of the modules. At times, it is desirable to add new tests to an existing test harness.
[0004] Even after software is developed, tested and approved, modifications such as adjustments to the program require corresponding modifications to the test harness. A test automation engineer spends time by manually computing new expected results based on the adjustments to the program. The test automation engineer must then manually update the expected values of the tests of the test harness with the new expected results. The test automation engineer mustmanually hard-code the new results into the test, which adds additional lines of code, increasing a margin of error for the test harness as well as increasing difficulty of debugging the test harness. Once new or modified test harnesses are developed, they must be debugged and approved after having proven that they can operate with a measure of confidence and reliability.
[0005] In light of the aforementioned discussion, there exists a need for an improved method and apparatus for generating an automated test harness which automatically updates the required modifications by reducing the operational, maintenance, manual costs and which also eliminates the time consumption.
Summary of the Invention
[0006] Exemplary embodiments of the present invention are directed towards a computer implemented method and a system for an automated generation of test harness for a model based testing.
[0007] An exemplary objective of the present subject matter is to generate an automated generation of test harness.
[0008] Another exemplary objective of the present subject matter is to utilize model based testing tool and test data library to generate an automated test harness.
[0009] Another objective of the present subject matter is to reduce a cycle time in updating the test harness.
[0010] Further objective of present subject matter is to enable an automated updation of the test cases and test suite for generating an automated test harness.
[0011] Further objective of present subject matter is to reduce a maintenance effort in modifying the test harness while performing an updation of a model and to eliminate a manual updation of the code present in the test harness.
[0012] A computer implemented method and a system for an automated generation of test harness in a testing environment is disclosed. According to a first aspect of the present subject disclosure, the method includes generating a plurality of test cases for a system under test by a model based testing tool on receiving a system model. Triggering a load model action by the model based testing tool enables to receive the system model and triggering a generate test case action by the model based testing tool enables to generate a plurality of test cases.
[0013] According to the first aspect of the present subject disclosure, the method includes receiving the plurality of test cases as input by a scripting backend for generating for generating a test suite, an automated test harness and a test data in a predefined scripting language. The model based testing tool parses the system model for generating the plurality test cases. The backend scripter renders a test script form a test step data. Triggering a render action by the model based testing tool enables the backend scripter to read the plurality of test cases from the model based testing tool.
[0014] According to the first aspect of the present subject disclosure, the method includes feeding the test suite and the automated test harness as an input to a test automation frame work for generating a plurality of test execution results for a system under test.
[0015] According to the first aspect of the present subject disclosure, the method fiirther includes receiving an input from a test data library by the scripting back end.
[0016] According to the first aspect of the present subject disclosure, the method fiirther includes a step of importing model based testing tool data in to a test suite by the test automation frame work.
[0017] According to a second aspect of the present subject disclosure, a computer implemented system for an automated generation of test harness in a testing environment is disclosed. According to the second aspect of the present subject disclosure, the system includes a model based testing tool configured to receive a system model for generating a plurality of test cases for a system under test.
[0018] According to the second aspect of the present subject disclosure, the system includes a scripting back end for receiving the plurality of test cases as an input by for generating a test suite, an automated test harness and a test data in a predefined scripting language, whereby the model based testing tool parses the system model for generating the plurality test cases.
[0019] According to the second aspect of the present subject disclosure, the system includes a test automation frame work for receiving the test suite and the automated test harness as an input for generating a plurality of test execution results for a system under test.
[0020] According to the second aspect of the present subject disclosure, the system further includes test data library for feeding a plurality of inputs to the scripting backend.
Brief Description of the Drawings
[0021] Other objects and advantages of the present invention will become apparent to those skilled in the art upon reading the following detailed description of the preferred embodiments, in conjunction with the accompanying drawings, wherein like reference numerals have been used to designate like elements, and wherein:
[0022] FIG.l is a block diagram depicting an overview of a system for generating an automated test harness.
[0023] FIG.2 is a flow diagram depicting a method for generating an automated test harness for a system under test.
FIG. 3 is a flow diagram 300 depicting the test automation framework executing test scripts against the system under test.
Detailed Description of the Invention
[0024] It is to be understood that the present disclosure is not limited in its application to the details of construction and the arrangement of components set forth in the following description or illustrated in the drawings. The present disclosure is capable of other embodiments and of being practiced or of being carried out in various ways. Also, it is to be understood that the phraseology and terminology used herein is for the purpose of description and should not be regarded as limiting.
[0025] The use of "including", "comprising" or "having" and variations thereof herein is meant to encompass the items listed thereafter and equivalents thereof as well as additional items. The terms "a" and "an" herein do not denote a limitation of quantity, but rather denote the presence of at least one of the referenced item. Further, the use of terms "first", "second", and "third", and the like, herein do not denote any order, quantity, or importance, but rather are used to distinguish one element from another.
Terminology
[0026] Model based Testing (MBT):A Model is a representation of the system behavior in the form of UML state machine with associated action language in any object oriented programming language. This model is created in any standard UML modeling tool. MET Tool is a tool for automatic test case design that is driven by system models.
[0027] Backend Scripter:Abackend scripter is a plugin component cormected to a MET tool using a well-defined API. Backend scripter and open APIs enable the creation of custom output formats and the utilization of test libraries in generated test scripts to seamlessly integrate with the existing test execution environment. The backend scripter may include an HTML backend scripter for generating browsable HTML documents, a TTCN-3 backend scripter for generating test script in TTCN-3 format, a TCL backend scripter for generating test scripts in TC, a Perl backend scripter for generating test scripts in Perl.
[0028] Test Automation Framework:A test automation framework is a set of assumptions, concepts and tools that provide support for automated software testing. The main advantage of such a framework is the low cost for maintenance. If there is change to any test case then only the test case file needs to be updated and the Driver Script and Startup script will remain the same. Ideally, there is no need to update the scripts in case of changes to the application. Choosing the right framework/scripting technique helps in maintaining lower costs. The costs associated with test scripting are due to development and maintenance efforts. The approach of scripting used during test automation has effect on costs.
[0029] Test SuiteTn software development, a test suite, less commonly known as a validation suite, is a collection of test cases that are intended to be used to test a software program to show that it has some specified set of behaviors. A test suite often contains detailed instructions or goals for each collection of test cases and information on the system configuration to be used during testing. A group of test cases may also contain prerequisite states or steps, and descriptions of the following tests. Collections of test cases are sometimes incorrectly termed a test plan, a test script, or even a test scenario.
[0030] Test Harness: A test harness or automated test framework is a collection of software and test data configured to test a program unit by running it under varying conditions and monitoring its behavior and outputs. It has two main parts: the test execution engine and the test script repository.
[0031] Test harnesses allow for the automation of tests. They can call functions with supplied parameters and print out and compare the results to the desired value. The test harness is a hook to the developed code, which can be tested using an automation framework. A test harness should allow specific tests to run, orchestrate a runtime environment, and provide a capability to analyzeresults. The typical objectives of a test harness are to automate the testing process, execute test suites of test cases and generate associated test reports.
[0032] Referring to FIG.l is a block diagram 100 depicting an overview of a system for generating an automated test harness. The system for generating an automated test harness includes a system model 102 fed as an input to a model based testing tool (MBT) 104, a scripting backend 106, a test data library 108, a test automation frame work 110 including model based test data, test harness and test scripts. The output of the test automation frame work 110 includes test execution results 112.
[0033] According to an exemplary implementation of the present subject disclosure, the system for generating an automated test harness is implemented in a testing environment for generating the automated test harness for a system under test.The model based testing tool 104 receives the system model 102 as the input and generates multiple test cases and is further fed with the test data library 108. The scripting backend 106 receives the multiple test cases generated by the model based testing tool 104 as input for generating the test suite, the automated test harness and a test data in a predefined scripting language. The test automation frame work 110 receives the test data and the automated test harness as an input for generating the test execution results for the system under test.
[0034] In accordance with a non-limiting exemplary implementation of the present subject disclosure, the test data library 108 includes Java class files which has testing and test control notation (TTCN) data fields. The scripting backend 106 configured to dynamically render the test suite in scripting language. The scripting language may include a TTCN for example. The scripting backend 106 further contains a predefined logic to export the generated test cases to a TTCN test script and test harness.
[0035] According to an exemplary implementation of the present subject disclosure, a procedure of test execution is initiated in the test suite which in turn calls the functions in the test harness. Furthermore, the test harness in turn fetches the test data from model based testing test data (MBT test data) file and runs the generated test cases.
[0036] Referring to FIG.2 is a fiow diagram 200 depicting a method for generating an automated test harness for a system under test, in accordance with a non-limiting exemplary aspect of the present subject disclosure. The model based testing tool receives the system model as an input at step 202 and step 204 the model based testing tool generates multiple test cases and test suite for the system under test. The system model created by the model engineer is fed as input to the model based testing tool. Furthermore, the model based testing tool includes an inbuilt algorithm for parsing the elements of the system model for generating the multiple test cases. The inbuilt algorithm configured to estimate all the possible permutations and combinations based on the behavior of the system under test to generate the multiple test cases.
[0037] In accordance with a non-limiting exemplary aspect of the present subject disclosure, the scripting backend renders the test suite in scripting language for an automated generation of test harness at step 206.
[0039] Referring to FIG.3 is a flow diagram 300 depicting the test automation framework executing test scripts against the system under test (310) .According to a non-limiting exemplary aspect of the present invention, a test suite 302 calls the functions in test harness 304. The test harness 304 intum calls the automationframework 306 API which interacts with the system under test 308. The test automation framework 306 executes each test case and reports the results (pass/fail) 310 of the test cases.The model based testing tool generates test scripts and test harness. In accordance with a non-limiting exemplary aspect of the present invention, the test harness 304 comprises the mapping functions to the API of test automation framework 306. This invention makes it possible to generate these mapping functions automatically eliminating the manual work. The test harness 304 and the test suite may include but not limited to TTCN or VBscript and the like.
[0038] While specific embodiments of the invention have been shown and described in detail to illustrate the inventive principles, it will be understood that the invention may be embodied otherwise without departing from such principles.
5. CLAIMS
What is claimed is
1. A computer implemented method for an automated generation of test harness in a testing environment, the method comprising:
generating a plurality of test cases for a system under test by a model based testing tool on receiving a system model;
receiving the plurality of test cases as input by a scripting backend for generating for generating a test suite; an automated test harness comprising a plurality of mapping functions to an application programming interface of a test automation frame work; and a test data in a predefined scripting language, whereby the model based testing tool parses the system model for generating the plurality test cases; and
feeding the test suite and the automated test harness as an input to the test automation frame work for generating a plurality of test execution results for a system under test, wherein the plurality of mapping functions are automatically . generated.
2. The method of claim 1 further comprising a step of receiving an input from a test data library by the scripting back end.
3. The method of claim 1, wherein triggering a load model action by the model based testing tool enables to receive the system model.
4. The method of claim 1, wherein triggering a generate test case action by the model based testing tool enables to generate a plurality of test cases.
5. The method of claim 1 further comprising a step of importing model based testing tool data in to a test suite by the test automation frame work.
6. The method of claim 1, wherein the backend scripter renders a test script form a test step data.
7. The method of claim 1, wherein the backend scripter renders a test script form a test step data.
8. The method of claim 1, wherein triggering a render action by the model based testing tool enables the backend scripter to read the plurality of test cases from the model based testing tool.
9. A computer implemented system for an automated generation of test harness in a testing environment comprising:
a model based testing tool configured to receive a system model for generating a plurality of test cases for a system under test;
a scripting back end for receiving the plurality of test cases as an input by for generating a test suite , an automated test harness and a test data in a predefined scripting language, whereby the model based testing tool parses the system model for generating the plurality test cases; and
a test automation frame work for receiving the test suite and the automated test harness as an input for generating a plurality of test execution results for a system under test.
9. The system of claim 9 further comprising a test data library for feeding a plurality of inputs to the scripting backend.
| # | Name | Date |
|---|---|---|
| 1 | 2532-CHE-2012 FORM-5 26-06-2012.pdf | 2012-06-26 |
| 2 | 2532-CHE-2012 FORM-3 26-06-2012.pdf | 2012-06-26 |
| 3 | 2532-CHE-2012 FORM-2 26-06-2012.pdf | 2012-06-26 |
| 4 | 2532-CHE-2012 FORM-1 26-06-2012.pdf | 2012-06-26 |
| 5 | 2532-CHE-2012 DRAWINGS 26-06-2012.pdf | 2012-06-26 |
| 6 | 2532-CHE-2012 DESCRIPTION (COMPLETE) 26-06-2012.pdf | 2012-06-26 |
| 7 | 2532-CHE-2012 CORRESPONDENCE OTHERS 26-06-2012.pdf | 2012-06-26 |
| 8 | 2532-CHE-2012 CLAIMS 26-06-2012.pdf | 2012-06-26 |
| 9 | 2532-CHE-2012 ABSTRACT 26-06-2012.pdf | 2012-06-26 |
| 10 | POA.pdf | 2015-06-30 |
| 11 | 2532-CHE-2012-FER.pdf | 2019-12-13 |
| 1 | 2019-12-1123-03-36_12-12-2019.pdf |