You Can't Evaluate a Test Tool by Reading a Data Sheet


All data sheets look pretty tons alike. The buzzwords are the equal: "Industry Leader", "Unique Technology", "Automated Testing", and "Advanced Techniques". The screen pictures are similar: "Bar Charts", "Flow Charts", "HTML reports" and "Status chances". It is mind numbing.


What is Software Testing?


All folks who have completed software checking out recognize that checking out comes in many flavors. For simplicity, we will use three phrases on this paper:


System Testing

Integration Testing

Unit Testing

Everyone does some amount of gadget testing wherein testing they do a number of the equal matters with it that the cease users will do with it. Notice that we said "some" and no longer "all." One of the most commonplace causes of packages being fielded with bugs is that sudden, and therefore untested, mixtures of inputs are encountered by means of the application while in the subject.


Not as many parents do integration checking out, or even fewer do unit testing. If you have completed integration or unit testing, you are likely painfully aware of the amount of check code that must be generated to isolate a single report or organization of documents from the relaxation of the utility. At the maximum stringent stages of checking out, it is not uncommon for the quantity of take a look at code written to be larger than the quantity of software code being examined. As a result, those degrees of checking out are usually applied to venture and safety vital applications in markets inclusive of aviation, medical tool, and railway.


What Does "Automated Testing" Mean?


It is well known that the procedure of unit and integration checking out manually may be very pricey and time consuming; as a end result every tool that is being bought into this market will trumpet "Automated Testing" as their benefit. But what is "computerized trying out"? Automation means different things to extraordinary human beings. To many engineers the promise of "computerized trying out" approach that they are able to press a button and they will both get a "green check" indicating that their code is correct, or a "crimson x" indicating failure.


Unfortunately this device does not exist. More importantly, if this device did exist, might you want to use it? Think approximately it. What would it mean for a tool to tell you that your code is "Ok"? Would it mean that the code is formatted nicely? Maybe. Would it imply that it conforms on your coding standards? Maybe. Would it mean that your code is accurate? Emphatically No!


Completely automatic trying out isn't plausible nor is it appropriate. Automation ought to cope with the ones parts of the checking out system which can be algorithmic in nature and labor extensive. This frees the software program engineer to do higher fee testing work consisting of designing higher and extra whole tests.


The logical question to be asked whilst comparing gear is: "How an awful lot automation does this device provide?" This is the huge grey place and the number one area of uncertainty whilst an organisation attempts to calculate an ROI for tool investment.


Anatomy of Test Tools


Test Tools usually provide a selection of functionality. The names companies use could be special for different gear, and a few capability may be lacking from some equipment. For a commonplace frame of reference, we've chosen the following names for the "modules" that could exist inside the take a look at gear you're evaluating:


Parser: The parser module allows the tool to recognize your code. It reads the code, and creates an intermediate illustration for the code (commonly in a tree shape). Basically the same as the compiler does. The output, or "parse information" is usually stored in an intermediate language (IL) report.


CodeGen: The code generator module uses the "parse statistics" to construct the check harness source code.


Test Harness: While the take a look at harness isn't always specifically part of the device; the selections made within the test harness structure affect all other features of the tool. So the harness structure may be very critical whilst evaluating a tool.


Compiler: The compiler module allows the check tool to invoke the compiler to compile and hyperlink the test harness additives.


Target: The target module allows exams to be without difficulty run in an expansion of runtime environments consisting of support for emulators, simulators, embedded debuggers, and commercial RTOS.


Test Editor: The take a look at editor lets in the person to apply both a scripting language or a sophisticated graphical consumer interface (GUI) to setup preconditions and expected values (skip/fail criteria) for take a look at cases.


Coverage: The insurance module permits the consumer to get reviews on what parts of the code are achieved via every take a look at.


Reporting: The reporting module lets in the various captured records to be compiled into undertaking documentation.


CLI: A command line interface (CLI) allows further automation of using the tool, allowing the device to be invoked from scripts, make, and so forth.


Regression: The regression module allows exams that are created towards one version of the utility to be re-run in opposition to new versions.


Integrations: Integrations with third-birthday party equipment may be an exciting manner to leverage your investment in a take a look at device. Common integrations are with configuration management, necessities control gear, and static analysis gear.


Later sections will intricate on the way you should evaluate every of those modules on your candidate tools.


Classes of Test Tools / Levels of Automation


Since all equipment do now not include all functionality or modules described above and additionally due to the fact there may be a extensive difference between tools in the level of automation furnished, we have created the subsequent extensive classes of take a look at tools. Candidate take a look at gear will fall into such a classes.


"Manual" equipment usually create an empty framework for the test harness, and require you to hand-code the check facts and logic required to implement the take a look at instances. Often, they will offer a scripting language and/or a hard and fast of library capabilities that may be used to do common such things as take a look at assertions or create formatted reports for take a look at documentation.


