For all but the most static applications, an app’s codebase is a living thing. It’s constantly evolving–debugging, merging, and building all result in code that needs continuous management to achieve the intended result. Application development is a complex process for individual developers, and for development teams, it can quickly get out of control.
This applies to all application development, and developing for the iOS App Store is certainly no exception. Apple’s intense focus on application quality places significant demands on application developers and on an organization’s application development process. Anything that can be done to make for a more efficient and effective process will help ease the developer’s path to an app’s availability in the App Store.
Old Process: Manual and Cumbersome
In the past, Applico used a process that might be common in the industry, but was far less effective than what we wanted and resulted in numerous issues as our company grew. Simply put, we utilized a build process wherein developers committed their changes to the codebase on an ongoing basis, and only after some extended period of time–typically a week–were those changes compiled into a build of the app.
While having some kind of process is better than having none at all, this process suffered from a number of problems.
New Process: Automated and Continuous
When the old system became untenable, Applico set about creating a new process using certain best practices and a set of tools aimed at a single, overarching goal: to maintain all apps in a deployable state. Committing to this new process has allowed the iOS Team to more efficiently deploy apps to the App Store while improving overall quality.
Furthermore, once engineers deliver code and design, QA and product managers approve, the code is made available immediately. There is no lag. Other organizations will often set a release date. The code may be ready before, but they stick to that release date and this creates a lag. Another inefficiency is that release dates are usually reserved for mass feature updates. This is the opposite of an iterative approach. If users complain about a particular major release, the app operators may not know which new feature is causing dissatisfaction. In a more iterative approach, app operators can roll back iterative app updates if there is too much negative feedback.
Essentially, the first step in this new process is to create an initial, completed build that exists in the desired deployable state. Developers continue working on the project and regularly push their code to GitHub, a code repository. Jenkins, a continuous integration system, interacts with the code on GitHub, conducting automated testing on the code as it’s uploaded and creating builds to ensure that the app functions when the new and changed code is committed.
This loop continues throughout the life of the project. Developers pull down builds of the code and establish their own branches, make their changes, and then push the code back into the master branch, where it’s immediately tested. This process is repeated continuously, and the app is thus maintained in a deployable state where a build always exists that’s been tested and is ready to deploy as one of a number of build types.
Applico’s development process can be broken down into five steps, as follows.
Code signing is the process of assigning specific profiles to builds that can then be distributed for specific purposes, with how a profile is signed determining how the code will be used. Profiles include:
These build profiles are maintained on Apple’s developer portal and given an app ID. Developers then know to access these builds for specific purposes by the combination of the app ID and the distribution profile. Apps typically use the first three profiles, and often use all four.
Build configuration is simply the process of creating app builds that are signed for specific uses. Because an app is maintained in a continuously deployable state, a build generated for any purposes always represents the latest version with the most up-to-date and tested code.
Applico’s build configuration process not only provides solid controls that ensure build quality, but it also allows our team to see how our app operates under different conditions. For example, all build configurations can be run on a device at the same time, enabling the organization to test builds almost simultaneously under different conditions, e.g., development and testing builds that point to a set of test data and an AppStore build that points to live user data.
Jenkins provides Applico with the ability to implement continuous integration, which is basically automating the build management process. Whenever a developer merges new code into the codebase on GitHub, Jenkins immediately tests the code to ensure that no syntax or other errors exist and that the code is capable of running without error.
The test results are communicated back to the developer. These will state whether the app ran without issue or issues exist that require fixing. Tests are run after each debugging iteration until the app runs without issue and is committed into the master codebase for generating builds. This prevents the master code base from being contaminated with improper code.
Once builds have been tested, they are uploaded into the continuous delivery service, either Testflight for App Store profile builds or HockeyApp for ad-hoc, developer, and enterprise profile (i.e., internal) builds. The continuous delivery service acts as the portal through which builds are downloaded as needed. Continuous delivery is the process by which Applico prevents deployment lag, as discussed earlier.
Automation is simply a description of the overall process, including the communication and verification that ensures that all code has been tested, reviewed, and documented. The automation phase incorporates additional tools, including Applico’s project management tool, Pivotal Tracker. This tool manages the overall workflow, assigning tasks to developers, tracking their progress, and allowing developers to provide comments for each code revision. GitHub works through Pivotal Tracker to merge each revision into the overall codebase in a fully documented state.
The basic process is as follows. Whenever developers make changes and are ready to merge the changes back into the main codebase, they open pull requests on GitHub. Snapshots of the code changes are provided, along with developer comments. This process provides all developers the opportunity to take part in a conversation around changes, evaluating each change and then triggering merges after the appropriate reviews.
Applico’s development process is aimed at implementing certain best practices, which we highly recommend for application development in general and for iOS app development in particular. These best practices utilize three basic principles:
Automating the process through tools like Jenkins and Pivotal Tracker enables Applico to achieve quality software in an efficient and manageable fashion. While no process can work for every organization, it’s important to implement some kind of process. The combination of continuous integration, continuous delivery, and automation helps Applico create apps that are modern, perform well, and that don’t drive the development team to distraction.
Filed under: Product Engineering | Topics: Continous Delivery, Mobile Apps Development