Article

Unit/Automated Testing

Hero_UnitTesting-1

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

Your-Guide-to-Development-Testing
Ben-Spencer-Default-BW_optimize.jpg

Ben Spencer

Digital Content Strategist

Ben is a Digital Content Strategist with a passion for blending design and writing into a cohesive product narrative. An advocate for research, strategy, and discovery at the front end of any project, Ben excels in high-level thinking about how to most effectively tell a brand’s story in an authentic and relevant way.

Ben received Bachelor’s degrees in Film Studies and Religion from Whitman College, as well as a Master’s in Education from Lipscomb University. He studied UX Design and Content Strategy at General Assembly before joining Fresh’s team in January 2016.

Outside of work, Ben enjoys reading voraciously, watching horror movies, playing video games, and building his skill as an aspiring novelist. He spends every second he can with his wife and his two beloved Boxer dogs, California and Tennessee.