Chapter 11. Unit Testing

Unit testing is the process of breaking down your application to the smallest possible functions, and creating a repeatable, automated test that should continually produce the same result. These tests are the heart and soul of your application. They provide the foundation that all future code is built upon. Without unit tests, it is possible that a seldom-used function could remain broken for months without anyone noticing. With unit tests, every system function can be verified before a single line of code is even merged into the master branch, let alone pushed to production.

As a frontend architect, your primary role is making sure that developers have the tools necessary to be as efficient as possible. Unit tests are one of those essential tools for building an application of any scale. Whether your application logic is written mostly in a backend or frontend language, there are plenty of options to fit your workflow. No matter if you are running PHPUnit with PHP, NodeUnit with Node, or QUnit with JavaScript, you will find mature, stable platforms to build your tests upon.

Though your technology stack (and the tests associated with it) might be left up to the software architect, it is quite probable that your frontend developers will also be writing code that requires tests. Therefore it is important to become familiar with as many of the suites as possible. Acquiring mastery, or even proficiency, with all of them is not something we typically have the ...

Get Frontend Architecture for Design Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.