Archive for the ‘Writing Reliable, Bug-Free Code’ Category
Posted by Rahoul Baruah on November 14th, 2007 under Writing Reliable, Bug-Free Code •
No Comments
http://parlezuml.com/blog/?postid=517
People who practice test-driven development are doing design. It’s important - actually, it’s critical - to understand that. If you fall into the trap of thinking that TDD is about unit testing, then you’ll probably miss the point.
Too many teams believe they’re doing TDD, but are actually just writing unit tests for code they’ve already [...]
Posted by Rahoul Baruah on November 9th, 2007 under Beautiful Code, Designing Great Software, Writing Reliable, Bug-Free Code •
No Comments
rake db:fixtures:load is probably one of the most useful commands I have used recently.
You see, I was meeting some people about some potential work. They wanted to see an example - preferably related to payment systems. I had some code but unfortunately, the service that is part of had been switched [...]
Posted by Rahoul Baruah on October 3rd, 2007 under Designing Great Software, Writing Reliable, Bug-Free Code •
No Comments
I’m just thinking out loud here - based on stuff I’ve done well in the past. But this is no rigorous scientific method - just a set of notes for me to refer back to.
* Write a couple of paragraphs describing the application. Note down keywords (especially important nouns and verbs) [...]
Posted by Rahoul Baruah on September 22nd, 2007 under Beautiful Code, Writing Reliable, Bug-Free Code •
1 Comment
I really like Test-Driven Development. Think about what you need to write, write a test (that fails), then make it pass. Repeat. Refactor.
Obviously, the major benefit is that further down the line you can be sure that what you are writing today won’t break what you (or someone else) wrote [...]
Posted by Rahoul Baruah on September 2nd, 2007 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code •
1 Comment
Ruby on Rails won’t make you a better coder. Ruby on Rails won’t deliver a bug-free project. Ruby on Rails won’t ship your release on time. Ruby on Rails is not a silver bullet.
I love Ruby on Rails.
I can work faster, more reliably, using “cool” technologies like Unix and Macs [...]
Posted by Rahoul Baruah on April 24th, 2007 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code •
No Comments
Jason Garber has updated his excellent form_test_helper plug in to support XmlHttpRequests.
Rather than the clumsy code I showed before you can now test your Ajax form with a simple and elegant:
# test in non AJAX modethingy = Thingy.find 1get :edit, :id => thingy.idassert_response :success
submit_form do | form | form['thingy[field]‘] = ‘wotsit’endassert_redirected_to [...]
Posted by Rahoul Baruah on April 16th, 2007 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code •
1 Comment
I have been using Jason Garber’s form_test_helper plugin. Basically, if you’ve ever had it where you rename a parameter in a form - change your test accordingly (post :action, :id => 1, :name => ‘George’ becoming post :action, :id => 1, :first_name => ‘George’) and forget to update your view, form_test_helper is for you. [...]
Posted by Rahoul Baruah on March 15th, 2007 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code •
No Comments
I’m just adding a new class to my application and it needs a pre-populated list of entries - standing data that will always need to be there. This is pretty easy to set up using migrations and a bit of ERb - and it even works in your test fixtures.
Firstly, create a new migration [...]
Posted by Rahoul Baruah on January 18th, 2007 under Ruby on Rails and Software Development, Writing Reliable, Bug-Free Code •
1 Comment
I recently ran into some problems when upgrading an application from Rails 1.1 to Rails 1.2. RJS tests (using ARTS) that previously worked fine suddenly started failing (cannot find X in response, when I could see X in the response, right in front of me).
I dived into the ARTS code and came to the [...]