Microservices expose their functionality via remote Application Programming Interfaces (APIs), e.g., based on HTTP or asynchronous messaging technology. To solve recurring problems in this design space, Microservice API Patterns (MAPs) have emerged to capture the collective experience of the API design community. At present, there is a lack of empirical evidence for the effectiveness of these patterns, e.g., how they impact understandability and API usability. We therefore conducted a controlled experiment with 6 microservice patterns to evaluate their impact on understandability with 65 diverse participants. Additionally, we wanted to study how demographics like years of professional experience or experience with MAPs influence the effects of the patterns. Per pattern, we constructed two API examples, each in a pattern version "P" and a functionally equivalent non-pattern version "N" (24 in total). Based on a crossover design, participants had to answer comprehension questions, while we measured the time. For five of the six patterns, we identified a significant positive impact on understandability, i.e., participants answered faster and / or more correctly for "P". However, effect sizes were mostly small, with one pattern showing a medium effect. The correlations between performance and demographics seem to suggest that certain patterns may introduce additional complexity; people experienced with MAPs will profit more from their effects. This has important implications for training and education around MAPs and other patterns.
翻译:微服务通过远程应用程序编程接口(API)暴露其功能,例如基于HTTP或异步消息传递技术。为了解决该设计空间中的重复性问题,微服务API模式(MAPs)应运而生,用以总结API设计社区的集体经验。目前,关于这些模式有效性的实证证据尚显不足,例如它们如何影响可理解性和API可用性。为此,我们针对6种微服务模式开展了一项受控实验,招募了65位不同背景的参与者,评估它们对可理解性的影响。同时,我们还研究了人口统计学特征(如专业工作年限或MAPs使用经验)如何影响这些模式的效果。针对每种模式,我们构建了两个API示例,分别采用对应的模式版本“P”和功能等价的非模式版本“N”(共24个)。基于交叉设计,参与者需回答理解性问题,同时我们记录其答题时间。结果表明,在六种模式中有五种对可理解性产生了显著的积极影响,即参与者对“P”版本的答题速度更快和/或正确率更高。然而,效应量大多较小,仅有一种模式显示出中等效应。性能与人口统计学特征之间的相关性似乎表明,某些模式可能引入额外复杂性;具有MAPs经验的参与者将从这些模式的效果中获益更多。这一发现对MAPs及其他模式的培训与教育工作具有重要启示。