Tuesday, March 9, 2010

Conversation with Gary Bernhardt

Gary Bernhardt has a unique perspective, having spent significant time in both python and ruby development, as well as taking part in both communities. He spends a lot of time talking and writing about testing and design and their intersection on his blog, Extra Cheese.

Gary did an incredible refactoring screecast, as well as his much-talked-about presentation at Northwest Python Day, called Python vs Ruby: A Battle to the Death.

Gary organized the Seattle stop on my coderetreat tour 2010, and I made sure to get a chance to sit down and record a conversation with him. In this video, we meander a little bit, but focus primarily on some of the differences between the ruby and python communities, especially as it relates to testing habits and ideas.

Enjoy! And please leave comments if you are so inclined. Blog post reactions on your own blog are also highly encouraged.

Gary Bernhardt from Corey Haines on Vimeo.

3 comments:

  1. Gary obviously has never been to a PyCon before. We have entire talk tracks dedicated to testing and TDD. No mention of scotch or twill? Yes the testing culture in python is behind Ruby, but no where near as bad as he makes it sound! At PyCon every attendee can carry on a conversation about TDD. The testing talks are our most popular, and the testing BoF session is the largest at the conference (more than 10% of the attendees showing up for an after hours free form discussion on testing!)

    PyCon 2010:

    rapid multi-purpose testing
    http://us.pycon.org/2010/conference/schedule/event/127/

    Introduction to unittest (a.k.a. PyUnit)
    http://us.pycon.org/2010/conference/schedule/event/133/

    Why not run all your tests all the time? A study of continuous integration systems.
    http://us.pycon.org/2010/conference/schedule/event/109/

    The other kind of testing
    http://us.pycon.org/2010/conference/schedule/event/80/

    Tests and Testability
    http://us.pycon.org/2010/conference/schedule/event/114/

    PyCon 2009:

    Functional Testing of Desktop Applications
    http://us.pycon.org/2009/conference/schedule/event/34/

    Coverage testing, the good and the bad.
    http://us.pycon.org/2009/conference/schedule/event/26/

    Using Windmill
    http://us.pycon.org/2009/conference/schedule/event/9/

    Panel: Functional Testing Tools in Python
    http://us.pycon.org/2009/conference/schedule/event/88/

    All I really need to know about [testable, maintainable, packagable] "scripts" ....
    http://us.pycon.org/2009/conference/schedule/event/61/

    Strategies For Testing Ajax Web Applications
    http://us.pycon.org/2009/conference/schedule/event/18/

    Building a Simple Configuration-driven Web Testing Framework With Twill
    http://us.pycon.org/2009/conference/schedule/event/13/

    Building tests for large, untested codebases
    http://us.pycon.org/2009/conference/schedule/event/30/


    PyCon 2008 (no video or slides for these):

    Using Optparse, Subprocess, and Doctest To Make Agile Unix Utilities

    Getting started with test-driven development.

    nose: testing for the lazy coder

    Introducing Agile Testing Techniques to the OLPC Project

    py.test: towards interactive, distributed and rapid testing

    Managing Complexity (and testing)

    Developing, Testing, and Debugging Python Applications

    I can go on all the way back to 2004. We average 10% of our talks being just on testing. No, the testing culture in Python is no where neaqr what it is in Ruby, but it is not the wasteland that Gary is describing.

    ReplyDelete
  2. Doug,

    Like I said in the interview, yes, both cultures value testing. But in Python, everyone seems to just talk about "tests", whereas in Ruby it's more common to find a finer distinction of what "unit test" means, what "acceptance test" means, what "system test" means, etc. Most of the benefit that I get from tests (probably 90% or more) comes from these distinctions, and from having an isolated unit test suite that runs in at most a couple of seconds.

    I'm glad that the Python world is talking more and more about testing. It's my language and community of choice, after all! However, I disagree completely with your claim that "At PyCon every attendee can carry on a conversation about TDD." TDD is not just writing tests, and it's not just writing tests first. To be test driven *design*, it has to be a tight loop with very small changes, constant refactoring, and the tests forcing the design changes. Driving design at all levels means you have to start talking about isolation, and no one is talking about isolation in Python. I don't think I've ever talked to another Pythonista who was doing isolated unit tests! (I've talked to plenty of Rubyists who were, despite being in the Python world for six years and only peripherally involved in the Ruby world for one year.)

    With all that said, I didn't mean to characterize testing in Python as a "wasteland". There is a lot of great work being done, and we're making progress (both of which are obvious to anyone who follows the TiP list), but I think we're doing it slower than the Ruby world, and that makes me sad. Anyway, if you were being hyperbolic, that's cool, but if I really came across as that negative then I apologize. :)

    I've been to PyCon for the last four years, by the way. :) I was also at both of the PyCon TiP BOFs that have happened (2009 and 2010); gave talks at both of those BOFs (Dingus and unit test isolation, respectively); ran the Cleveland Python user group for over a year; and have spoken at multiple regional Python conferences. Please don't mistake me for an outsider; the Ruby guys are the only ones who can make that accusation of me. ;)

    ReplyDelete
  3. I'm wondering what is it that causes this difference between the communities and their outlook on testing. Given that both languages are the leading dynamic languages, why do rubyists (is that a word?) find TDD much more natural than pythonistas?

    ReplyDelete

Please don't post anonymously; I won't use your name/url for anything insidious.
Comments by Anonymous are not guaranteed to make it through moderation.
Constructive comments are always appreciated.