How Reusable Modules for Mobile Apps Cut Developer Time from 1 Week to 30 Min

Danny Paez
Intuit Engineering
Published in
5 min readFeb 23, 2022

Building reusable components for mobile apps goes a long way in boosting development productivity. In this blog, I’ll describe how we’ve reduced developer time from an average of one week to just 30 minutes for component development with our AppFabric Mobile Platform for Intuit products, such as TurboTax, QuickBooks and Mint.

Tackling the Challenge of Monolithic Projects with Reusable Modules

Many mobile teams deal with monolithic projects with duplicate code spread throughout each app. Maintaining and updating these apps can be tedious, time consuming and difficult for developers.

To help tackle this challenge, Intuit has turned to software reuse. Specifically, Intuit developed a component generator that quickly creates modular components ready for app consumption. Each newly-created component comes packaged with the latest out-of-the-box capabilities (logging, analytics, A/B tests, etc.), so that developers don’t need to spend time implementing capabilities from scratch.

At Intuit, developers create modules using our Development Portal. With a few clicks, they can generate a component from a module template, built to Intuit developer standards with the most secure, efficient, up-to-date technology.

Benefits of Reusable Modules

At a high level, reusable modules provide the following benefits:

  • Promotes modular development
    - Quicker development/testing
    - Deal with less code at once
  • Makes bug tracing easier
    - Starts directly at component level, instead of the app level
  • Reduces size of app install
    - For example, in iOS apps, QuickBooks Accounting install size was reduced by 10% and Mint install size was reduced by 7.5%
Example of an app split into modular components

How Should Each Component be Built?

Having independent components in a large project has its benefits. However, projects might have certain standards for how components should look or be built.

For example, maybe every component needs a certain analytics library for user actions. Or, all components need to log to the same endpoint. What’s stopping a component from using logging tool X instead of logging tool Y? What if component A is using Splunk to log messages, but component B is logging to console? Would this cause the app to break (i.e., dependency compatibility issues, app crashes, etc.)?

Investigating app-breaking issues might prove difficult, since each component behaves differently. This is where standardized modular development comes into play.

What Standards Should be Set for Modular Development?

Establishing standards for component construction and design — and knowing that each component adheres to those standards — helps maintain overall app integrity and ensures production readiness.

For example, let’s say we want all UI actions from the app to post data on a trusted analytics platform, but the developers behind a particular component decide to use a different library and this library comes with a bug. App crashing would be inevitable, halting development to fix the bug. Modular development allows tracing to start at the buggy component itself. However, in this case, only the developers behind the buggy component would be able to immediately investigate, since no one else is familiar with the library they chose. If they used the same library, the bug could get attention from all developers.

How To Generate iOS Modules

Method 1

You can make an iOS module by creating an Xcode project and bundling all relevant files together. This method has the overhead of dealing with Xcode and going through multiple screens just to get a project going.

Method 2

Another method uses the Cocoapods command pod lib create. The command invokes the steps of the previous method, but through the command line. The command line asks a series of questions on how the module should be created, then creates the project for you.

“pod lib create” command in action

However, like method 1, method 2 creates an empty project. With each method, you need to make code changes to ensure your component complies with team or company standards. By simply modifying the command as follows, it’s possible to avoid the extra work involved with developers undertaking this implementation task themselves:

pod lib create --template-url=https://github.com/CocoaPods/pod-template

This will perform the same steps described previously, however the generated project files will be based on the GitHub repository you supply in the template URL parameter. Customizing the project files generated by the is as easy as forking the repo, modifying the forked template, and changing the template URL parameter to your forked repo URL. Anyone can consume your component as long as they have your URL:

pod lib create --template-url=YOUR_FORKED_REPO_URL_HERE

How To Generate Android Modules

Method 1

You can make an Android module by creating an Android Studio project and bundling all relevant files together. This method has the overhead of dealing with Android Studio and going through multiple screens just to get a project going.

Method 2

Another method uses the command line interface Yeoman (yo). Yeoman emulates the steps of using Android Studio, but in a lightweight, streamlined way. Like the Cocoapods command pod lib create, Yeoman asks a series of questions about how the module should be created, then creates a project for you.

As an example, let’s use a Kotlin project generator (kotlin-android) to create an Android module:

“yo” command in action

From here, you can customize the project however you like. Use npm-publish to publish your module and make it available for other developers to consume.

Wrap-up and Next Steps

Intuit’s component generator in the future

Promoting modular development simplifies the work of building large-scale apps in monolithic environments. A component module generator is a quick and effective way to dramatically cut development time and streamline app development in compliance with team or company standards.

I hope the best practices and methods listed in this blog prove applicable to anyone who, like Intuit, is tackling the challenge of monolithic projects and seeking to boost development productivity!

While Intuit has benefited a great deal from implementing reusable models, we’re always looking ahead at ways to become more efficient and effective. So, now we’re looking into ways for module generator scripts to include enterprise-level tools like CI/CD pipeline, code linting, code coverage, etc.

Our journey will continue in the future — so stay tuned!

--

--