Test Driven Development

Post on 17-May-2015

589 views 0 download

Tags:

description

This was one of my first presentations that I gave in Columbus, Ohio at an event called "Day of .Net"

Transcript of Test Driven Development

Test Driven Development

Ben CareyNuSoft Solutions

The Presentation What is TDD? How do I do it? Why do it? Lessons learned Resources Q&A

What do you want to talk about? (please interrupt)

What is TDD? Writing clean code that works The use of testing for…

Automated Feedback Incremental Design

It’s more than just unit testing Developer Tests Functional Tests Performance Tests Regression Tests Design in the context of today’s problem

What is TDD?

How do I do it? Think about what you want to do. Think about how to test it. Write a small test. Watch it fail. Write enough code to watch it pass. Refactor

Once and only once DRY

Repeat

How do I do it? Demo

Why do it? Feedback

Know what works Know what doesn’t

work Change things (and

know if it worked)

Why do it? Communication

Executable documentation It’s always up to date How many of your requirements / design documents

can be proven? Give new team members code instead of word

documents Demonstrate intent Show usage

Why do it?

Why do it? Simplicity

Organic Architecture Empathetic code We (by habit) over-engineer our code Keep architecture / design in proportion to

today's needs Design based on feedback / experience

Why do it? Courage vs. Fear

What are the implications of this change?

Did I break anything? Trust

Lessons Learned Readable trumps well-factored Red / Green / Refactor = Flow Defects – Prove it, then fix it (forever) Adopt multiple levels of testing The 10 minute rule Use Mock objects

Good Stuff Test Driven Development: By Example Test-Driven Development in Microsoft .Net Pragmatic Unit Testing in C# with NUnit

www.testdriven.com www.testingreflections.com www.c2.com

The EndContact Info:

Ben Careybcarey@nusoftsolutions.comNuSoft Solutions614-607-3754