Test Execution
Testing within the FitNesse system involves four components per test:
- The wiki page which expresses the test as a decision table.
- A testing engine, which interprets the wiki page.
- A test fixture, which is invoked by the testing engine and in turn invokes the system under test.
- The system under test, which is being tested.
Of these components the software development team produces two: the wiki page and the fixture (of course it also produces the system under test, but from the point of view of the black-box test only two). The wiki page includes some form of decision table which expresses a test. For example, it might express tests for a component that performs division (the example is based on the one given in the FitNesse Two Minute Example):
Division component test | ||
---|---|---|
numerator value | denominator value | result? |
10 | 2 | 5.0 |
10 | 5 | 2.0 |
5 | 2 | 2.5 |
The link between the generic testing engine and the system under test is made by a piece of Java code called a fixture. In the case of the table above this code might look like this:
public class DivisionComponentTest extends ColumnFixture{ private double num; private double denom; public void setNumeratorValue (double numerator) { num = numerator; } public void setDenominatorValue (double denominator) { denom = denominator; } public double result { return SystemUnderTest.divide (num, denom); } }The mapping between the wiki page and the fixture is a straightforward convert-to-camel case mapping. This mapping applies to all table headings and is used to identify the name of the fixture class as well as the methods of the fixture. A heading ending in a question mark is interpreted as a value to be read from the fixture, other headers are considered inputs to the fixture. Methods of the fixture are called in column order of the decision table, from left to right.
Read more about this topic: Fit Nesse
Famous quotes containing the words test and/or execution:
“Unless the people can choose their leaders and rulers, and can revoke their choice at intervals long enough to test their measures by results, the government will be a tyranny exercised in the interests of whatever classes or castes or mobs or cliques have this choice.”
—George Bernard Shaw (18561950)
“I am gradually drifting to the opinion that this Rebellion can only be crushed finally by either the execution of all the traitors or the abolition of slavery. Crushed, I mean, so as to remove all danger of its breaking out again in the future.”
—Rutherford Birchard Hayes (18221893)