Wednesday, July 9, 2008

Test Driven Development: A Short Story

Last Sunday, I scheduled myself to prepare for my next training assignment which is mostly related to Test Driven Development (TDD) and Unit Testing. I know how to do it but teaching it and making the participants appreciate TDD is a whole different thing for me. After browsing through the slides for the nth time, nothing came to me as to how I would attack this topic. Thankfully, Franz is at the office as well. He gave me something to read from The Craftsman. Its just a short story but gave a clear approach on how to teach TDD.


Come Tuesday that week, I was so excited to try out the approach I've learned in the story. I started by explaining the development approach that we will be learning for that day. I asked one student to be the typist and reminded that everybody is expected to share their thoughts on the application.


We used the same problem used in The Craftsman, they are to get the prime factors of a certain number. So we started writing their very first test. The test scenario is called testTwo which checks if the length of the array is correct and the value of the array is indeed 2. Of course their test failed after running it, so I asked them to write the simplest code that would pass the test. After writing down their solution, I was surprised it’s the same solution in the story that I was simulating. So I just continued by asking them to write the next test which would get the prime factors of 3. At this point, they're already making fun of me by saying "Oh we'll be testing the whole day, we'll be writing test for 2-1000!" What made me freak out is that their reactions and solutions are very similar to the story. The main deviation would be the additional/minor information I added during the process such as best practices in testing and seeing it LIVE! I never thought that the story predicted the events in such accurate points.


At the end of the exercise, the participants have completed the events in the story. They enjoyed the interactions that they had during the exercise and were really happy with what they just learned, AND that System.out.println() is not the only testing tool around.

Tuesday, March 4, 2008

Trying out Google Sites

I've been playing with Google Sites lately and found it easy to set-up and customize. It is quite similar with the collaboration tools that we use at Orange and Bronze. Some thoughts...
  • Subscribing to the site/pages in the site. What's great about this is you get notified by the changes that is happening to your project. I'm not sure if the one we are using could be tweaked to do this.
  • Customized issue tracker. Yes, they do have this. You could easily add, delete and modify components of the issue tracker that you want. You can even add a deadline field which allows you to attach a date to a certain issue. However, you don't have the grouping of issues to milestone deadlines. Human error in giving a deadline past its milestone deadline is quite high. You also can't get reports as to how much of the issues in a particular milestone has been successfully resolved.
  • Include Google Docs in your site. I liked this feature purely because of my documentation quirks. Since collaborators can edit the same document simultaneously, the changes are reflected in your site. You could also collaborate spreadsheets! Aside from that, you wouldn't have the problem of transferring tables from the wiki to a .doc file. I've tried this before and it was hell. I believe our PM/BA dept. will benefit from this feature.
  • Uploaded docs are version controlled. Documents uploaded to the site are versioned automatically. What I didn't like is I can't download and upload multiple files. I was looking for a "Download all attachments" function, the one just like in Gmail, but I found none.
  • Remind your team with the countdown feature. With these feature, it is easy to remind your teammates about an approaching deadline! What's just sad about this is even if the deadline has passed, the countdown is still there (just with a 0 days left notice).
  • Announce what you want. The announcement page is similar to a collaboration of blogs. You don't need to go anywhere to share what you've done or learned with the project.
These are some of the features that I have checked out. I believe Sites is a good option for online document collaboration. Another colleague of mine have tried this out and wrote down his insights as well, do check it out. :)