Test-driven goodness

Posted by unbrand on 9 January 2006 | 0 Comments

Tags: Rails, PostgreSQL, learning

In migrating an old app I have from Java to Rails I decided to fully dive in to the Rails Way. As part of that I’m doing Test Driven Development and writing test cases before I write code. A side effect of this which is really good (if slightly embarrassing) is that because of the way Rails wants to work and my CRUD tests, I’m shining a spotlight on my piss-poor database design from a few years ago.

So, after swallowing hard, I decided to refactor the database design. As it turns out, it was a lot less painful than I had imagined. And in the end, I have a nice, clean database model that plays nice with Rails and can be tested very easily with Rails’ fixtures and unit tests.

Nice. And by “nice” I mean “Christ, it’s so easy to code these really cool tests that will shrink the dark cloud of regression testing that hangs over my head because I don’t do them as much as I should but now it’s easy to do what I know will give me less pain when I add whacked-out features that by all rights should reduce my whole code base into a quivering puddle of goo.”

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page