Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Particular behaviour for the superset of interpreters:
Since the SupersetOfInterpreter accepts that the specification may contain rows that are not contained in the SUD,  will not colour the rows contained in the specification but not returned by the SUD.

Writing a List specification

When do we use the CollectionInterpreters

The CollectionInterpreters are used to express any kind of group, list or set of values.

When a CollectionInterpreters is executed, Image Added compares the list of expected values with the list of values returned by the system under development. The test result depends on the specific CollectionInterpreters selected.

Image Added offers four different CollectionInterpreters:

ListOfInterpreterThis interpreter expects to match the content and the order of the list returned by the system under development (SUD) with the expected list defined in the specification.

Image Added

A is a subset of B
B is a superset of A

SetOfInterpreterThe SetOfInterpreter expects to match only the content of the list returned by the SUD with the expected list defined in the specification. The order of the rows is not important.
SubsetOfInterpreterThe SubsetOfInterpreter verifies that each row defined in the specification exists in the list returned by the SUD. In order to have a successful test, the set of elements listed in the specification should be a subset of the list returned by the SUD.
SupersetOfInterpreterThe SupersetOfInterpreter verifies that each row returned by the SUD exists in the list defined in the specification. In order to have a successful test, the set of elements listed in the specification should be a superset of the list returned by the SUD. This means that the specification may contain rows that are not contained in the SUD.

First row: Identification of the Collection Interpreter

As for all other interpreters, the first row of any CollectionInterpreter specifies the name of the interpreter and the name of the collection to be tested.

  • Example - Provinces of Canada: A simple example would be a system containing the Canadian provinces name and code. In that particular case, we could define the collection as Canada Province Codes :

    list ofCanada Province Codes
  • Example - Phone Book : A phone book application able to manage the first name, last name and the phone number of people. The ListOfInterpreter could be express as

    list of

    phone book entries

Other rows: A set of elements

From the third row, we specify the set of values to test.

  • Example - Provinces of Canada :

    list ofCanada Province Codes
    NameCode
    ALBERTAAB
    BRITISH COLUMBIAAB
  • Example - Phone Book :

    list ofphone book entries
    FirstNameLastNamePhone Number
    FredFlintstone(123) 456-7890
    BarneyRubble(123) 321-7666
    GreatGazoo(123) 989-4455

Execution of specification

Once the developers have coded the functionality and the fixture(the fixture is the link between the system under development and the executable specification), the specification can be executed by clicking on the Execute button on the top of the page.

During execution, Image Added will color the rows in green if the rows are in the list of elements returned by the SUD as expected in the specification.
If a row is missing or in surplus in the list returned by the SUD, then Image Added will color the entire row in red and specify if the row is missing or in surplus.

Info
titleNotes

If Image Added specify that a row is missing, it means that the row is not in the list of elements provided by the system under development as it should be.
If Image Added specify that a row is in surplus, it means that the row is in the list of elements provided by the system under development but it should not be.

Since the ListOfInterpreter expects to match exactly the list expected and the list returned by the SUD, Image Added compare each cell of the table separately. If the expected value is different from the returned value, Image Added color the cell in red and provide the two values.

Since the SupersetOfInterpreter accept that the specification may contains rows that are not contained in the SUD, Image Added will not color the rows in the specification but not returned by the SUD.

 

Executable specification for the example - Provinces of Canada

list ofCanada Province Codes
NameCode
ALBERTAAB
BRITISH COLUMBIABC
MANITOBAMB
NEW BRUNSWICKNB
NEWFOUNDLAND and LABRADORNL
NOVA SCOTIANS
NUNAVUTNU
ONTARIOON
PRINCE EDWARD ISLANDPE
QUEBECQC
SASKATCHEWANSK
YUKONYT
OTHER PROVINCEOP

Executable specification for the example - Phone Book

Creating the collection of data
We will use the DoWithInterpreter to create our personal phone book.

do withphone book
insertFred Flintstonewith number(123) 456-7890
insertBarney Rubblewith number(123) 321-7666
insertGreat Gazoowith number(123) 989-4455

ListOfInterpreter : The requirement list should be the same as the SUD list.

list ofPhone book entries
FirstNameLastName
FredFlintstone
BettyRubble
GreatGazoo
WilmaFlintstone

SetOfInterpreter : The requirement set should be the same as the SUD set.

set ofPhone book entries
FirstNameLastName
FredFlintstone
BettyRubble
GreatGazoo
WilmaFlintstone

SubsetOfInterpreter : The requirement set should be a subset of the SUD set.

subset ofPhone book entries
FirstNameLastName
FredFlintstone
BettyRubble
GreatGazoo
WilmaFlintstone

SupersetOfInterpreter : The requirement set should be a superset of the SUD set.

superset ofPhone book entries
FirstNameLastName
FredFlintstone
BettyRubble
GreatGazoo
WilmaFlintstone
Info

The examples provided in this page are used to explain how to write the fixture for the CollectionInterpreters.