Definition
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The DoWithInterpreter is used to express interactions with the system under development that must be performed in a particular order. This form of specification provides information about the business flow. When a sequence of action is executed, GreenPepper confirms that each action has successfully been performed.
|
Specific Keywords
GreenPepper offers a list of useful keywords to support the Business Expert. Those keywords are placed at the beginning of an action row.
Accept | Confirm that the action has been executed by the system under development. |
---|---|
Check | Verify the specified expected value with the value returned by the system under development |
Reject | The action should not be performed by the system under development (expected errors). |
Display | Print the value returned by the system under development. |
coloring
GreenPepper will visually show the test result by coloring each testing cell:
...
Standard form (without keyword) | Only the Action description will be colored. |
---|---|
Accept | Only the cell containing the keyword Accept will be colored. |
Check | The cell containing the expected value will be colored. In the case of a failure, GreenPepper will show the expected and the returned values. |
Reject | Only the cell containing the keyword Reject will be colored. |
Display | A new cell at the end of the row will be colored containing the returned value. |
Writing a Do With specification
When do we use the DoWithInterpreter
The DoWithInterpreter is used to express interactions with the system under development that must be performed in a particular order. This form of specification provides information about the business flow.
When a sequence of action is executed, GreenPepper confirms that each action has successfully been performed.
First row: Identification of the Do With
As for all other interpreters, the first row of the DoWithInterpreter specifies the name of the interpreter and the name of the sequence of actions to be tested. What makes the DoWithInterpreter particular is that it only has to be defined once for all the sequences of actions expressed in a page. Obviously, the DoWithInterpreter must be defined before any sequence of actions.
Example of a bank Account management system
Example context : The system under development must be able to manage two different types of bank account. The system should allow to execute the usual transactions within an account.
...
or more simply as
do with | bank |
Following rows: Actions & Verifications
The second and the following rows are used to express specific actions or verifications. The business expert should express the action in human readable format rather than using computer like language.
Info | |||||||
---|---|---|---|---|---|---|---|
The form of each row of a DoWithInterpreter must follow these rules:
More visually:
|
Example: In our bank example, the first action would be to create a bank account.
If we want to take the account number as a parameter, we would have:
...
open | checking | account | 12345-67890 | under the name of | Spongebob | Squarepants |
Example: Verify the balance of an account
To verify the success of a particular action, we write the keyword "Check" prior to the first part of the action description.
In our example, there would be two parameters: the account number and the amount of balance.
check | that balance of account | 12345-67890 | is | $0.00 |
Final expression of our example
do with | bank |
Our first business rule says that a new account should have a balance of 0.00 dollars.
...
withdraw | $50.00 | from account | 12345-67890 | |
check | that balance of account | 12345-67890 | is | $50.00 |
reject | withdraw | $75.00 | from account | 12345-67890 |
check | that balance of account | 12345-67890 | is | $50.00 |
accept | withdraw | $25.00 | from account | 12345-67890 |
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.
...
Info |
---|
The examples provided in this page are used to explain how to write the fixture for the DoWithInterpreter. |
Scenario specification
Definition
...
bgColor | #FFFFFF |
---|---|
titleBGColor | #F0F0F0 |
borderStyle | solid |
title | DEFINITION |
The ScenarioInterpreter is used to express interactions with the system under development that must be performed in a particular order. This form of specification provides information about the business flow.
When a sequence of action is executed, GreenPepper confirms that each action has successfully been performed.
...
- As for all other interpreters, the first row of the ScenarioInterpreter specifies the name of the interpreter and the name of the sequence of actions to be tested. What makes the ScenarioInterpreter particular is that it only has to be defined once for all the sequences of actions expressed in a page. Obviously, the ScenarioInterpreter must be define before any sequence of actions.
- The ScenarioInterpreter may also be expressed in Bullet List form or Number List form.
Coloring
GreenPepper will visually show the test result by coloring a complete row or words inside the row:
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
When the action has been executed successfully, GreenPepper colors the row or words inside the row in green. |
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If the action execution has failed, GreenPepper colors the the row or words inside the row in red. |
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If the system encounters an execution error, the row is colored yellow and GreenPepper provides information about the error. |
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
When the action has been executed successfully, GreenPepper will display the returned value in gray. |
Writing a Scenario specification
When do we use the ScenarioInterpreter
The ScenarioInterpreter is used to express interactions with the system under development that must be performed in a particular order. This form of specification provides information about the business flow.
When a sequence of action is executed, GreenPepper confirms that each action has successfully been performed.
First row: Identification of the Scenario
As for all other interpreters, the first row of the ScenarioInterpreter specifies the name of the interpreter and the name of the sequence of actions to be tested. What makes the ScenarioInterpreter particular is that it only has to be defined once for all the sequences of actions expressed in a page. Obviously, the ScenarioInterpreter must be defined before any sequence of actions.
Example of a bank Account management system
Example context : The system under development must be able to manage two different types of bank account. The system should allow to execute the usual transactions within an account.
So the first line could be expressed as
scenario | bank account management |
or more simply as
scenario | bank |
Following rows: Actions & Verifications
The second and following rows are used to express specific actions or verifications. The business expert should express the action in human readable format rather than using computer like language.
Info |
---|
With this interpreter, only 1 cell is required to express the action (in comparison to the DoWithInterpreter). |
Example: In our bank example, the first action would be to create a bank account .
If we want to take the account number as a parameter, we would have:
open checking account 12345-67890 |
But, if we want to consider the type of account, the account number, the owner first name and last name as parameters, we would have:
open checking account 12345-67890 under the name of Spongebob Squarepants |
Example: Verify the balance of an account
In our example, there would be two parameters: the account number and the amount of balance.
verify that balance of account 12345-67890 is $0.00 |
Final expression of our example
scenario | bank |
Our first business rule says that a new account should have a balance of 0.00 dollars.
...
Our next rule says that the bank should not take any fees when we deposit money in our account.
deposit $100.00 in account 12345-67890 |
verify that balance of account 12345-67890 is $100.00 |
The following rule says that a customer should be able to withdraw funds if the balance of his account is sufficient.
withdraw $50.00 from account 12345-67890 |
verify that balance of account 12345-67890 is $50.00 |
can't withdraw $75.00 from account 12345-67890 |
verify that balance of account 12345-67890 is $50.00 |
can withdraw $25.00 from account 12345-67890 |
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, GreenPepper will color rows or words inside a row in green if the execution has passed and color it in red if the execution has failed.
Info |
---|
The examples provided in this page are used to explain how to write the fixture for the ScenarioInterpreter. |