test driven development

10
By Poonam Bhasin 07030244011

Upload: poonam-bhasin

Post on 06-May-2015

245 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Test Driven Development

By Poonam Bhasin07030244011

Page 2: Test Driven Development

• What is Testing• What is Test Driven Development• Things to Test• Advantages of TDD• Testing via xUnit Framework• 2 Simple rules for TDD

Page 3: Test Driven Development

Design

Implement

Test

Page 4: Test Driven Development

Design

Test Test

Implement

Page 5: Test Driven Development
Page 6: Test Driven Development

Valid Inputs Invalid Inputs Errors, exceptions,

and events Boundary

conditions Everything that

could possibly break!

Page 7: Test Driven Development

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.

Page 8: Test Driven Development
Page 9: Test Driven Development

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

Page 10: Test Driven Development

Thank you