Subscribe by Email


Showing posts with label Automated Test Generation. Show all posts
Showing posts with label Automated Test Generation. Show all posts

Sunday, August 19, 2012

How do you program tests with Test Script language (TSL)?


The tests that are created by the winrunner are composed of the statements that have been coded in a special language by the mercury interactive called Test Script Language or TSL in short form. 
- The tests created can be further enhanced by using the TSL language.
- Remember, this feature which allows the modification of the test scripts via the TSL language is not available in the winrunner runtime.
- The generation of TSL statement takes place whenever a test is recorded by the winrunner. 
- Each line of the test generated by the winrunner is called a TSL statement and is as usual followed by a semi colon like in many other programming languages.
- Each and every TSL statement consists of some user input like mouse click or input from key board to be fed to the software system or application that is to be tested. 
- The length of the TSL statement varies from line to line of the test script. 
- TSL can be thought of more like the C programming language that has been designed for the creation of the test scripts. 
Some certain specific functions like those mentioned below are combined by the TSL:
  1. Variables
  2. Control flow statements
  3. User defined functions
  4. Arrays and so on.
- A recorded script can be further enhanced just by typing the programming elements in to the winrunner test window.
- However, the TSL proves to be quite useful when compared to C because in test script language there is no need of compilation of the written code. 
- The test is just written or recorded and immediately subjected to execution. 
Four types of functions constitute the TSL:
  1. Analog functions
  2. Context sensitive functions
  3. Customization functions and
  4. Standard functions.

How TSL can aid in the creation of tests?

 
- The tests developed using TSL are basically of descriptive nature and thus this type of programming is called the descriptive programming. 
- A logical name is assigned to an object the very moment it is added to the GUI map. 
- Once a GUI object makes its place in the GUI map, it becomes quite easy for you to add any TSL statements to it. 
- The logical name that is given to the object is as such that it gives a description of the GUI object. 
- During the execution of the tests, the objects are discovered based on their logical names itself but for the identification other property values that are stored in the map are used. 
- These logical names of the GUI objects can be further modified so that it becomes quite easy for you for the identification of the tests. 
- While programming with TSL, the statements that perform functions on objects can also be added without making a reference to the GUI map. 
- But doing that requires entering some more information regarding the description of the object so that it can be uniquely identified during the test run. 
- This is the essence of the descriptive programming using TSL. 
- While doing the programming, if you forget which values and properties of the object were to be identified you can take help of the GUI spy for viewing the current properties of the object as well as its values. 
- Stress conditions can also be created while programming with TSL which are designed for the determination of the limitation of the software system or application. 
- Stress conditions can be created by creating a loop that executes a block of TSL statements for number of times specified by the user.  


What are different types of running a test in WinRunner?


After you are done with the creation of the test scripts for your cases, you subject them to be compiled by the winrunner which in turn interprets these test scripts line by line. Ultimately, the tests are executed as though they were being run by a real world human user. 

In this article we are going to discuss about different types of running a test in winrunner. 

1. Running a test to check the software system or application:  
This type of test run involves a rigorous check of the behavior of the software   system or application as well as a sincere comparison among the current results and the expected results. The folder where you want the verification results to be saved can be specified by you itself. Following steps are followed for this type of test run:
a)   For opening your test hog down to open option in the file menu and click it to open a test.
b)   But be first make it sure that you have set the run mode to verify run mode on the test tool bar.
c)   Now choose an appropriate test menu command or you simply click on one of the run options. When you do this a run test dialogue box appears.
d)   It is your wish if you want to save your test results with a default test run name.
e)   The winrunner saves the test results.

    2. Running a test for debugging a test script: 
   Whenever you have to debug the test scripts a similar type of comparison is carried out by the winrunner as in the previous type between the current response and the expected response. After debugging only one set of debug results is saved in the debug results folder. So whenever you carry out a second execution of the same test, the results are over written by the winrunner. Following steps can be carried out for this type of test run:
    a)   Follow the same step a in the previous test run type to open a test.
    b)   Then go for the debug option from the list of run modes on the test tool bar.
    c)   Then you go for the run or debug menu command that you want.
    d)   For executing the entire test go for the “run from top” option available in the test menu.

    3. Running a test for updating the expected result: 
    This type of test run helps one in updating the expected results. In this case, the expected results that were created earlier are replaced by the new results and these new results in turn become the subject of comparison for the subsequent test results to come. For running a test for updating the expected results follow the first step as given in the previous two cases for opening a test. Go to the list of run modes from the test tool bar and select the update option. Then choose an appropriate test menu command from the list. For updating the entire set go for the option “run from top” in the test tool bar or simply click on the “from top” button on the tool bar.

    4. Running a test for checking the date operations: 
   Once a test has been created that checks date operations, it is run to check in what way the software system or application responds to the date information present in the test. You must make sure that in the general category of the options dialogue box the option “enable date operations” must have been selected. 


Friday, February 10, 2012

Automated Test Data Generation Using an Iterative Relaxation Method ?

Software development is not complete without software testing. It constitutes an inseparable part of software development process. Almost 50 percent of the total funds for development of a software are spend on software testing and this process consumes most of the time of the whole development process.

