TEF Overview and Concepts

Overview

TEF provides a C++ library for building test harnesses and a script engine that allows the automated execution of such tests using testing tools like TestDriver. It is often used in conjunction with TestDriver V2, which enables you to build and run tests on a device or an emulator, and get a report on the test result.

The reader must have a good knowledge of Symbian C++, and Object Oriented Programming (OOPS) concepts.

Concepts

TEF is a means of using API functions under controlled, monitored and repeatable conditions.

  • Test Step: A piece of C++ code which excutes a sequence of API calls. Typically matched to a use case in a specification but also used to ensure that every function is exercised.

  • Test Harness: A standard generic piece of code or application for running test steps.

  • Test Server: Responsible for construction and destruction of test steps.

  • Script: Controls flow of execution of tests.

TEF Components

The main components of TEF are:

  • Script Engine: The TestExecute program is a script parser that reads .script files which cause the execution of the individual test steps. A number of script commands exists that either map to the functions in the TestStep client API (for example, run a Test Step) or are utility commands (such as deletefile, copyfile, and so on).

  • Utils Library: This is a library that provides abstract classes for test steps (CTestStep) and for a test server (CTestServer). You must derive from these classes in order to create the tests. A single test server can create and control one or more test steps. Each test step can run in its own thread, which allows tests to run concurrently.

  • Log Engine: The framework links to two log servers, one for the HTML and another for XML logging. The script engine and the utils library use the APIs of the log servers to create log files, write formatted messages in the form of HTML tags or XML block structures and also saves the log files at the end of test execution. The log servers are optionally instantiated by the framework using the option set for LogMode key in the TestExecute.ini file. The location of the log files, c:\logs\testexecute\ by default, is set in TestExecute.ini.

How TEF works

CTestServer is a generic test harness that creates and executes generic CTestSteps. By deriving from these two framework classes you can create custom test applications for your C++ APIs. The framework contains a script engine and external interfaces which allow it to be driven at runtime by a textual script file, to read data from textual configuration files and to write formatted output in HTML or XML. This combination allows you to create automated tests that can be run under a variety of controlled conditions on an emulator, reference hardware and real devices.

The diagram below shows the components provided by the framework in blue and those that you must provide in green.

TEF architecture


TEF architecture

The data file may be used for supplying data and as a writeable resource by the executable for temporary data storage.

TEF lite

TEF lite is a reduced version of TEF. It has fewer features than normal TEF and can run in a base ROM environment which has fewer OS components.

The version number of TEF lite is displayed by using the -v command-line option.

See also

Using TEF

Reference