sharepointunit-testingk2

Unit/Automated Testing in a workflow system


Do you do automated testing on a complex workflow system like K2?

We are building a system with extensive integration between Sharepoint 2007 and K2. I can't even imagine where to start with automated testing as the workflow involves multiple users interacting with Sharepoint, K2 workflows and custom web pages.

Has anyone done automated testing on a workflow server like K2? Is it more effort than it's worth?


Solution

  • I'm having a similar problem testing workflow-heavy MOSS-based application. Workflows in our case are based on WWF.

    My idea is to mock pretty much everything that you can't control from unit tests - documents storage, authentication, user rights and actions, sharepoint-specific parts of workflows for sharepoint (these mocks should be thoroughly tested to mirror behavior of real components).

    You use inversion of control to make code choose which component to use at runtime - real or mock.

    Then you can write system-wide tests to test workflows behavior - setting up your own environment, checking how workflow engine reacts. These tests are too big to call them unit-tests, still it is automated testing.

    This approach seems to work on trivial cases, but I still have to prove it is worthy to use in real-world workflows.