AUTOMATED TEST DATA GENERATION
Generation of test data for the given test and according to the testing criteria proves to be quite a difficult problem.
- The automated test data generation can relieve much stress of the software testers.
- Generation of test data that is used to make a program follow a given path is the most prominent and an important problem that arises while carrying out the path oriented testing.
- The obtained input is refined by various iterations and another input is obtained.
- The whole process predicates on this obtained input.
- The statements of the program relevant to the evaluation of each branch are executed in each iteration.
- Up on each iteration, a set of linear constraints is obtained which are then solved to obtain the increment values for the input data.
- The obtained increment values are added to the current input value to obtain the input data that is to be used for the next iteration.

RELAXATION METHODS
- The relaxation method provides knowledge about the amount by which the value of each input variable should be modified for the branches on the path in order to evaluate the desired result.

ITERATIVE RELAXATION METHODS
- These can be defined as techniques for solving system of equations.
- Relaxation methods are also iterative methods defined for numerical problems of mathematics.
- They are extensively used for solving system of equations which include the following types:
(A) Linear equations
Relaxation methods are used for solving the linear equations. Problems like that of linear least squares are usually addressed under this category.

(B) System of linear inequalities
Iterative or relaxation methods prove very effective in solving the system of linear inequalities which represent the problems similar to those that arise during linear programming.

(C) Non linear system of equations
These days, iterative methods or relaxation methods have been developed and prove a great help in solving system of equations which are non linear.

- Iterative relaxation methods have proven to be very effective and important methodology in providing solutions for linear system of equations.

- They prove to be effective system of equations that are used to solve partial differential equations based on the model of ellipse.

- These systems of equations are basically used to describe problems related to boundary conditions and values in which the value of the function in the solution is indicated or specified on the boundary of a specified domain.

- If the branch conditions on a path are linear in nature, the iterative relaxation technique either obtains a solution for such a path in just one iteration or it declares that the path is in-feasible.

- We can say that the existing approaches require an unacceptably large number of iterations for longer paths since they use only one branch predicate as well as input variable at a time.

- These methods also use back tracking.

- If the branch conditions on a path are non linear in nature, then it takes more than one iteration to get the desired input data.

- But, the set of constraints that has to be solved is linear in nature and can be solved using the method of gauss elimination.

These advantages make the technique of automated test data generation practical as well as suitable for automated testing.


Friday, January 20, 2012

What do we mean by automated test data generation?

First let us clear up what is meant by Test automation? Test automation can be defined as the use of software system, program or application to carry out the following tasks:

- control the process of execution of tests
- to compare the actual outcomes with the predicted outcomes
- to set up the preconditions for test cases
- to keep test control and
- to implement the function of reporting tests.

WHY TEST AUTOMATION IS USED?
Test automation as the term itself suggests involves automation of a manual testing process which is already in progress.

- It is used for automating manual testing processes which use a formal approach for testing.

- Although manual testing also holds good for finding defects in a software program or application, it is a very laborious and time consuming testing process and also it is not so effective in finding certain kinds of defects.

- To overcome these drawbacks of manual testing, automated Testing is employed.

- It involves a process of writing a computer program or software to carry out testing that would otherwise requires to be done manually.

- Once the tests have been automated, they can be run, easily, quickly and repeatedly.

- All these plus points make the automated testing a very cost effective method for software applications.

- Even minor bugs or discrepancies can cause the program to break or crash over the lifetime of the application.

Two general approaches to test automation have been discovered so far:

- Code driven testing
Elements like classes, public interfaces, libraries and modules are tested under code driven testing with a assorted data arguments in order to validate the results for their correctness.

- Graphical user interface testing
As the name suggests this testing approach creates user interface events such as mouse clicks, key strokes etc. the changes that occur in the user interface are observed and that observable behavior is validated for its correctness.

TOOLS FOR TEST AUTOMATION
Unlike tools required for manual testing, test automation tools are quite expensive, and are usually employed or used in combination with the tools of manual testing.

- Nevertheless, the tools can be cost-effective in the longer term if used repeatedly in regression testing.

WAYS TO GENERATE DATA
Now coming to the automated test data generation, there are several ways for generating data and test cases.

- One of the ways to generate test cases automatically is model- based testing and it generates test cases through use of a model of the system.

- Data is the most important thing needed to execute any test.

- Generating data again and again for repeating tests becomes a time consuming task.

- You need to design the test data again and again to execute your test cases.

- You need to design the test data at the current instant if you are running tests in an exploratory manner.

- Generating test data on your own takes a lot of your valuable time.

- Automated tests need a large amount of distinct test data.

- Another alternative can be copying and pasting data for running tests if the production data is available.

- However, this does not prove to be a very good approach.

- But, nowadays several tools have been developed which can be used for automated test data generation.

So the good thing is that you need not waste your precious time generating test data by hand. These tools help you by creating large quantities of test data based on the conditions and constraints specified by you.

Automated test data generation has got the below mentioned benefits:
- Fast data generation
- Accurate data
- Uses built in algorithms
- Creates both valid and invalid test data
- Data is exportable


Facebook activity