Wednesday, August 29, 2007

Integration Testing more important than Unit Testing

When I'm learning a new framework, strict unit testing isn't very helpful. To illustrate, here's an example:

I want to write a command object of some sort that interacts with jbpm. Jbpm is a workflow engine, with nodes and transitions. I need to look up a process (a collection of nodes and transitions), select a node and tell it to take a particular transition.

If I use EasyMock to ensure that I'm testing only my code, I can test whether the code is doing what I expect. However, that doesn't answer the most important question: Am I doing this the right way?

In my example, there are a couple of ways to look up nodes, and a couple of situations where the framework behaves differently than I expect. I can't find any of that until I do integration testing.

The paradox is that the authors of the framework don't have questions about which approach in their own framework is the correct one. Hence, testing integrations with the framework isn't attempted, and anything not attempted isn't factored into the design.

Bottom Line: Easy integration testing is key for rapid framework adoption.

1 comment:

jeremy said...

This is really very interested article. I have lot of interested in testing. This is fact that integration testing is more important than unit testing because you can test in deeply and the output of this test will good. it is best manner to test. Keep it updated. Thanks for provide valuable knowledge.

Jeremy
Luwow Goldman