Theoretical Frameworks for API-First and Shift-Left Quality Engineering in Microservices Architectures
Main Article Content
Abstract
Microservices architectures have shifted the model of how quality is assured. Specifically: end-to-end screening strategies used in monolithic architectures are not viable because UI centric approaches have delays in defect discovery; and resolving architectural defects post integration requires orders of magnitude more effort than resolving defects found at the level of service contracts. API first testing provides mechanisms for coping with the unmanageable exponential growth in possible test scenarios that arise from service dependencies in microservice architectures and other distributed systems. Contract-driven development specifies service interfaces in an executable way as provider-consumer contracts and generates testable contracts that enforce contract-test-first as an independent way to evolve and deploy services. Consumer-driven contract testing breaks up validating a contract into discrete steps, where consumer tests generate compatibility specifications as contract files and provider tests replay requests and responses against APIs. Defect seeding experiments show that an important percentage of integration defects can be detected in the consumer, provider, and HTTP-structural categories, although value range changes are a limitation of this method. The underlying economic rationale for shift-left quality activities is an exponential relationship between defect discovery delay and defect cost. Early-discovered defects are cheaper to fix than those found in a late phase of the software life cycle (after product deployment). Empirical studies suggest that shift-left quality activities can considerably lower defect levels, cost of rework, and lead-time, if a design-time validation philosophy is substituted for system test-time verification.