"Semi-Automated" equipment may put a graphical interface on some Automated functionality provided by way of a "guide" device, however will still require hand-coding and/or scripting in-order to check extra complex constructs. Additionally, a "semi-automatic" device can be lacking some of the modules that an "computerized" device has. Built in assist for target deployment for example.


"Automated" gear will cope with every of the purposeful areas or modules listed in the preceding section. Tools on this elegance will no longer require manual hand coding and could help all language constructs as properly a spread of target deployments.


Subtle Tool Differences


In addition to evaluating device capabilities and automation degrees, it is also critical to evaluate and evaluate the test method used. This can also hide latent defects within the tool, so it's miles crucial to no longer simply load your code into the tool, but to additionally try to build some simple test cases for every technique inside the magnificence which you are trying out. Does the device build a whole check harness? Are all stubs created automatically? Can you use the GUI to outline parameters and international records for the test cases or are you required to put in writing code as you would in case you were trying out manually?


In a similar manner goal guide varies substantially between equipment. Be wary if a dealer says: "We aid all compilers and all goals out of the field". These are code words for: "You do all of the work to make our device work to your environment".


How to Evaluate Test Tools


The following couple of sections will describe, in detail, statistics that you need to look into in the course of the evaluation of a software program trying out tool. Ideally you should verify this facts with fingers-on checking out of every tool being taken into consideration.


Since the relaxation of this paper is reasonably technical, we would like to explain a number of the conventions used. For every phase, we've a name that describes an difficulty to be taken into consideration, a description of why the difficulty is vital, and a "Key Points" section to summarize concrete items to be considered.


Also, whilst we are speaking about conventions, we ought to additionally make notice of terminology. The term "feature" refers to either a C characteristic or a C++ elegance approach, "unit" refers to a C report or a C++ class. Finally, please take into account, almost every device can somehow help the objects mentioned in the "Key Points" sections, your process is to evaluate how automated, smooth to use, and entire the guide is.


Parser and Code Generator


It is distinctly easy to construct a parser for C; however it is very tough to build a whole parser for C++. One of the inquiries to be responded at some stage in tool evaluation must be: "How robust and mature is the parser era"? Some device vendors use business parser generation that they license from parser technology companies and some have homegrown parsers that they have constructed themselves. The robustness of the parser and code generator can be established by way of comparing the device with complicated code constructs that are representative of the code for use in your challenge.


Key Points:


- Is the parser technology industrial or homegrown?

- What languages are supported?

- Are device versions for C and C++ the same tool or unique?

- Is the whole C++ language carried out, or are their restrictions?

- Does the tool paintings with our most complicated code?


The Test Driver


The Test Driver is the "foremost software" that controls the check. Here is a simple example of a driving force on the way to test the sine feature from the same old C library:


#include


#include


int most important ()


drift local;


local = sin (ninety.0);


if (neighborhood == 1.0) printf ("My Test Passed!N");


else printf ("My Test Failed!N");


go back zero;




Although that is a quite easy example, a "guide" tool may require you to type (and debug) this little snippet of code through hand, a "semi-computerized" tool would possibly come up with a few type of scripting language or easy GUI to enter the stimulus price for sine. An "automated" tool might have a full-featured GUI for building take a look at instances, incorporated code coverage evaluation, an incorporated debugger, and an integrated goal deployment.


I wonder in case you observed that this motive force has a trojan horse. The bug is that the sin characteristic honestly makes use of radians now not stages for the input perspective.


Key Points


- Is the motive force automatically generated or do I write the code?

- Can I test the following with out writing any code:

- Testing over a variety of values

- Combinatorial Testing

- Data Partition Testing (Equivalence Sets)

- Lists of input values

- Lists of expected values

- Exceptions as expected values

- Signal dealing with

- Can I set up a series of calls to extraordinary techniques within the same check?


Stubbing Dependent Functions


Building replacements for based functions is vital when you want to manipulate the values that a established function returns in the course of a test. Stubbing is a absolutely essential part of integration and unit checking out, as it lets in you to isolate the code beneath check from different parts of your application, and greater easily stimulate the execution of the unit or sub-machine of hobby.


Many tools require the manual generation of the take a look at code to make a stub do whatever greater than go back a static scalar cost (return 0;)


Key Points


- Arestubs automatically generated, or do you write code for them?

- Are complex outputs supported robotically (structures, training)?

- Can each name of the stub return a special fee?

- Does the stub preserve track of ways frequently it turned into called?

- Does the stub preserve music of the input parameters over multiple calls?

- Can you stub calls to the standard C library functions like malloc?


Test Data


There are two primary methods that "semi-computerized" and "automatic" equipment use to put in force test cases. One is a "statistics-pushed" structure, and the opposite is a "unmarried-test" structure.


For a information-driven structure, the check harness is created for all of the units beneath check and helps all of the functions described in those devices. When a test is to be run, the device simply gives the stimulus statistics throughout a facts stream consisting of a report handle or a physical interface like a UART.