Automated Software Testing - Why is it important and how should I approach it?
Why is it important to use automated tests to validate your code, and ensure that it stays at the highest quality during its lifetime?
For an Audio Summary, click the Play button below:
Automated Testing techniques have been around for as long as people have written Software. Very early on in the Software Industry, as more and more code was written and the lifecycle of software extended beyond multiple releases, it became evident that Software Engineers had to protect the existing functionality, while building new features. This requirement to protect code against bugs, that may get introduced as a side effect of the evolution of the code base, is what led to a huge amount of innovation in the Automated Testing space of Software.
When I started on the Project Team as an intern back in 2005, the dominant project management methodology across Microsoft was still the traditional Waterfall Model. Software releases typically spanned multiple years, and in the case of Microsoft Office it would generally be about every 3 years, that a new version of Office would be released to the world. Behind the scenes, during those three long years, Software Engineers would make massive changes to the existing code base that had shipped with the previous version. With the dominance of Microsoft Office, and the wide adoption among customers, it was crucial to not break existing features that were released in the prior version.
When thinking about Automated Testing, there are several techniques that you can apply to validate your software. The most basic form of automated testing, that is applicable to most software projects, is “Functional Testing”.
One of the most common forms of Functional Testing is “Unit Tests”. Unit Tests generally refer to the type of automated tests that are written right alongside the Software that is being tested. The primary aim of Unit Tests is to validate the implementation details of the classes and methods written for a feature. With Unit Tests you can instantiate internal classes and call methods within them, just as you would while writing your code.
In addition to validating the inner details of the methods and classes within your code, it is also important to validate the external user facing features that the code implements. This is where the technique of “Integration Tests” comes in. With integration tests, you can validate the end-to-end customer scenarios that are implemented by your feature. The usual way you implement Integration Tests is by exposing software hooks that can be called externally from a different application to mimic customer interactions in an automated environment.
Tip #1: Any Software you write must be accompanied by Automated Functional Tests, that validate the Business Requirements implemented by the Software. It is important to test the inner workings of your code with Unit Tests and test the end-to-end user flows with Integration Tests.
Keep reading with a 7-day free trial
Subscribe to Servant Leader to keep reading this post and get 7 days of free access to the full post archives.