Another thing to come out of my weekend at Flash Camp was the overwhelming feeling that I need to get some old theories into good practice. Over the years we’ve been able to implement a sort of MVC framework into our programming. As we’re always willing to innovate, we have to continue shaping what once was a completely ad-hoc programming department into an insanely organized department that runs like a well oiled machine. That also means that as a lot of larger departments will tell you, there needs to be a way for everyone working on the project to understand the project as a whole. Usually what happens at DDA is everyone sort of works on their own little piece of the project and then we all mash it into the big picture project at the end. In the mean time, occasionally things happen that cross lines and step on toes.
The first step in this process is what I think may be the most important, unit testing. Unit testing is the means by which we can take a small piece of code (unit) and test to make sure the results are consistent. Sometimes it should throw errors (divide by zero) and most of the time it should return some sort of value that can be tested. What this can do is set up tests ahead of time so that as multiple people (or even one person) can work on a project and as changes are made, the tests can be run to insure that any changes don’t effect another part of the system. Its main goal is to find problems early on, rather than in the later functional testing phase. Smaller goals are things such as documentation and proper design. A unit test can show a programmer exactly what the function is supposed to do, leaving no mystery. It’s like self design and documentation. It will also dig deep into the hierarchy of functions and classes and can determine with better results where the code is failing.
Like all processes, unit testing is only as good as the people writing the tests. We can’t always think of all the ways something may fail, nor can we always have the best mock data. It is also a lot of work to write the tests. In the end though, our goal as a company is to provide the best product possible. If our interactive websites could be tested in more than one way, isn’t that the best thing for our clients? Of course it is.