Archive for the ‘Writing Reliable, Bug-Free Code’ Category

It happens to the best of us

Posted by Rahoul Baruah on October 5th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , , , ,  •  Comments Off

We just had some customers report a bug. Not good. We didn’t get an exception email. All the tests passed. We couldn’t see anything untoward in the log files. But it was there. We could reproduce it, both in staging and in production. Not good at all.
But the weirdest thing was we couldn’t [...]

Using Cucumber to estimate a project

Posted by Rahoul Baruah on May 15th, 2009 under Designing Great Software, Managing Successful Projects, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , ,  •  Comments Off

Writing estimates up-front is a really tricky part of client work.
From the customer’s point of view it’s pretty essential. You need to know how much you are spending before the work begins so you don’t get stung.
From the developer’s point of view it’s pretty difficult to do because [...]

Switching off transactions for a single spec when using RSpec

Posted by Rahoul Baruah on May 8th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , ,  •  Comments Off

I have just written a load of test code that needed to verify that a particular set of classes behaved correctly when a transaction was rolled back.
However, the rest of my suite relied on transactional fixtures (which is Rails’ badly named way of saying that a transaction is started before each test and [...]

Fixing bugs in untested code

Posted by Rahoul Baruah on May 6th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , ,  •  Comments Off

When you’ve got an application that has little or no test coverage it can be quite daunting making changes. What if you alter X and it breaks Y? Without running through the entire app by hand how will you know what you’ve broken?
Well you won’t.
Even worse, what if your [...]

Bug of the day: cookie not being saved? Check your host-name.

Posted by Rahoul Baruah on April 27th, 2009 under General, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , ,  •  Comments Off

Lesson learnt today.
Apparently, underscores are not part of the standard for a host name. However, your browser (and DNS server and all the links in between) will accept underscores in the host name.
But, when you have Safari set to “only accept cookies for sites that I visit” the underscore in [...]

Quick Tip: make it easier to debug your full-stack acceptance tests

Posted by Rahoul Baruah on March 24th, 2009 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , , , , ,  •  1 Comment

ne of the issues when using Selenium or Watir to power your full-stack acceptance testing (apart from the time it takes for the test suite to run), is that stuff happens within your browser, fails and then Cucumber happily moves on to the next test before you get a chance to look at what went [...]

Cucumber and WATIR: kick-starting your testing

Posted by Rahoul Baruah on January 16th, 2009 under Designing Great Software, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , ,  •  Comments Off

I think Cucumber is fast becoming indispensable for my testing. The point of it is that you can write documentation that your client understands and then prove that the application does what it says. When coupled with WATIR you can show that it really works in an actual browser – you can even [...]

Writing tests for your controllers improves the design of your models

Posted by Rahoul Baruah on December 20th, 2008 under Designing Great Software, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , ,  •  Comments Off

I’ve recently been updating some old code – partly written by someone else, partly written by myself. At the time, I thought I had written this code really well; looking back on it now, it looks awful. Fair enough, I’ve learnt a lot – I want to look back on old code and [...]

Coping with the VAT Change

Posted by Rahoul Baruah on November 25th, 2008 under Designing Great Software, General, Writing Reliable, Bug-Free Code Tags: ,  •  1 Comment

There seems to be a lot of wailing and gnashing of teeth about the upcoming VAT change. Especially as it is only a 13 month change and the rate will revert to 17.5% in 2010.
However, it ought to be really simple (although I realise that this may be a bit late for [...]

Acceptance Testing in Ruby, Rails, RSpec and Cucumber

Posted by Rahoul Baruah on November 21st, 2008 under Beautiful Code, Designing Great Software, Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code Tags: , , , , ,  •  Comments Off

I’ve written up a new post at the Brightbox blog detailing how we are using RSpec and Cucumber to build acceptance tests for the next generation Brightbox systems.