Table of Contents


OOWG Tutorial
Software testing for the VLT

G.Chiozzi

16/07/96

Contents

This is a generic introduction to software testing for the VLT and does not cover only OO strictly related matters.

Introduction

Software testing has the fundamental purpose
of proofing and certifying
that a piece of software
behaves according to the specifications.

This requires that the testing phase is fully integrated in the development process and that formal methods are available to trace specifications in the tests.

This is a very difficult task, since typically the specification documents are not detailed and clear enough to provide a good reference frame for testing.

Pragmatic countermeasures must then be taken to make up for the lack in specifications.

Testing different levels of software, from basic libraries to complete applications, presents different problems and requirements.

Object-oriented software again introduces a complete new set of problems and requires a different and new approach to testing.

Software levels

It is possible to group software components in levels based on their complexity and on the type of usage. Any of these levels present different testing peculiarities.

In an Object-Oriented development environment we can identify the following levels:

Function library

A function library is from many respects the easier to test:

Testing a function library typically requires:

Class library

In the Object-Oriented way of thinking, data and behaviour are grouped in a single entity (the Class), responsible for providing a set of services to an external user.

This applies not only to code developed with OO languages, but also to code developed with standard languages but designed with these ideas in mind.

This rises a full new set of problems:

Static analysis of source code to identify paths
is of relatively little help here

Testing a class library requires:

It would be also very important to provide "test tools" to test classes when they are used in a different context or through inheritance. Each class should have a companion test class or a Test() method used for this purpose.

Design pattern
and
Application framework

These structures introduce a much higher level of complexity, since they involve the interaction between many classes and model specific applicative problems.

On the other end:

The testing required by a single component is higher than in a traditional system, but the number of components in a final application is much smaller.

Testing a design pattern or an application framework typically requires:

Final application

Applications are for final users

This makes testing much more difficult, since:

To this, we have to add the specific set of testability problems imposed by user interfaces.

Testing an application requires:

VLT Software Modules

The basic elementary unit
for VLT software components

is a

MODULE

A module can contain:

Every module must be tested as an independent unit, providing a modular test.

The standard module's directory structure includes a /test directory for this purpose.

Modules are integrated in higher level units (CCS,TCS).

An integration test must be provided.

Automatic regression testing

Our aim is to have
fully automatic regression testing
both for modules and integration

This makes easier and safer the validation of new versions of the software, but it is not always possible, in particular for interactive applications.

Every modular/integration test should include a:

The Modular test plan includes a detailed description of the test scope, setup and procedures. It is essential when the test requires manual operation.

It should also include a traceability matrix with the functional specifications.

The Modular test report should be issued and updated after major testing sessions (like a new release) and contain indication of all problems encountered during testing.

The test should not be designed and implemented by the module's responsible and any person with VLT software knowledge should be able to run it.

Output-based testing

Testing procedures are not self-contained

Test is based on first-run user validation of the output

This approach:

but:

Tools are provided to support
test's implementation

tat:

eccsTestDriver:

Some effort is necessary to better integrate the two tools

Example:

This example shows how tat and eccsTestdriver are used together in the test for the TCS Mode Switching Module:

ENVIRONMENT wsTat WS mswTat mswTestInitDb.sh TestDriver 1 mswTestStdCommands mswControl "evhDummyPRS mswTestDummyPRS.dat" "evhDum myTRK mswTestDummyTRK.dat" "evhDummyACT mswTestDummyACT.dat" "evhDummyLT5M3 mswTestDummyLT5M3.dat" mswTestStdCommands 2 mswTestStateChanges mswControl "evhDummyPRS mswTestDummyPRS.dat" "evhDum myTRK mswTestDummyTRK.dat" "evhDummyACT mswTestDummyACT.dat" "evhDummyLT5M3 mswTestDummyLT5M3.dat" mswTestStateChanges 3 mswTestFlagsRequiredIgnore mswControl "evhDummyPRS mswTestDummyPRS.dat" "evhDummyTRK mswTestDummyTRK.dat" "evhDummyACT mswTestDummyACT.dat" "evhDummyLT5M3 mswTestDummyLT5M3.dat" mswTestFlagsRequiredIgnore s/Environment : .* StackId : [ 0-9][ 0-9][ 0-9][ 0-9][ 0-9][ 0-9]/Environ ment : -te---- StackId : ------/g s/Sequence : *[ 0-9][ 0-9]/Sequence : -- /g s/signal: [ 0-9][ 0-9]/signal: --/g s/[lw]t[e0-9][a-z0-9A-Z]\{2,4\}/-te----/g s/@(#) $Id.*/@(#) $Id/g

Application's testing

The handling of multi-process tests provided by eccsTestDriver is extremely important while testing applications.

A typical "library test" consists of programs written in the same language of the library (typically C/C++ or TCL) that directly exercise the provided function and classes.

An "application test" must execute the application and exercise its external interface, sending commands and using dummies for the other applications it is supposed to talk to.

Example:

1 mswTestStdCommands mswControl "evhDummyPRS mswTestDummyPRS.dat" "evhDum myTRK mswTestDummyTRK.dat" "evhDummyACT mswTestDummyACT.dat" "evhDummyLT5M3 mswTestDummyLT5M3.dat" mswTestStdCommands #------------------------------------------------------------------------ printLog "Test standard commands" mswTestInit #------------------------------------------------------------------------ # Test standard commands one by one printLog "Test standard commands one by one" mswTestSendCommandAndGetStatus PING mswTestSendCommandAndGetStatus INIT mswTestSendCommandAndGetStatus VERBOSE On testReadDbValue ":Appl_data:TCS:msw.verbose" mswTestSendCommandAndGetStatus VERBOSE Off testReadDbValue ":Appl_data:TCS:msw.verbose" mswTestSendCommandAndGetStatus STOPSIM testReadDbValue ":Appl_data:TCS:msw.simulation" testReadModuleState mswTestSendCommandAndGetStatus OFF mswTestSendCommandAndGetStatus ONLINE testReadModuleState mswTestExit # ___oOo___ # General commands (for standard modules) SETUP,"OK",0,0,1 # Mode Switching emulation PRESET,"OK",0,0,10 EPRESET,"OK",0,0,10 # Tracking emulation STOP,"OK",0,0,5 OBJSTAR,"OK",0,0,5 OFFSAD,"OK",0,0,5 OFFSADG,"OK",0,0,5 ...... 2 - Entering the main loop and waiting for commands! 4 - Loading COMMANDS file mswTestDummyACT.dat 2 - Loading COMMANDS file mswTestDummyPRS.dat 4 - Loaded 5 commands 2 - Loaded 5 commands 5 - Entering the main loop and waiting for commands! 5 - Loading COMMANDS file mswTestDummyLT5M3.dat 3 - Entering the main loop and waiting for commands! 5 - Loaded 6 commands 3 - Loading COMMANDS file mswTestDummyTRK.dat 3 - Loaded 5 commands 1 - mswControl - Application started (proc name: mswControl, DB root point: :Appl_data:TCS) 6 - Test standard commands 6 - Starting test ..........

Other support tools

Other tools are provided as part of the VLT software or as external tools to help in testing, like for example:

Reference documents and readings

Conclusion

In the VLT software a lot of effort is spent in providing a good testing coverage in all levels of software development, from basic libraries to application software.

The methodology used includes:

and makes use as much as possible of:

More effort should be spent in providing built-in test capability in reusable software and in particular inside object oriented software (classes, design patterns...).