Tags

, , , ,

As a way of software quality control, I will introduce FitNesse test suite to our c++ VoIP voice recording program SistasSVR. FitNesse is web based, written in Java, and may be obtained from http://www.fitnesse.org/FitNesseDownload

fitnesse - download fitnesse

After download, this standalone program may be executed through,

fitnesse - starting fitnesse web

where port is optional which defaults to 80. Interface may be accessed through localhost

fitnesse - main fitnesse suite

Now, lets start writing some test to perform, syntax in easy much like using any type of wiki. Editor may be accessed by ‘Edit’ button, as comment says, create a top level directory for tests. Front page may be cleared and customized later, but it’s leads for help may be useful until get used to FitNesse.

fitnesse - creating main page

When we save the page, we will have our test directory link listed with an option to create the actual page by clicking,

fitnesse - actually creating main page

Let’s create simple tests which will start ‘capturer’ instance that will work on a pre captured pcap file and compare output with a reference one. A test suite with two pages will be sufficient for now. One page called AfterBuildTests will be triggered with each commit to capturer repository. It contains small pcaps in order to make a quick test. It is important to make afterbuild tests be as quick as possible, otherwise no one will use these. RegressionTests will be executed at midnight after daily build. These will be much bigger in order to give taste of a real production run.

fitnesse - suit main page

fitnesse - afterbuild main page

fitnesse - regression main page

We see that front end modification of tests is very simple. Once one has a brand new pcap and a referenece txt, it takes less than half a minute to add a new item.

Now, let’s prepare actual tests (back end). I will use clim for our c++ application. Get decent version of cslim through plugins page of FitNesse,

fitnesse - cslim plugin

I strip away cpputest dependencies, and then made slight modification in the file structure to make it better fit into our build template.

fitnesse - fitnesse file structure

Running as a suite from web should give a similar result to;

fitnesse - test results

We may also run fitnesse from command line, which will be useful in integrating into build automation, such as jenkins;

fitnesse - running in command line

Advertisements