Health Score Metrics as a Software Craftsmanship Enabler

The notion of software craftsmanship is sometimes a muddy one. On the one hand, engineers find it hard to grasp and materialize craftsmanship, which is an abstract objective that, by itself, provides little guidance to the software engineering practice. On the other hand, craftsmanship is often narrowed down to a handful of “best practices” that engineers are expected to follow. Neither of these limited definitions helps much in improving software quality. During 2016, an R&D initiative for software craftsmanship was one of the technical priorities across the engineering organization at LinkedIn. As a part of this initiative, we decided to take the approach of quantifying some components of software craftsmanship to help guide our engineers towards better software development practices and software quality. The ultimate goal is to provide concrete and actionable guidelines for every piece of software being created at LinkedIn. With this goal in mind, we built a health score platform that collects and presents craftsmanship-elevating metrics, and provides a framework for convenient extension. We also proposed and implemented an initial set of metrics and plugged them into this platform.

This health score platform is built on top of LinkedIn’s in-house development framework. Under this framework, the entire LinkedIn software ecosystem is broken down into releasable logical units of software known as “multiproducts.” Each release of a multiproduct is associated with a semantic version and may depend on specified versions of other multiproducts. Thus, the multiproduct framework centers around the core concepts of dependency management, version control, and build systems. The multiproduct framework unifies various underlying technologies for software development, makes iterations of development faster, and is the backbone of LinkedIn’s software delivery pipeline. Accordingly, our health score platform, which we refer to as “multiproduct health score,” tries to realize a model for measuring software craftsmanship at LinkedIn by considering factors such as quality of source code, state of dependencies, and semantic fidelity of product versions. Based on these aspects, we identified some quantifiable metrics (referred to as “multiproduct health metrics”), and synthesized them into a score by a configurable function (referred to as the “multiproduct health model”). Each multiproduct health metric is scaled to the standard value range of [0%, 100%]. The extensible nature of the platform enables us to plug in custom multiproduct health metrics and models in a convenient manner.

System architecture

The system has three major components:

  • Quality build controller: In order to obtain multiproduct health metrics without influencing the commit-to-release time, we introduced a build phase after each release, referred to as “quality build.” Developers also have the option of invoking quality build at any time. The quality build controller glues the multiproduct health score plugin to the rest of LinkedIn’s development framework.

  • Multiproduct health score plugin: At LinkedIn, Gradle powers the build pipeline for all mainstream products. During the quality build phase, the quality build controller invokes the Gradle plugin for the multiproduct health score, which returns a result that is sent to the multiproduct health score server. The multiproduct health score plugin provides APIs through which multiproduct health models are configured and multiproduct health score metrics are implemented. Note that before the quality build controller invokes the multiproduct health score plugin, it checks out the product in question. As a result, a product can associate itself with product-specific multiproduct health models and metrics by implementing them either in the build script of the product, or as a separate Gradle plugin, and the defining the plugin as a dependency of the product.

  • Multiproduct health score server: Provides APIs for accessing multiproduct health score metrics and models, calculating multiproduct health scores, and sending data to the data analytics infrastructures at LinkedIn. These APIs are used by various analysis and presentation tools for LinkedIn developers.

A simplified system architecture is illustrated by the following diagram:

Source link