Translate

Friday, 30 April 2010

The Slim Framework

Agile is getting leaner and leaner or so the efforts around the world indicate! And keeping in tune, tools like Slim for .net attempt to reduce complexity in lifecyle activities thereby infusing more agility into the development process.

Slim is the all new Fitnesse-based Test System that has distinct advantages over its pre-decessor - Fitnesse. Fit is, even now, the default test runner in Fitnesse so if you want to use Slim, you need to indicate to fitnesse to use Slim's Test Runner with

!define TEST_SYSTEM {slim}

Then indicate the path of the assembly to test with,

!path c:\SlimGenome.dll (Change this to your .dll file and path)

Then define the command pattern

!define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner,c:\fitSharp\fitsharp.dll %p}

Finally, define the test runner.

!define TEST_RUNNER {c:\fitsharp\Runner.exe}

If you want to debug your script use the RunnerW.exe. This will open a new window that will wait till you press the "Go" button. Press it! Or it will seem that Fitnesse is running the tests over a long period of time!

The advantage with Slim is

1. You do not have to write a separate C# fixture to test the class' functionality.
2. You do not have to learn the "fit" way of writing a class fixture for a column fixture, a row fixture and know which class to inherit from. Slim or rather, fitSharp takes care of this for you.
3. I can now map my Decision Tables (a.k.a. Column Fixtures in Fitnesse) with Scenario Tables and hop on to the BDD wagon without changing my base development process or lifecycle!

Of course, when you need to test custom types, Slim will pose a few challenges but it is worthwhile for the basic usages like a Column Fixture as evident in the below script:

|slim genome series|AT < GC >,A <TA >|
|generategenomepattern?|
|ATGAT|
| ATGAA |
| ATCAT |
| ATCAA |

The first column in the table is the class name. Second column is passing the input to the constructor of the C# class. The next row indicates the Method Under Test. The other rows are the expected output from the test.

That is it. No need to break your head with the developer to know the methods and property names etc and no need for the developer to re-write a separate C# fixture with references to fit.dll and etc.

You can download Slim, fitSharp from

http://github.com/jediwhale/fitsharp/downloads


Happy Fitnesse Testing!

2 comments:

Alex Kell said...

Hey, I'd love to see the fixture for this if possible.

Jv.Net said...

Alex,

You probably didnt follow the post -

"The advantage with Slim is

1. You do not have to write a separate C# fixture for most purposes (unless it is a table of tables) to test the class' functionality."