Browse Prior Art Database

White-box Testing in Signal-Based Software Systems

IP.com Disclosure Number: IPCOM000235753D
Publication Date: 2014-Mar-25
Document File: 4 page(s) / 74K

Publishing Venue

The IP.com Prior Art Database

Abstract

A software system consisting of components that communicate through signal-based interfaces is complex to test. Traditional techniques for unit testing do not work well for such components since they are typically based on black-box testing. This article presents a method for testing such systems that is based on white-box testing of an instrumented version of the system. With this approach it is not necessary to create mocks for sub components, which saves time. Also, the test coverage can increase.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 28% of the total text.

Page 01 of 4

White-box Testing in Signal-Based Software Systems

A method is disclosed for unit testing a software system which consists of components that communicate through signal-based interfaces. Each component in the system is composed of zero to many sub components, which also communicate

by means of signals.

    Traditional unit testing of components in such a system is usually done using black-box testing, i.e. the test driver (the agent that runs the testing code) only uses the external interfaces of components when exercising unit tests. This often leads to a rather low test coverage since the majority of a component's functionality is not exposed in its external interface. In particular the sub components are completely invisible in the external signalling interface of the component. When unit testing a component it is usually not desirable to let the component use its real sub components since doing so increases the risk that a test case fails because of problems in a sub component, which is not the focus of a unit test to discover. Traditionally this problem is solved by replacing the sub components by mock components, which provide simplified implementations constructed in a way that

makes a unit test simple and meaningful. Mocking techniques are based on dependency injection, which allows the testing code to dynamically substitute the

real sub components by mock components. However, systems of signalling components are often designed in a way where the sub components are created automatically when the container component is created. Since the component only provides a signalling interface, and a signal only can be received once the component and all of its sub components have already been created, there is no

way in which testing code could replace the sub components by mock components. Hence, traditional mocking techniques do not work for components in these kinds of systems.

    The method described in this article is based on white-box testing, i.e. by exposing the implementation of the tested component to the test driver. The idea is to instrument the component under test (CUT) in order to provide a test interface in addition to its external signalling interface. Through this test interface a test driver can:

  1. inject signals into the implementation of the component 2. inject signals to sub components of the component 3. intercept signals being sent from the implementation of the component to one of its sub components 4. intercept signals being sent to the implementation of the component from one of its sub components
Hence, the test driver can perform a unit test of the component where any possible signal can be injected as if it was sent by a sub component. The real sub components can therefore remain unlocked when testing the component, but they need not be used since the test driver can play all of their roles during the test. In the same way the test driver can observe and intercept the signals which are sent out from the comp...