Slide 1

Slide 1 text

TDD: A Pragmatic Approach A PRACTICAL GUIDE TO TEST DRIVEN DEVELOPMENT

Slide 2

Slide 2 text

John Callaway • Professional developer since 1999 • Specialize in web technologies • Primarily with line-of-business • Enjoy learning new tech

Slide 3

Slide 3 text

What is Test Driven Development Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that isn't proven to meet requirements.

Slide 4

Slide 4 text

Kent Beck says: Clean code that works – now. This is the seeming contradiction that lies behind much of the pain of programming. Test Driven Development replies to this contradiction with a paradox – test the program before you write it.

Slide 5

Slide 5 text

Show of hands • Who writes at least one test a day? • Who writes at least 10 tests a day? • Who writes at least 100 tests a day? • Who will not write a line of production code without a failing test?

Slide 6

Slide 6 text

Why would we test? • Reduce effort of manual testing • Reduce bug count • Ensure some level of correctness • Remove the fear of refactoring

Slide 7

Slide 7 text

Why don’t we test? • Testing is hard • Testing takes time • Testing is expensive • We don’t know how

Slide 8

Slide 8 text

Never have I ever • Used QA as a debugger • Shipped code without verifying it worked • Struggled to reproduce a bug • Cost my company/client money with a defect

Slide 9

Slide 9 text

What is testable code? • Loosely coupled • Properly segmented • Independent • SOLID

Slide 10

Slide 10 text

Let’s see some code!

Slide 11

Slide 11 text

TDD: A Pragmatic Approach John Callaway @matsubonsai www.1north.com

Slide 12

Slide 12 text

Appendix Wiki - https://en.wikipedia.org/wiki/Test-driven_development Kent Beck - https://en.wikiquote.org/wiki/Kent_Beck Code samples - https://github.com/ovation22/PragmaticTDD Homework: • Add more to Horse detail page • Add Colors page listing all colors • Add Color detail page listing all horses of selected color