TEFUnit Overview and Concepts

Overview

TEFUnit provides a C++ library for building unit tests. It is often used in conjunction with TestDriver, which enables you to build and run unit tests on a device or an emulator, and to get a report on the test result. There are several benefits of using TEFUnit.

  • You can create multiple test cases within a test suite.

  • You can test multiple components using a single test server.

  • You can structure tests and execute sub-sets.

  • TEFUnit provides an active scheduler for testing in an active environment.

You must have a good knowledge of Symbian C++, Object Oriented Programming (OOPS) concepts and using TEF.

Concepts

Unit Test

A unit test is the smallest test that can be executed on its own.

Test Suite

A test suite is a collection of test units and test suites. When a suite is contained within a suite it is referred to as a sub-suite.

Test Hierarchy

Suites and sub-suites are structured to form a test hierarchy. The hierarchy determines the order in which tests are performed and allows suites, sub-suites and units to be executed independantly.

Test Fixture

A test fixture is an abstract Symbian base class (CTestFixture) that represents a suite or sub-suite.

TEFUnit Components

The main component of TEFUnit is:

  • Static Library: This is a library that provides abstract classes for unit tests (CTestFixture) and for a test server (CTestServer). You must derive from these classes in order to create the tests.

How TEFUnit works

TEFUnit is a standard TEF test server with a set of enhancements and is packaged as a static library. Before reading this you should understand how TEF works. Refer to How TEF Works section in TEF Overview and Concepts.

TEFUnit is an extension to the standard TEF that allow suites of tests to be run. Instead of deriving a server class from CTestServer you must create a small number of global functions which define the executable's server name and its test hierarchy. Though you may create TEF style test steps TEFUnit provides base classes for creating test suites. Test suites can be nested to form a hierarchy.

TEFUnit allows corresponding extensions to the format of the script that drives the TEF. Test step commands can specify suites, sub-suites and tests as well as test steps.

Basic TEF scripts can be used with TEFUnit executables. TEFUnit scripts, however, do not work with basic TEF servers.

The diagram below shows the components provided by TEF in blue, those provided by TEFUnit in yellow and those that you must provide in green.

TEFUnit architecture


TEFUnit architecture