Web Development

Unit/Automated Testing

June 20, 2017

Software testing is the process of discerning whether a product is acceptable to its end users, its target audience, its purchasers, and the stakeholders to whom it belongs.

At its core, software testing examines code and its execution: does the code do what it is supposed to do, when it is supposed to do it, and how it is supposed to do it?

We recommend that tests like Unit Testing (or Automated Testing), are conducted for more advanced applications. This testing type can be broken down into three types:

Level 1

The smallest testable parts of an application (units) are individually and independently analyzed for proper operation. Each unit is isolated from the primary program or interface. Automated tests run quickly, are cost effective, and allow for more collaboration given the visibility of test results for the entire team. These tools do have limitations – they are robotic and don’t behave the same as a real user, though they detect most bugs in a system.

Level 2

A reactive unit test is conducted when a bug is found. The unit test is used to validate if/when the bug is fixed.


Level 3

Complete Unit Tests ensure that all subcomponents of the software are integrated successfully to provide expected results. Sections of the code are isolated to verify correctness and are tested comprehensively. Complete Unit Tests are also more likely to find real user issues and are flexible, given that ideas can be tested quickly and easily. However, certain tasks are difficult to conduct manually. Additionally, manual tests cannot be reused in the same way automated tests can be, which makes the process much more time intensive.

When Unit/Automated Testing Should be Done

Whether or not Unit Testing should be done depends on factors previously discussed with the client. Unit Tests are typically conducted when there are several heavy components that can be easily verified/tested with basic commands.

Things like routes/paths, code formatting, or simple classes that perform specific functions (like calculators). Complete Unit Tests are conducted if full code coverage is necessary for testing workflow or process flow for things like payment processing, encryption and storage of sensitive data, and security rules.

Tools: Bitbucket pipelines, phpUnit, Jenkins, Travis

Interested in other methods of development testing? Read our white paper, Your Guide to Development Testing.

Ben Spencer

UX Researcher & Writer

Professional UX Researcher & Writer. Amateur Crossfitter, video gamer, and Planeswalker. I make sense of the world through storytelling and by observing the infinite wisdom of my two beloved Boxer dogs.

You might also like...



Announcing Fresh Consulting’s WCAG 2.0 PHPCS Linter

Today, Fresh Consulting is announcing the release of our WCAG 2.0 PHPCS Linter. The linter is a set of rules (or sniffs) for PHP Code Sniffer which can automatically detect and alert when certain WCAG 2.0 violations are detected in code. WCAG 2.0 supports designers and developers in meeting the guidelines and success criteria of accessibility. The … Continued



You Should Be Using BitBucket Pipelines

Commonly, developer workflows include pushing code to BitBucket. From there, you run processes like testing, updating a staging server, and generating documentation. All of these processes can become very repetitive. Thankfully, they can also be automated. That’s where Bitbucket Pipelines comes in. It’s simple – you only have to create a set of scripts that run … Continued



Should I Use RxJS in My Project?

If you’re thinking about using RxJS, you might as well be asking, “Should I use a jump kick in a street fight?” Unless you are Bruce Lee, probably not. As a disclaimer, I am not an RxJS pro. I only started learning about it a couple of weeks ago. Consider this post a record of … Continued