Tuesday, January 26, 2010

TDD or not TDD thats the question!

For the past year i've being very involved in a project and we decide that TDD was a way to go to guarantee have a good TestCase suite and to be fully sure that each class have enough coverage when doing unit test. Hence we start relying in a particular mocking framework (after evaluating several of them EasyMock, JMock, PowerMock, Mockito) we decide to stick with JMockit. Our decision was based on the fact that we need to interface we a lot of legacy code that was not design having testability in mind, therefore JMockit plays a huge role here given its natures of Mocking anything (final classes, private methods, static methods,....).

It says that once you start hammering everything seems a nails to you and i must said im guilty on this. Recently i stump upon a site that make me think about this, i had really use this mocking framework in areas where it was not really needed, So yes I'm Guilty.

Now i look back and i now understand what a horrible mistake i did, i see myself now suffering the “Fragile Test” problem. Answer yourself this question and you may know what I mean:

How many tests break when you change a module? If the number is high, then the coupling between your modules and tests in high. Therefore, I conclude that those systems that make prolific use of mocking frameworks are likely to suffer from fragile tests.
Here is the complete article Mocking Mocking and Testing Outcomes.

The good news is that we are human and we are able to change and adapt, so lets get those test case fix! :D


Tuesday, January 19, 2010

Back on track!

Hi, I know i have being lost for a while!, almost 2 years from the last post. But a lot of things had happened and hopefully soon i will start posting again. Sharing all those cool stuff i usually find with my dear readers (which at this point i really consider my audience currently had drop to zero!) Nevertheless is 2010, so this new year brings new milestones both in my personal life and professional life. So lets get back on track!

So stay tune!