Dashboard > GreenPepper Open Documentation Refactoring > ... > Customer Guide > 6. Setup specification
  GreenPepper Open Documentation Refactoring Log In View a printable version of the current page.  
  6. Setup specification
Added by Laurent Cobos, last edited by Francois Denommee on Oct 29, 2009  (view change)
Labels: 
(None)

6. Context definition (Setup)

Definition

DEFINITION

The SetUpInterpreter is used to simplify the creation of a particular state for the system under development. Once the state is created, we can focus on the business process to test.

When a setup table is executed, enter data in the system under development to create the desired state.

  • The first row of the table indicates the name of the interpreter and the name of the desired state.
  • The second row is called the header row and serves to identify the data to be inserted in the system under development.
  • Finally, the remaining rows captures the data to be inserted.

Coloring

will visually show the test result by coloring each testing cell:

GREEN

When the insertion has been executed successfully, add a green cell at the end of the data row with the word entered.

RED

If the insertion has failed because the values specified does not respect a business rule, add a red cell at the end of the row with the word not entered.

YELLOW

If the insertion has failed because a specified value generates an error, colors the cell of the data in error yellow and provides information about the error.
If the system encounters an error not related to a specific data, add a yellow cell at the end of the data row and provides information about the error.

Writing a Setup specification

When do we use the SetUpInterpreter

The SetUpInterpreter is used to simplify the creation of a particular state for the system under development. Once the state is created, we can focus on the business process to test.

When a setup table is executed, enter data in the system under development to create the desired state.

First row: Identification of the Set Up

As for all other interpreters, the first row of the setup table specifies the name of the interpreter and the name of the desired state.

Example of a bank Account management system

Example context : A customer should be allowed to transfer money from his or her accounts.

In order to create examples that would test this particular business rule, we need to create a set of customer. The first line of our setup table could be expressed as

setup a group of customers

Second row: the Header

The second row is called the header row and serves to identify the data to be inserted in the system under development.

Example: In our bank example, the header row could take the following form.

setup a group of customers
type number first name last name balance

Following rows: Data

The remaining rows captures the data to be inserted. They are the executable rows.

Final expression of our example

setup a group of customers
type number first name last name balance
checking 11111-11111 Fred Flintstone $250.00
savings 22222-22222 Fred Flintstone $10 000.00
savings 44444-44444 Wilma Flintstone $10 000.00
checking 44444-44444 Barney Rubble $999.54
checking 55555-55555 Great Gazoo abc

From that point, we can now used those accounts to specify examples that define a business rule.

do with bank

Transfer from a savings account to a checking account of the same customer

accept Transfer $1 000.00 from account 22222-22222 to account 11111-11111
check that balance of account 11111-11111 is $1 250.00
check that balance of account 22222-22222 is $9 000.00

Execution of specification

Based on those executable specifications, the developers are now ready to code the functionality and the fixture (the fixture is the link between the system under development and the executable specification). Once this is done, the specification can be executed by clicking on the Execute button on the top of the page.

During execution, confirm that the value has been entered by adding a green cell at the end of each data rows containing the word entered.

If the data could not have been entered because it does not respect a known business rule, the cell will be yellow and will specify the stacktrace. Finally, if the data could not have been entered because of an unknown error, will add a yellow cell at the end of the row containing information about the exception. Note that if the error is specific to a data provided, will color this specific cell yellow and will include the information about the exception.

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

Setup definition (GreenPepper Open Documentation Refactoring )
Writing a Setup specification (GreenPepper Open Documentation Refactoring )

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators