ArticleslgStudy

computer science

Test Template Framework

Test Template Framework is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Test Template Framework rather than just read about it. In short: The Test Template Framework (TTF) is a model-based testing (MBT) framework proposed by Phil Stocks and David Carrington for the purpose of software testing. Although the TTF was meant to be notation-independent, the original presentation was made using the Z formal notation.

Key takeaways

  • Test Template Framework belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Test Template Framework to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Test Template Framework from memory before moving on to harder problems.

Reference excerpt

The Test Template Framework (TTF) is a model-based testing (MBT) framework proposed by Phil Stocks and David Carrington for the purpose of software testing. Although the TTF was meant to be notation-independent, the original presentation was made using the Z formal notation. It is one of the few MBT frameworks approaching unit testing.

Introduction The TTF is a specific proposal of model-based testing (MBT). It considers models to be Z specifications. Each operation within the specification is analyzed to derive or generate abstract test cases. This analysis consists of the following steps:

Define the input space (IS) of each operation. Derive the valid input space (VIS) from the IS of each operation. Apply one or more testing tactics, starting from each VIS, to build a testing tree for each operation. Testing trees are populated with nodes called test classes, test specifications or test conditions. Prune each of the resulting testing trees. Find one or more abstract test cases from each leaf in each testing tree. One of the main advantages of the TTF is that all of these concepts are expressed in the same notation of the specification, i.e. the Z notation. Hence, the engineer has to know only one notation to perform the analysis down to the generation of abstract test cases.

Important concepts In this section the main concepts defined by the TTF are described.

Input space Let Op be a Z operation. Let x1…xn be all the input and (non-primed) state variables referenced in Op, and T1…Tn their corresponding types. The Input Space (IS) of Op, written Opis, is the Z schema box defined by [x1:T1…xn:Tn].

Valid input space Let Op be a Z operation. Let pre Op be the precondition of Op. The Valid Input Space (VIS) of Op, written Opvis, is the Z schema box defined by [Opis|pre Op].

Test class Let Op be a Z operation and let P be any a conjunction of atomic predicates depending on one or more of the variables defined in Opvis. Then, the Z schema box [Opvis|P] is a test class of Op. Note that this schema is equivalent to [Opis|pre Op∧P]. This observation can be generalized by saying that if Opc is a test class of Op, then the Z schema box defined by [Opc|P] is also a test class of Op. According to this definition the VIS is also a test class. If Opc is a test class of Op, then the predicate P in Opc′==[Opc|P] is said to be the characteristic predicate of Opc′ or Opc′ is characterized by P. Test classes are also called test objectives, test templates, test specifications and test conditions.

Testing tactic In the context of the TTF a testing tactic is a means to partition any test class of any operation. However, some of the testing tactics used in practice actually do not always generate a partition of some test classes. Some testing tactics originally proposed for the TTF are the following:

Disjunctive Normal Form (DNF). By applying this tactic the operation is written in Disjunctive Normal Form and the test class is divided in as many test classes as terms are in the resulting operation's predicate. The predicate added to each new test class is the precondition of one of the terms in the operation's predicate. Standard Partitions (SP). This tactic uses a predefined partition of some mathematical operator. For example, the following is a good partition for expressions of the form S♠T where ♠ is one of ∪, ∩ and ∖ (see Set theory). S=∅︀,T=∅︀S≠∅︀,T≠∅︀,S⊂TS=∅︀,T≠∅︀S≠∅︀,T≠∅︀,T⊂SS≠∅︀,T=∅︀S≠∅︀,T≠∅︀,T=SS≠∅︀,T≠∅︀,S∩T=∅︀S≠∅︀,T≠∅︀,S∩T≠∅︀,¬(S⊆T),¬(T⊆S),S≠T As can be noticed, standard partitions might change according to how much testing the engineer wants to perform. Sub-domain Propagation (SDP). This tactic is applied to expressions containing: Two or more mathematical operators for which there are already defined standard partitions, or Mathematical operators which are defined in terms of other mathematical operators. In any of these cases, the standard partitions of the operators appearing in the expression or in the definition of a complex one, are combined to produce a partition for the expression. If the tactic is applied to the second case, then the resulting partition can be considered as the standard partition for that operator. Stocks and Carrington illustrate this situation with R⊕G=(dom G⋪R)∪G, where ⋪ means domain anti-restriction, by giving standard partitions for ⋪ and ∪ and propagating them to calculate a partition for ⊕. Specification Mutation (SM). The first step of this tactic consists in generating a mutant of the Z operation. A mutant of a Z operation is similar in concept to a mutant of a program, i.e. it is a modified version of the operation. The modification is introduced by the engineer with the intention of uncovering an error in the implementation. The mutant should be the specification that the engineer guesses the programmer has implemented. Then, the engineer has to calculate the subset of the VIS that yields different results in both specifications. The predicate of this set is used to derive a new test class. Some other testing tactics that may also be used are the following:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Test Template Framework

Start with the simplest possible case. Write down what Test Template Framework claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Test Template Framework before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Test Template Framework ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Test Template Framework

In research
Test Template Framework appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Test Template Framework in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Test Template Framework is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer-related introductions in 1996, Software testing, Z notation, so understanding it makes those chapters shorter.
In everyday life
Look for Test Template Framework outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Test Template Framework” →

How to study Test Template Framework in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Test Template Framework means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Test Template Framework out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Test Template Framework in simple terms?

The Test Template Framework (TTF) is a model-based testing (MBT) framework proposed by Phil Stocks and David Carrington for the purpose of software testing. Although the TTF was meant to be notation-independent, the original presentation was made using the Z formal notation.

Why does Test Template Framework matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Test Template Framework?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Test Template Framework.

Tags

  • Computer-related introductions in 1996
  • Software testing
  • Z notation

Keep exploring