LinkedIn open sources its iOS testing tool

LinkedIn has open-sourced its in-house developed iOS testing software. The Bluepill code, which is written in Objective-C, is now available on GitHub under a BSD-2 Clause license.

Writing in a blog post, Staff Software Engineer Keqiu Hu said: “Testing is a key component of LinkedIn’s 3×3 strategy. As we continue improving our iOS continuous delivery pipeline, we are faced with two major obstacles – tooling stability and scalability.

“We needed a tool to run iOS UI tests both reliably and quickly. For this reason, we created…Bluepill…a reliable iOS testing tool that runs UI tests using multiple simulators on a single machine.

iOS UI tests at scale

LinkedIn has faced limitations in carrying out its iOS development and testing at scale. The developer team faced many challenges dealing with iOS simulator stability.

“Xcode only supports one simulator at a time. Therefore, tests must be run sequentially. In the case of the LinkedIn app, which has around 2000 UI tests, this would take about 15 hours. In order to achieve a commit-to-publish time under three hours, we must run the tests in parallel,” Hu said.

Looking to solve these problems, LinkedIn engineers found two existing solutions: distributed testing and a Python wrapper to run tests in multiple simulators (nicknamed Project Hydra), neither of which ultimately met the business and employment-oriented social networking service’s needs adequately.

Representing a Matrix-style illusion

As existing solutions couldn’t satisfy the social network’s requirements, it was decided to build an internal iOS UI test runner to execute tests in multiple simulators. The tool was inspired by parallel iOS test and Facebook’s xctool.

Hu explains that “Bluepill runs tests in parallel using multiple simulators. The main features supported are:

  • Running tests in parallel by using multiple simulators.
  • Automatically packing tests into groups with similar running time.
  • Running tests in headless mode to reduce memory consumption.
  • Generating a junit report after each test run.
  • Reporting test running stats, including test running speed and environment robustness.
  • Retrying when the Simulator hangs or crashes.”

The name is inspired by The Matrix’s blue pill,” which represents an illusion. In this case, the magic pill creates an illusion that tooling just works miraculously, freeing up engineers to focus on coding.

“Bluepill has saved LinkedIn thousands of developer hours, and we believe it can also provide a great benefit to anyone running iOS UI tests at scale,” Hu added.

Microsoft, which offers many iOS apps and maintains several open source projects, acquired LinkedIn last year.

 

Edited from sources by Cecilia Rehn.

More
articles