What is Test Driven Development?
Test-Driven Development (TDD) is a software development technique :
- where all test cases covering all functionalities and/or enhancements of a system are written first iteratively.
- the production code must pass all tests implemented.
- software is refactored to accommodate changes.
TDD makes availability of tests before actual development. This approach ensures quality of deliverable resulting in least rework in code. If any change request or enhancement comes then already existing test case coverage ensures sanctity of all existing functionalities of software. TDD is emphasized as a method of designing software, not merely a method of testing.TDD is also linked with test-first programming concepts like Extreme Programming.TDD helps great deal to improve software quality from legacy code that was not developed in this way.
TDD requires an automated unit test, defining requirements of the code, all positive and negative scenarios which your code has to undergo are written before the code itself. These tests contain assertions that are either true or false. When these tests are run then it gives rapid confirmation of correct behavior as the code evolves and is refactored. In Java world unit testing mechanism is introduced using JUnits and mocking the expected result or behaviour using JMock framework.JMock is a library that supports TDD of Java code with mock objects.These mock objects help you design and test the interactions between actual objects in your programs.
- where all test cases covering all functionalities and/or enhancements of a system are written first iteratively.
- the production code must pass all tests implemented.
- software is refactored to accommodate changes.
TDD makes availability of tests before actual development. This approach ensures quality of deliverable resulting in least rework in code. If any change request or enhancement comes then already existing test case coverage ensures sanctity of all existing functionalities of software. TDD is emphasized as a method of designing software, not merely a method of testing.TDD is also linked with test-first programming concepts like Extreme Programming.TDD helps great deal to improve software quality from legacy code that was not developed in this way.
TDD requires an automated unit test, defining requirements of the code, all positive and negative scenarios which your code has to undergo are written before the code itself. These tests contain assertions that are either true or false. When these tests are run then it gives rapid confirmation of correct behavior as the code evolves and is refactored. In Java world unit testing mechanism is introduced using JUnits and mocking the expected result or behaviour using JMock framework.JMock is a library that supports TDD of Java code with mock objects.These mock objects help you design and test the interactions between actual objects in your programs.