Apr 09
Evaluating Frameworks
When working in a community that is constantly changing with new features coming out every week, there are a lot of different plugins, mini-frameowrks, and other packages that are worth using in your projects. One can spend more time researching new tools to use than doing actual work. One always hopes the time spent finding tools and frameworks to make development faster will make up for the time lost from not developing.
My latest research involved the testing frameworks for Rails. Although there are plenty of them out there, I focused on RSpec and Shoulda. Besides Test::Unit, they are the two biggest players in the Rails testing world. I could have spent weeks trying to figure out which best fit my needs, but I enforced some time-boxing on myself and refused to spend more than four hours on this. With so few hours to determine which framework is for me, I really focused on the parts that are most important to me. Within those few hours, I finally decided on Shoulda. RSpec may or may not have more momentum behind it, but Shoulda fits the way I think and is (hopefully) the best solution right now.
When evaluating frameworks or plugins for yourself, always remember to time-box. Choosing the right one is certainly important, but spending the right amount of time choosing is just as important. You have to have time before you can start saving it.
April 14th, 2009 at 10:47 am
One thing I’ve been pondering lately is testing of the framework itself. I love that Rails/Grails/etc does a lot of the work for me, but when I think of testing, I realize I place a lot of faith in the framework/language itself. Do you see any value in frameworks coming with built-in tests on itself?
April 14th, 2009 at 11:28 am
Rails, and I assume Grails, comes with a huge test suite on itself. Check out http://github.com/rails/rails/tree/master and look inside the folders and you’ll find a “test” directory that is filled with tests. In fact, when contributing code to Rails, the core team will not accept your changes unless it comes with a testcase(s) proving your changes work.
April 15th, 2009 at 1:43 am
Grails does have unit and integration testing built in. Whenever you create a new class, Grails automatically generates the test files (unit and integration) associated with the file. Functional testing is handled by plugins, thankfully.
The framework having tests on itself would be great for less-mature frameworks. There are portions of Grails that I would like to change, and an built-in test suite would ensure that I do not break other parts of the framework when making modifications.