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

PyConZA 2012: "TDD in Python" by Charles Haynes and Rachel Laycock

Pycon ZA
October 05, 2012

PyConZA 2012: "TDD in Python" by Charles Haynes and Rachel Laycock

Do you think TDD just improves the quality of your code? We'll show you how TDD also improves the quality of your design, makes your code more manageable, readable, reusable and cures hangovers. OK maybe the last one isn't true but we know from experience that the rest are.

In this tutorial, we will focus on a practical introduction on how to do Test Driven Design in Python with a real world example, on real code, in real time, with your participation. We'll cover the Red, Green, Refactor practice, committing frequently, what a unit test is and is not, and how to use mocks to write good, isolated and fast unit tests. We will also cover patterns for keeping your code clean, well-designed and reusable, and give you the courage to refactor fearlessly and mercilessly!

We will demonstrate and describe some of the specific scaffolding you can use to make all of the above as easy as pie. We'll also show you some of the super cool stuff that only Python can do! Or at least is trivial in Python compared to lesser* languages.

*such as Java and C#

Pycon ZA

October 05, 2012
Tweet

More Decks by Pycon ZA

Other Decks in Programming

Transcript

  1. TDD in python Or WHy TDD is awesome, python is

    awesome and tdd in python is awesome sauce! Friday, October 12, 2012
  2. Acceptance criteria: Given a collection of files I want a

    collection with no Friday, October 12, 2012
  3. Acceptance criteria: Given a collection of files I want to

    remove the duplicates Friday, October 12, 2012
  4. It’s OK to Mock And in Python it’s easy as

    pie Friday, October 12, 2012
  5. Resources: Mock aren’t stubs: http://martinfowler.com/articles/mocksArentStubs.html Code retreat: http://coderetreat.org/ SOLID principles:

    http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Rachel github: https://github.com/caek Charles github: https://github.com/charles-haynes Working with Legacy Code: Friday, October 12, 2012