Struggling With Testing?

We all know that we need to test our code since we don’t have a compiler in Ruby world. The issue that I come across is NOT how to write the tests, but what to test and how it should be approached. If you think about it, we have plenty of resources on the syntax and the mechanism of testing frameworks, but it ultimately comes down to what your testing strategy is, if there’s any.

I for one, do not subscribe to “test everything” bullshit some Rubyists are pushing. I get annoyed whenever I see tests that do not have any value whatsoever and are completely redundant. I know this will raise uproar but it’s true. When you see it, you’ll know what I’m talking about.

My tip if you’re struggling with testing is to read OPC. With the GitHub, all you have to do is point your browser to test/spec directory in any project. You’ll see both good, bad, and ugly. Form your own strategy based on your exposure, and remember, this is NOT religion! The ultimate goal of this whole thing is to write quality code. As I said before, all is not lost by looking at bad codes.

Hope this helps.

Comments

Comments are closed.

Powered by Olark