Table Of Contents

Next topic

Getting started

This Page

The t3 library

Introduction

Functional testing or black box testing against some specification hasn’t caught much attention in the various open source communities yet. There have been a plethora of Unit Testing frameworks aiming at software developers, together with development methodologies like TDD and the agile programming discourse about it.

Functional testing on the other hand usually reflects highly labor intensive and divisive old industry practices. Specifications, programs and tests are likely written by entirely different parties, working in different departments or organizations. Companies with own test departments often also create their own tools, languages and testing frameworks which do not disseminate beyond the corporations boundary. Those tools are hardly assets, whereas the tests actually are. Understandably that the quality of tools/frameworks varies widely and tending somewhat to the poor end in my own experience.

The role of t3

A test tool can be split into various components. There might be a panel where test scenarios are created and test scripts are selected. Other panels display test results. It is necessary to perform communication to an external device, the SUT ( System Under Test ). Finally there needs to be a medium for writing test cases, perform analysis of data coming from the SUT and assembling new data being sent to the SUT. Python is well suited for this purpose but its role in functional testing can be improved using a couple of classes which support data analysis, synthesis and control of variation. One also often needs some numerical type which can serve the role of a bitmap e.g. preserve leading zeroes which are insiginificant numerically. This is where t3 comes into play.

The features of t3

t3 provides

  • A class T3Number which is a crossover between an integer and a string. It supports various conversions from and into other types. It can be perceived as the currency of t3.
  • A class T3Table which is used to create structured data. A T3Table can parse flat data ( numbers ) into other T3Table objects and can be unparsed into flat data. A T3Table has a complex nature and serves the roles of a parser, a parse tree and a grammar. This notwithstanding T3Tables are easy to use! It is possibly the most innovative part of t3.
  • A class T3Chart and a decorator called flow which can be used derive all possible paths through a finite state machine ( if the number of paths is finite ). This way it supports model checking or exhaustive testing.

t3 was successfully used by Python newbies and I firmly believe it is well suitable for the “average programmer”.