Loading...
 
Skip to main content

History: PluginFitnesse

Source of version: 12 (current)

Copy to clipboard
            ! Plugin Fitnesse
The Fitnesse ((wiki plugin)), introduced in ((Tiki12|Tiki 12.1)), is inspired by the [http://en.wikipedia.org/wiki/FitNesse|Acceptance Testing Framework] of the same name.

Tiki applications are meant to be built through the content management system. Historically, the only way to test the behavior of the system was to add more content for edge cases. The Fitnesse plugin allows to create test suites to validate small portions of the system, define behavior (following [http://en.wikipedia.org/wiki/Specification_by_example|ATDD]) and communicate with developers about issues needed to be resolved.
!!Parameters
{pluginmanager plugin="fitnesse"}

!! General Structure
The Fitnesse plugin defines an execution context. Each contained plugin is known as a fixture. These fixtures contain test cases to be validated. While each fixture can define its own format, they will typically contain a table-like structure.

While executing the tests, the plugin will re-write the internal table to display results. Validated entries will show as green, failures as red. As usual in Wiki Tables, -+~np~%%%~/np~+- can be used as the newline separator. 
!! Tracker Math
-+trackerId+- is a required argument. It is the tracker the calculation will be matched against.

The first row contains the list of permanent names within the tracker. The question mark at the end of a field name indicates that the field is a calculation field and must be validated.

The following rows are individual test cases. Each column contains an input value or the expected output in the case of a calculation field.

{CODE(caption=Examples colors="tiki")}
{FITNESSE()}

We want to prioritize important issues that are easy to solve.
{TRACKERMATH(trackerId="42")}
severity|simplicity|priority?
1|1|1
2|3|6
10|10|100
11|10|100
{TRACKERMATH}
{FITNESSE}
{CODE}

Given a calculation of -+(mul severity simplicity)+-, we would have the following result:

^
We want to prioritize important issues that are easy to solve.
||Tracker Math for [PluginFitnesse|Bugs]
__severity__|__simplicity__|__priority?__
1|1|~~green:1~~
2|3|~~green:6~~
10|10|~~green:100~~
11|10|~~red:110 (expect: 100)~~||
^

Failure indicates the formula should include a cap on the priority level that has not been implemented.

!! Tracker Data
Tracker Data is a companion fixture to Tracker Math for formulas containing the (tracker-field) function to access data in a different tracker.

__Data is defined for the current execution context__ and must be defined prior to usage.

The first row contains the permanent names and the itemId key (required). Other rows contains the matching values.

{CODE(caption="Examples" colors="tiki")}
{FITNESSE()}
{TRACKERDATA(trackerId=11)}
itemId|name|ranking
1|Wiki|10
2|Quiz|3
{TRACKERDATA}

Some features matter more than others
{TRACKERMATH(trackerId=42)}
feature|severity|priority?
1|1|10
2|3|9
44|10|50
{TRACKERMATH}
{FITNESSE}
{CODE}

{CODE(caption="Sample Calculation" colors="tiki")}
(mul 
   severity
   (tracker-field
      (object (str trackeritem) feature)
      (field ranking)
   )
)
{CODE}

Expected results:
^
||Tracker Data for [PluginFitnesse|Features]
__itemId__|__name__|__ranking__
1|Wiki|10
2|Quiz|3||

Some features matter more than others
||Tracker Math for [PluginFitnesse|Bugs]
__feature__|__severity__|__priority?__
1|1|~~green:10~~
2|3|~~green:9~~
44|10|~~red:0 (expect: 50)~~||
^

Failure indicates the features should have a default priority of 5.