TDD: A Pragmatic Approach

TDD: A Pragmatic Approach

Unit Testing can be mysterious endeavor with a high bar for entry. It doesn't have to be that complicated. Many examples on the Internet show you how to write a Unit Test, but not how to test an entire application. We'll discuss the fundamentals of TDD, how to approach an entire application, how to separate logical layers, and how to test the boundaries.

50fef09b0fc80a3c5e28f6a7352bacdf?s=128

John Callaway

June 10, 2016
Tweet

Transcript

  1. 2.

    John Callaway • Professional developer since 1999 • Specialize in

    web technologies • Primarily with line-of-business • Enjoy learning new tech
  2. 3.

    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.
  3. 4.

    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.
  4. 5.

    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?
  5. 6.

    Why would we test? • Reduce effort of manual testing

    • Reduce bug count • Ensure some level of correctness • Remove the fear of refactoring
  6. 7.

    Why don’t we test? • Testing is hard • Testing

    takes time • Testing is expensive • We don’t know how
  7. 8.

    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
  8. 12.

    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