Example case: Processing sales statistics

In this example, you will learn how to add templates and tasks to a new project. We will also show you how to insert templates into tasks and how to configure the settings for processing your templates.

In addition, you will learn how to use functions, how to define placeholders (variables) for variable values, insert them into templates, format them for output and modify their content.

A detailed description of how to use variables is given in chapter "Working with variables". The use of functions is described in chapter "Output and formatting".

Scenario

An electrical goods manufacturer sells their products through a number of branches, not all of which are part of their company. In order to calculate the commission due to the external branches, the branches send the statistics about units sold to the manufacturer at the end of each trading day.

Since different branches use different software to capture these figures, the statistics will not always have the same format. For this reason, each set of results has to be fitted with an appendix. The appendix specifies how the data in the file are to be processed.

The files and their appendices are transferred to a central server. During this process, the appendix is extracted and saved together with the sales results in a directory. A second program reads the appendices and decides, based on the information contained therein, how the figures should be processed further.

The program that evaluates the appendices is the one that needs to be tested.

Specific requirements

The appendices are text files with the following format:

type = text

serno = 1

date = 20011001

time = 151030

processing = low

  • type is either text or table

  • serno is an integer that is incremented for every set of results received

  • date must contain a valid date in the format YYYYMMDD

  • time must contain a valid time in the format hhmmss

  • processing is either high or low

The file name contains the components date, time, and serno and it has the following format (the angled brackets only denote a component, they are not part of the file name):

<date>-<time>-<serno>.txt

The values used in the file name must match the contents of the respective file.

Test scenarios

200 files that meet the following conditions have to be generated for a test:

  • date must contain the current date and be in a valid format

  • date must contain a valid time and be in a valid format. The time value itself is not relevant for the test

  • serno has to be incremented by 1 from file to file

  • type and processing must contain valid values. The value itself is not relevant for the test