1 / 4

What is TDD Good For?

Provide a safety net for refactoring Think about each component from a client’s point of view Testable code is loosely coupled code is good code!. What is TDD Good For?. For any project of non-trivial size How to demonstrate this in a short talk?. Thank You Leon Bambrick.

kaleb
Download Presentation

What is TDD Good For?

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. Provide a safety net for refactoring • Think about each component from a client’s point of view • Testable code is loosely coupled code is good code! What is TDD Good For? For any project of non-trivial size How to demonstrate this in a short talk?

  2. Thank You Leon Bambrick So Let’s Validate an Email Address! • Should match email@domain • Should match domains in India @abc.co.in • Should not match if domain has illegal chars • Etc.

  3. Lets Expand A Bit Add a User • Must have a name • Must have valid email • Once we know this is true we can save But Unit Tests should test a unit, not a system! We need to be able to test each component in isolation We need a mock UserValidator with canned responses

  4. Enter Mocking • Rhino Mocks • MOQ • Typemock Isolator • Provide canned responses to method calls • Establish expectations and verify them • Assert that methods were called por not called

More Related