Laptops

Your Code Should Be Tested

Tested code can prevent major losses of money and time, it's well worth the initial effort.

Jul 30, 2019

In the early days of web development code tests were not a thing in most cases, certainly not for websites. Websites were just plain text files which were hosted on servers. Testing code started becoming a thing when many websites starting using server code (PHP, Python, Ruby) and databases (MySQL, Postgres). This transition came with it a higher probability of deploying code bugs. The more moving parts the higher the chances that something will break. Eventually, and it took a while code tests became a generally accepted and encouraged part of writing code.

Inevitably this led to Test Driven Development which was - for a while - the talk of the town in the general development community. It’s a manner of writing code so that you actually write tests first then write the code that will actually do the feature you need after. Though in many cases this is now a common practice there are numerous web applications out there which have no tests at all. Which means each time a change is made to the code or a dependency is updated there is a chance for some bugs to be deployed which can cause downtime or even worse.

Code should have at least some level of testing on it, however, this does in turn increase delivery time of nearly any code change or addition which scares some clients. What should be far scarier to a client is deploying code which could contain bugs related to shipping information or product sales. Recuperating from those damages will be far more time consuming and costly. It’s far less complex and more efficient to have tests be written for your code which can prevent many of those error types.

Given that software is a constantly changing industry and the underlying technologies of most computers change daily, by adding tests to your code base you’re preventing these underlying changes from breaking your website. This can lead to a faster long term maintenance and less overall stress. We provide a full review of our clients existing software to let them know just how much if any of their code has tests. If it’s very little we strongly encourage them to have us begin with writing basic tests before we do any new feature additions. If you’re in need of having your code reviewed, contact us!

By: Matt Lantz