Different Types of Automated Testing

testing|

Different Types of Automated Testing

Testing is an important aspect of the software development lifecycle. Automated tests help catch regressions, ensure business logic is implemented correctly, and confirms that the different pieces of your app are integrated correctly. In this article, I discuss a few different types of testing, the benefits they can provide, and software you can use to write them.

Unit Testing

If you’ve written tests before, chances are pretty good it was a unit test. These type of tests target the smallest piece of code possible, typically a method or function call. In addition to the happy and sad paths, it is important to test conditional branches in those methods. Unit tests can catch regressions, ensure dependencies are used properly, and act as a blueprint for how a developer can use the different methods available in a system. I encourage using Test Driven Development (TDD) when writing unit tests, where they provide an informative feedback loop.

To write unit tests you can use PHPUnit, one of the most popular PHP libraries out there, or Pest, a Laravel community wrapper.

Acceptance Testing

Acceptance tests are focused on checking that business logic is implemented correctly for a scenario that a typical user would be expected to perform with your app. Instead of focusing on individual methods we’re looking at the API interacting as a whole. With these tests you want to use minimal mocking and interact with real services wherever possible. Acceptance tests are important to ensure that users experience what is expected for a variety of situations. Closely related to acceptance testing is Behavioral testing, which focuses on describing the behavior of a process.

At Roave, we often use Behat to write these types of tests.

End-to-End Testing

End-to-end (e2e) testing looks at your entire app stack, including the front-end. Like acceptance testing, e2e tests are focused on ensuring your users experience the appropriate outcomes. Unlike acceptance tests, e2e tests ensure that your User Interface is integrated with your API correctly. Using software that controls a browser session, these tests ensure that users can fill out forms, click buttons, and navigate through your app.

You can use software like Cypress or Selenium to write e2e tests.


Implementing these different types of tests can provide huge benefits; ensure regressions are caught before they impact users and confirm that users experience the expected outcomes. Do you write different types of tests? Use different software? Come let us know in the Roave Discord!