Today I had some time over and decided to work on my RSS Feed Reader extension for Chrome (I do think it needs a new name, don’t you? Or maybe it’s too late for that?). Certain things have been on the drawing board for a long time now: scrollbars, notifications, design issues, etc. I decided I’d write some tests instead.
Why? Because testing is awesome
One thing that always has left me with a bad-gut-feeling is pushing new releases to the public. This kind of extension should be able handle anything out there. How many poorly written RSS feeds aren’t there? And just how many different formats and interpretations of those format’s are out there? My guess is many. It’s hard to test all those different formats myself, especially whenI only subscribe to about 10 myself! So changing the parsing code is a big leap of faith for my soon-to-be 10 000 strong userbase.
In come the tests. They are designed to be run before each release as a sanity check that the code I’m shipping is bug-free. Or at least that it hasn’t introduced any new bugs in old previously working code. Sweet heaven. Can you imagine that? Running a command that assures you that it will work and that you can sleep worry free. It’s an enticing thought.
Writing tests is boring
The benefits with tests are many. The problem however that writing tests is tedious work. Instead of implementing cool features you write code to test what in your mind already is perfect. So choosing the right test framework is important. For RSS Feed Reader I’ve decided to use QUnit in a Node.js environment. Installing and everything is dead simple thanks to uptodate instructions and the Node Package Manager (NPM). The hard part is acquiring a large enough database of feeds to be relevant. Luckily developers before me have tackled this problem. A quick Google turned up this git repository of links to feeds – called Popular Feeds.
So now I’m going to scrape those to my harddrive and start writing the test code for all this. It won’t be as difficult and comprehensive as tests I’ve written for other projects. All I’m testing now is the parsing engine, so just attempting to parse all the feeds and checking that it doesn’t throw any exceptions should be fine. It might also prove to be a nice opportunity to optimize the process!
Wish me luck.