10 July 2008

Holy Conditionals Batman...

by mo

In case you haven’t you should read…

xUnit Test Patterns: Refactoring Test Code (The Addison-Wesley Signature Series)
by Gerard Meszaros

Read more about this book...

As a reminder, let’s talk about a test smell described in the above mentioned book. It’s called Conditional Test Logic.

Conditional Test Logic: A test contains code that may or may not be executed." xUnit Test Patterns

A fully automated test is just code that verifies the behavior or other code. But if this code is complicated, how do we verify that it works properly?

Warning bells should sound off in your head when you start to see looping or conditional constructs within a single unit test.

Code that has only a single execution path always executes in exactly the same way. Code that has multiple execution paths presents much greater challenges and does not inspire as much confidence about its outcome.

For more information check this out

Basically Ignore Logic… that could cause multiple execution paths within a single unit test.

books csharp tdd