Comments on: Cover Fire for Coders A well presented post Paul, some other reading suggestions for people interested in testing.The Art of Unit Testing: with Examples in .NET – last one is actually a very in depth reference on testing strategies.

]]>
By: Christian A./2011/02/10/cover-fire-for-coders/#comment-300 Christian A. Fri, 11 Feb 2011 02:58:11 +0000 Hi Paul, great post. Lately I have been having a stab at (somewhat) test-driven development. I haven't been doing it in its strictest sense, because my brain just doesn't work that way but, for certain features, it has been really useful to layout the series of actions as I really intend them to occur in a unit test, because it has helped me actually thrash out just what those actions should be (rather than how to implement them just yet). I have also found that by trying to test-drive my development I have been forced to keep my design as decoupled as possible, so that I can actually control and test the inputs and outputs in an isolated fashion. Of course, I'm lucky because most of the code for my current project is in C# (with only a small amount of C++ for the integration with the game/simulation engine we are using), so all these techniques are really easy. Hi Paul, great post. Lately I have been having a stab at (somewhat) test-driven development. I haven’t been doing it in its strictest sense, because my brain just doesn’t work that way but, for certain features, it has been really useful to layout the series of actions as I really intend them to occur in a unit test, because it has helped me actually thrash out just what those actions should be (rather than how to implement them just yet). I have also found that by trying to test-drive my development I have been forced to keep my design as decoupled as possible, so that I can actually control and test the inputs and outputs in an isolated fashion. Of course, I’m lucky because most of the code for my current project is in C# (with only a small amount of C++ for the integration with the game/simulation engine we are using), so all these techniques are really easy.

]]>
By: Paul Evans/2011/02/10/cover-fire-for-coders/#comment-298 Paul Evans Thu, 10 Feb 2011 22:39:16 +0000 One thing that tests can be highly useful for is shaping the API of your code as well, keeping the types passed in and out of various related methods the same for instance will show up really quickly if in one place it takes an object ID, another it takes the object by value and a third it takes a pointer. It’s likely the code that will call those will need the same consistency.Also if there’s a lot of complicated startup and tear down code it’s a good indicator that class or component is doing too much.I’ve become a convert of behaviour driven development using specs (