Upgrade to Pro — share decks privately, control downloads, hide ads and more …

tdd workshop

tdd workshop

A workshop on test-driven development presented during Tryst 2013, an annual science and technology festival at IIT Delhi.

Avinash Chugh

March 02, 2013
Tweet

More Decks by Avinash Chugh

Other Decks in Programming

Transcript

  1. At the end of this workshop... Build production quality software

    Experience unit testing Appreciate good design principles Gain insights Taking it further
  2. “One broken window, left unrepaired for any substantial length of

    time, instills in the inhabitants of the building a sense of abandonment – a sense that the powers that be don’t care about the building. So another window gets broken. People start littering. Graffiti appears. Serious structural damage begins. In a relatively short space of time, the building becomes damaged beyond the owner’s desire to fix it, and the sense of abandonment becomes reality.” The Pragmatic Programmer
  3. A software development technique in which automated tests are written

    iteratively alongside the production code TDD
  4. A software development technique in which automated tests are written

    iteratively alongside the production code TDD
  5. A software development technique in which automated tests are written

    iteratively alongside the production code TDD
  6. A software development technique in which automated tests are written

    iteratively alongside the production code TDD
  7. “But one should not first make the program and then

    prove its correctness, because then the requirement of providing the proof would only increase the poor programmer's burden. On the contrary: the programmer should let correctness proof and program grow hand in hand.” The Humble Programmer, Edsger W. Dijkstra 1972
  8. No excuses Avoid “we’re too busy” Defer “let QA test

    the software” Deny “we don’t have bugs” Play dumb “we don’t know how”
  9. Three simple rules You can’t write any more of unit

    test that is sufficient to fail, and not compiling is failing. Rule 2
  10. Three simple rules You can’t write any more production code

    than is sufficient to pass one failing unit test. Rule 3
  11. TDD doesn't drive good design. TDD gives you immediate feedback

    about what is likely to be bad design. -Kent Beck
  12. “Brakes allow you to travel faster because you have the

    power to stop.” So why do cars have brakes?