Tuesday, November 27, 2012

Test Driven Development (TDD) Practice - An Effective Software Development-Test Style

TDD - Test Driven Development is where automated Test Cases are written before even writing the actual code. Once the test cases are written the actual minimal code is written just to pass the test case. TDD puts the software test focused before coding and enables to write ONLY testable code. This style of software development makes developers think about the kind of interface that is needed and what are the method parameters before even writing the functional code. Usually in TDD, automated unit test cases are written, however, this can be extended for integration test cases also. Understanding the interface well ahead helps to tackle the Developer Integration Test (DIT) challenges. Following are certain facts, best practices for people who are willing to follow TDD.

It’s not mandatory to automate all the test cases using a single tool in Test Driven Development Approach. And it may not necessarily be for example JUnit Java. It can be any testing tool XUnit or any UI automated test framework such as Eggplant.

Test Driven Development gives a high confidence for the developers during the code refactoring. Code refactoring activity as riskier operation when there are no automated test cases because during refactoring every time there is a code change, that needs to be tested first to ensure it works and does not break any of the other software functionality before continuing with further code refactoring.

To begin with TDD, the best practice is to write test case to test the smallest possible chunk of software functionality. Writing test cases for a larger functionality is discouraged. Automate the software builds using tools such as Hudson, Jenkins that will execute the automated test suites and report build success or failure that includes the result of test case execution results. Its a best practice to gather as a team and discuss the various module interactions before starting to write the automated test cases which helps resolve the developer integration tests.

TDD is a challenge and requires lot of encouragement especially for the team which not got used this methodology and not the team wants to follow. The benefits/advantages have to be thoroughly discussed and realized and these realizations are most of the times inspiration for following the Test Driven Development. It’s also said that developers following TDD are more productive than developers who follow traditional way of software development.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...