Spark Joy by Running Fewer Tests - Shopify
Jun 11, 2020

Summary
This post details the implementation of a dynamic analysis system for test selection in a large Ruby on Rails monorepo. The system uses Rotoscope and Tracepoint to log method invocations and build a test-to-file mapping. It addresses challenges with dynamically typed languages, metaprogramming, untraceable files, and mapping lag by running dynamic analysis on deployed commits and applying specific criteria for test selection on PRs. It also describes an automatic test disabling mechanism for failing tests and metrics for measuring recall and speed improvement.