Missing tests - getting everything tested

Unit tests are not often the first thing on someone’s mind when it comes to coding, unless you are in the small group of developers that have become accustomed to writing tests before writing any code. Thanks to the current project I'm busy with I have joined this group.

Due to a few (lame) reasons, unit testing has never been a high priority on Infinitas. In all the wisdom of hindsight unit testing makes writing code quicker. With a majority of time saved trying to find out why something is not working that used to work or going back to tweak some code because it does not work properly in situation X.

One of the goals for a stable release of Infintias has always been loads of unit tests. It's been discussed since the start that 0.9b would be dedicated to mostly testing with a feature lock on anything new that does not have a ticket. Basically just bug fixes, unit tests and making it shine.

Anyone that has been watching the repository on GitHub would have noticed that the last tagged branch is 0.8a. This will be followed shortly by 0.9a. The aim of the current branch is to finish up the missing bits and pieces that are known/marked on the Lighthouse account. This will also include a bunch of testing (hopefully).

In order to make sure everything is as painless as possible, I have coded up some shell scripts to automate things. One of them being a simple shell to show any missing tests. It looks something like the following:

All it does is find all the files in the application, and then cross references that with all the tests in the system. It then outputs the list nicely so you have a quick overview of your apps tests. There are a few params you can pass to change the output such as "-plugins comma,separated,list" of plug-ins to show tests for only the passed plug-ins. I have some ideas for later doing a more advanced check on things like code coverage etc. I'll save that for another post.

If you would like to see the code, you can do so on the Infinitas repo.


No more posts