The Generic Scripts

The Generic Scripts: improved efficiency in combination with Unit Testing and User interface / User Experience testing by generic script of dynamic values.

Abstract

Currently a software project must meet and be suitable for various scenarios and uses, because of enormous update of technology both hardware and software. Also Testing cannot show the absence of defects but it can only show the software defects are present. Scripting cases for multiple scenarios is a complex process and to execute too. So we need a generic script for each test case that should generate a dynamic value for each time and should the report will record with the proper details for further reference.

Introduction

As we know testing is the process of executing a program or system with the intent of finding errors. Also the quality of the product is purely based on the quality of testing and its process. Obviously testing plays a major role in the SDLC because testing will need to be a part in all phases of the SDLC.

There are many tools we need to automate the project to ensure the stability for each time. For such a case we need to write a number of scripts and execute those scripts whenever we require. And the entire automation process and its efficiency mainly depends on the efficiently of the script. So in this research is a simple and effective logic on improved efficiency in combination with Unit Testing and User interface and User Experience testing by generic script of dynamic values.

Drawback of the existing system

As mentioned, we have numerous tools to automate a project. But when scripting a case we are not allowed to make it the most generic. If we are able to write a script by the most generic means, a single script may cover multiple scenarios. Also some other limitations are:

  • More scripts for more scenarios consume more human time to write and execute the script as well. (We know that Testing should systematically uncover various classes of errors in a minimum amount of time and with a minimum amount of effort.)
  • More scripts for more scenarios in a test project may make the project very complex to review.
  • The non-generic script will provide a non-generic result. (We know that the data collected by testing can also provide an indication of the software's reliability and quality.)

What kind of system is required by current updated technologies for an effective testing?

Currently a software project must meet and suit various scenarios and uses because of an enormous update of the technology of both hardware and software. Also testing cannot show the absence of a defect but it can only show that the software defects are present. Scripting cases for multiple scenarios is a complex process and to execute too. So we need a generic script for each test case that should generate a dynamic value each time and the report should record with the proper details for further reference.

Concept of our approach

Our proposed system is tools that should be completed based on the code of the project that is about to be tested. So the test case should be code similar to the project actually developed. So the main benefit of our proposed generic scripts is, we can carry out the unit testing in an easy and effective manner since we covered all the core code of the project in the test case. Also this will cover the following features by generic test cases.

  • Unit Testing
  • Action Recording
  • Visual comparison

Effective Unit testing

The unit testing that we covered with our research will ensure the property and behaviour testing of a project or its methods. When checking the behaviour is simple and effective. Also it is a quick process and the provided result is a report of on-demand cases.

Friendly Action recording

Currently the main challenge of all the automation tools is to test and automate the user interaction and user experience. To automate this testing the script must handle input devices (like the Mouse, Keyboard. and so on). To handle an input device in an effective manner, we must record the action and play it back whenever we need to.

Optimized Visual Comparison

Visual comparison of every test case will ensure the GUI (some scenario behaviour too depending on the test case). Here we have some optimization option to make the test case very effective and a quick comparison.

Advantages of generic scripting

There are many features handled very simply and easily by our system. Some main features are:

  • Allows Generic Code.
    o Cover unpredictable scenarios.
    o Reduces code weightage.
    o Effective code coverage.
    o Sharable and portable script code.
  • Very simple unit testing.
  • Very fast execution because most behaviour will cover in unit testing itself by generic scripts.
  • Can easy determine memory leaks.
  • Can easily determine GUI bug using optimal visual comparison logic.
  • Generates and records all details (can customize the fields) in Excel sheet for quick review.

Simple Generic Scripts that generates dynamic value for Simple case

Here a Generic Script means that there is no hard-coded value and the procedure should be maintained in the script. The generic level of the script is based on the effective logic used to write the script. For example please find the following script for a simple test case for a simple scenario in this script for unit testing that we need to validate that the text entered into the TextBox is correct.

The following 15 lines of script can cover 1040 types of test cases (in other words, more than 10,000 lines of script).




  1. In the preceding script, first it gives the neighbour button the focus if the “boolValue” method returns “true”. So it is dynamically generated by the system's current time in seconds. If it's an odd value return “true” else return “false”.

  2. The similar process is held by making the test box enabled or disabled.

  3. And to enter a value that is also generic, in other words the “getText” method, may return a string value of 0 to 10 characters with mixed letters.

Note:

Here the procedure and value carried out is generic, if the test case fails any scenario we don't know the procedure to regenerate the issues. So the procedure and value should be recorded using the “recordData” method. Once all test cases are completed we can log a defect using the procedure and value generated.

Here the preceding script is an example for a simple test case but it covers:

2 (button focus) * 2 (text enable) * 10 (Characters) * 26 (Alphabets) = 1040 scenarios. It an example that shows the power of generic code because the 15 lines of scripts covers 1040 types of scripts.


Similar Articles