Posts Tagged Unit Test

Single Function

A single function is the smallest reasonable test object of a C program and is usually considered to be a unit. Unit testing is functional black-box testing, i.e. it is based on the interface of the function (i.e. input/output variables and called functions). Unit testing is dynamic, i.e. the test object is executed.

Unit Test

During unit testing the test object is tested in isolation from the rest of the application

If the function under test calls other functions, during pure unit testing, the calls to these functions are replaced by calls to stub functions.

Testing of a single function (i.e. unit testing) is the functionality of many unit testing tools including Tessy and will not be discussed further here.

, , , , ,

No Comments

Hierarchy of Functions

A hierarchy of functions can be tested in a manner very similar to the test of a single function by taking the top-level function as the test object, and considering the called functions as to be inside the test object.

Hierarchy of functions

A hierarchy of functions takes the top-level function as test object.

This is technically achieved by not replacing the called functions by stub functions. You may still consider this as unit testing as above, but for bigger units.

It can also be considered as integration testing for the functions in the hierarchy, because they have to work together correctly to pass the tests, at least to some extent. Such a hierarchy of functions could also be called a module, but this term should not be confused with a C source module of a C program. (A C source module is not automatically an appropriate test object for module testing, as it is defined syntactically, whereas a module for module testing is defined semantically.)

The testing of a hierarchy of functions is technically very similar to the testing of a single function. Testing of a hierarchy of functions is the functionality of many unit testing tools including Tessy and will not be discussed further here.

, , , , , , ,

No Comments

Testing of Software Components

This page discusses the testing of software components. To approach the term “component testing”, we need also to discuss the terms “unit testing”, “module testing”, and “integration testing”. We assume the software to be written in C. The definition of the terms is based on the type of the possible test objects.

The topic is illustrated by referring to the features of Tessy, a tool to automate unit / module / integration testing of embedded software.

Read on:

, , , ,

No Comments