At Portland Perl Mongers, we've had chromatic give talks about tests and Schwern rant about tests. Since many people still aren't testing, I had an interesting idea, but now I have to put my money where my mouth is.
In October, I'll bring my laptop and have no presentation whatsover. Instead, I'll take an idea for a module from the assembled mongers (I'll have a backup idea or two if the ideas are not practical) and I'll sit down and create the module, in front of them, using test-driven development. Further, it's going to be mathematically challenged pair programming as I'll invite everyone to kibitz, er, pair, and we'll build a module together with me explaining things as we go. What an /aw(?:some|ful)/ idea. This could turn into a fiasco.
Re:Doing tests...
Ovid on 2004-08-14T01:00:14
Interestingly, I was at Powell's Technical Bookstore the other day and I noticed that not only was "Perl Medic" the best selling Perl book, it was also one of their top selling books over all. Amusingly, their top Java book's subject was about how to avoid bloat in Java programming.
Re:Doing tests...
chromatic on 2004-08-14T16:38:07
Hm, was that second book also Perl Medic?
Re:Doing tests...
Adrian on 2004-08-14T10:25:04
love the idea about tests. However, I am not doing anything (that I believe) warrants that level of testing.Then you need to go see Ovid's talk! The point about TDD is the fact that it helps you drive your code's design, getting a good test suite out of it is just a pleasant side effect
:-)
I've done it a couple of times when running tutorials for some companies.
Random advice:Have fun!
Re:Go for it. Live TDD demos are good!
jplindstrom on 2004-08-14T12:12:05
Great advice!
Have you found any "assignments" be more successful and pedagogic than others? Anything to avoid?Re:Go for it. Live TDD demos are good!
Adrian on 2004-08-14T15:01:55
Have you found any "assignments" be more successful and pedagogic than others? Anything to avoid?I guess pick something that you can get up and running quickly, but can expand easily if you have time. I found that it can be quite a shock how much slower TDD is when you have to explain as you go.
Some of the things I've used:
- The classic "money in multiple currencies" example from the Beck book. You can go from simple math with a single currency, to dealing with transactions over time with multiple exchange rates (not that I ever got that far.)
- Scoring of games. I use snooker as my example being in the UK. Use whatever you're more familiar with. Start with correct scoring of an existing game. Move to detecting illegal games. Generalise to cope with similar games... and so on...
Re:Go for it. Live TDD demos are good!
brian_d_foy on 2004-08-15T00:56:52
Good advice:)
I did this sort of thing for Perl University (O'Reilly's travelling road show that they only did for a year). It was a big hit.
I had a constraint though: I had in mind a handful of problems, and they audience could pick one of them. That way I didn't get stuck on something I couldn't work my way out of.
I've done the "build a module from scratch" to demonstrate the parts that go into it. Module::Starter basically started from there.