Skip to main content

Posts

Showing posts from February, 2012

Test driven development

More than last 12 months I am a great sponsor of the test driven development. But how i become a great devotee of TDD is very much interesting. I was given task to restructure the existing system. This is one of the most important features in our system. When i seen the existing code it was in a malicious situation. Lots of unwanted, complex complicated loops. So before starting the reconstructing the whole team sit together and decided we are going to start something new. It might slow down the process initially but will produce the quality work. Before witting the method we identified the feature's specification and requirements and exception handling phases. Thentest cases are written based on the requirement. Then started working on the methods based on the test cases. First the entire test will fail because the method is written afterward.
Test method example
publicvoid MethodWeAretesting_DescriptionOfInput_ReturnValueAndExpectedBehavior()
{
// Prepare test environment (i.e.: cr…