test driven development
TRANSCRIPT
By Poonam Bhasin07030244011
• What is Testing• What is Test Driven Development• Things to Test• Advantages of TDD• Testing via xUnit Framework• 2 Simple rules for TDD
Design
Implement
Test
Design
Test Test
Implement
Valid Inputs Invalid Inputs Errors, exceptions,
and events Boundary
conditions Everything that
could possibly break!
Much less debug time : Programmers using pure TDD on new projects report they only rarely feel the need to invoke a debugger. Eliminating defects early in the process usually avoids lengthy and tedious debugging later in the project.
Helps build Software better and faster Does not only offer simple validation of correctness Also drives the design of the program
Forces the programmer to focus more on the interface than on implementation: By focusing on the test cases first, one must imagine how the functionality will be used by clients
Limit the number of defects in the code : The early and frequent nature of the tests helps to catch defects early in the development cycle, preventing them from becoming endemic and expensive problems
TDD leads to more modularized, flexible, and extensible code: Since the methodology requires that the developers think of the software in terms of small units that can be written and tested independently and integrated together later. This leads to smaller, more focused classes, looser coupling, and cleaner interfaces.
Write new business code only when an automated test has failed
Eliminate any duplication that you find
To Implement the rules• design organically, with the running code
providing feedback between decisions • write your own tests • development environment must provide rapid
response to small changes • designs must consist of highly cohesive, loosely
coupled components (e.g. your design is highly normalized) to make testing easier
Thank you