Home / Companies / Datadog / Blog / Post Details
Content Deep Dive

How we built a Ruby library that saves 50% in testing time

Blog post from Datadog

Post Details
Company
Date Published
Author
Andrey Marchenko, Gillian McGarvey
Word Count
2,344
Language
English
Hacker News Points
6
Summary

** The authors of a test impact analysis library aimed to speed up the testing process by selectively running tests based on their impact. They considered several approaches, including using existing code coverage tools and TracePoint, but found them to be either incompatible or too performance-intensive. Instead, they created their own solution that uses interpreter events to track which source files are executed during test runs. This approach allows for a highly optimized solution with a median performance overhead of 25% (up to 70%), making it suitable for use in continuous integration pipelines. The library also addresses limitations such as "code-less classes" and external dependencies, providing workarounds for these cases. By collecting test impact data on every test run, the tool ensures that the correct set of tests is skipped each time, creating a fully deterministic experience.