1 / 3

Test-Driven Development

Test-Driven Development (TDD) is a software development approach emphasizing testing before code implementation. The three fundamental rules of TDD are: 1) Write a failing unit test before any production code, 2) Only write as much unit test code as is needed to fail or compile, and 3) Only write enough production code to pass the failing test. TDD offers numerous advantages including ensuring all functions are testable, identifying when something breaks, providing a clear view from the caller's perspective, and serving as documentation through working examples.

vidal
Télécharger la présentation

Test-Driven Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test-Driven Development

  2. Three Rules • Don’t write any production code until you have written a failing unit test. • Don’t write more of a unit test than is sufficient to fail or fail to compile • Don’t write any more production code than is sufficient to pass the failing test.

  3. Advantages • All program functions are testable and have tests that verify their operation. • We can tell when we break something. • We see the function from the caller’s point of view. • The function will be “conveniently callable.” • Because the function is callable, we have decoupled it from other system software – e.g., the user interface. • Test provides documentation in the form of a working example.

More Related