DEV Community

adalycoder
adalycoder

Posted on • Updated on

COST SAVINGS THROUGH UNIT TESTING (Article for Beginners)

Recently we worked with a client that was interested in creating an instant messaging app. They wanted this application to be usable across the major mobile platforms (Android, Apple, and Microsoft). Using unit testing we created this application quickly and cost effectively. Implementing unit testing on projects is an excellent way to help a project budget.

What is unit testing?

Unit testing is the programming process to validate the correctness of the individual modules of the program source code. The idea is to write tests for each non-trivial function or method. This allows you to quickly check to see whether the resulting change in the next code to the regression – that is to errors in the field – is of tested programs. This facilitates the detection and elimination of such errors.

In practical experience, when applied to a variety of projects, it is safe to say that for every 1 hour spent creating a unit test, 100 hours of manual testing time are saved. This process helps to keep software working during the agile development process and for every milestone thereafter. There is no new technology being built; it is simply optimizing the methods that already exist.

Many developers do not like to use unit tests because they feel that they have coded perfectly – however the fact is, humans do make errors. By using unit testing, errors are easily caught. Human interaction is still necessary to make sure things are running smoothly and for a second look – in other words, for oversight. But unit testing saves a very large chunk of time.

What happens when there is a bug in a released application?

Every kind of methodology will produce some kind of mistake in the software, but when a unit test has been created we can detect this mistake by simply clicking the unit. In five minutes the results of the testing will be available. The developer almost immediately knows what function doesn’t work, how to fix it, and how to save time in an update. This is very important when working with mobile applications. The longer it takes to fix and respond to a bug in an application, the fewer people will be purchasing and using the application.

Unit testing can take more time on the front end – however the time and cost savings over time make this methodology very desirable.

Top comments (0)