Best Practices to Write First Class Unit Tests

Techniques such as Test Driven Development, and more recently, Behavior Driven Development are well known. Yet, you still hear conflicting stories about unit testing. Some claim that introducing a lot of unit tests can hamper development, or that those tests are a maintenance problem on itself. To a limited degree I agree, but isn’t that true for all software that is not been well though off? An important reason for this is that unit tests not always seen as being part of the production code.

Fortunately there are guidelines that help you to write useful unit tests that are easy to maintain, and that will actually help to improve the quality and productivity of your development activities. Also, there are several so–called assertion and mocking frameworks that can elevate your testing practices to an even higher level. Obviously I’m going to uncover all those aspect, and tell you about things like when to use an Arrange Act Assert pattern or when a BDD–style approach is better. In short, if you just started unit testing, or if you have a lot of experience already, I’m sure you’ll find some interesting aspects while I’ll be refactoring a bad test to a great test.

Watch this video on