Task T: Testing
Posted by tom March 12th, 2006
As I went through the book “Agile Web Development with Rails” I now reached chapter 12, which is on testing. Upto chapter 12 we (the author and I :) ) have been adding code to our Depot application, but chapter 12 is not like that. It’s a chapter on testing! In my normal day work, we do testing, but it is nothing like this! Rails has it’s testing split up in unit testing and functional testing.
While at first unit testing may start a little slow, loading a record from the database and checking whether it does that correctly, it’s actually great fun to see it working! This will really ensure a working application!
When you’re reading this chapter you might want to take a look at: Mike Clark’s Weblog concerning testing.
Even more fun are the functional tests (or what Rails calls functional tests), for example testing whether somebody can reach administration pages without an username/password. Or testing whether somebody trying to login with an invalid username/password combination can actually login. Ofcourse you can test this yourself, by using your browser and your mouse, but it will take time. With Test::Unit (part of Ruby and therefor part of Rails) you test all this faster than you can ask: “Where’s my mouse?”.

Leave a Reply