Sunday, March 27, 2011

A Few Google Tech Talks

I was browsing recently and I noticed a couple of new Google Tech Talks.

First, Miško Hevery's talk "How to Write Clean, Testable Code", given at Google NYC. Another presentation of it (with slides) appears to be up at his blog.

Here are a few things from the talk and Q&A session afterward that I found interesting:

0) Miško says something like "people think it's cool when I'm giving a demo and I press the save short cut and the tests run; but getting the setup right can take hours". You want to make it look like magic. You want to make it look easy, even though it often may not be easy to get to that point. This is where the discipline comes in. You'll also notice that this key binding to save and run tests is the same thing that Gary Bernhardt does in a recent Destroy All Software screencast. That's a great technique that I'd like to get working soon in my development setup.

1) Miško suggests getting started in open source. No schedule pressures and the worst they can do is reject your patch.

2) During the Q&A part, a nice guy with a British accent mentioned how he got started. Specifically he talked about how almost every developer has the experience of testing a program out by writing a "print" statement in the code and then executing it and checking the output value. This guy's mindset was to write automated tests instead, and I thought that was an interesting insight. Granted, print statements are still a fast way to get an idea of when and how often a piece of code is executing while running the complete program, which can be useful when learning a new code base.

3) Another guy said he was starting a brief project in Python using Django and asked if anyone had any advice about how to get started unit testing. Unfortunately no one gave any good suggestions or comments to that guy.

Here are some older talks by Miško that are also great, in case you missed them:

Another interesting talk I watched was Tools for Continuous Integration at Google, which was presented prior to the Google Test Automation Conference 2010. This talk was about Google's distributed build system and the lengths they've gone to to make builds fast. This ties into my previous post about the importance of tools.