Why You Should Modularise Your Automation Code

Colin Wren
The Startup
Published in
7 min readOct 18, 2020

--

Photo by Julia Kadel on Unsplash

The app I’m currently building — JiffyCV, makes use of three smaller libraries that are combined to help the user complete their tasks:

  1. A React Native component library for all the UI elements
  2. A TypeScript library that contains all the classes and functions required to work with the data structures we’re using in the app
  3. A React based templating library that contains all the components we’re using to render the data structures into HTML and produce printable PDFs

Each library deals with a particular job and it’s the app’s job to hook the UI elements up to code that works with the data structures with the end goal of getting that data into a template and printed to a PDF.

This approach makes it easier to build complex apps by breaking the functionality required to achieve a set of tasks into smaller cohesive chunks that can be treated as separate code-bases and used across a number of applications.

The modularisation of code is a common development pattern with a lot of effort being taken to identify contextual boundaries in the code so each library cleanly separates the concerns of the functionality it represents.

Separation of concerns in automation code

--

--

Colin Wren
The Startup

Currently building reciprocal.dev. Interested in building shared understanding, Automated Testing, Dev practises, Metal, Chiptune. All views my own.