# TestProf

> A Ruby test profiling toolkit with a collection of different tools to analyze your test suite performance.

- URL: https://evilmartians.com/opensource/testprof
- GitHub: https://github.com/test-prof/test-prof
- Website: https://test-prof.evilmartians.io/
- Authors: Vladimir Dementyev

---

Slow tests waste your time, making you less productive. TestProf to the rescue! It's a Ruby test profiling toolkit with a collection of different tools to analyze your test suite performance.

Writing tests is a significant part of the development process, especially in the Ruby and Rails community. We don’t care about test suite performance until we find ourselves wasting too much time waiting for the green light.

You're probably asking yourself: "Why does test suite performance matter?" **TL;DR** Slower tests lead to longer feedback loops and deployment cycles. Scaling _vertically_ by dropping more CPU cores or CI workers has its limits. Optimizing your test suite is a better alternative. And with TestProf, you can do that gradually and with as little refactoring as possible!

TestProf toolbox aims to help you identify bottlenecks in your test suite. It contains:

- Plug'n'Play integrations for general Ruby profilers ([`ruby-prof`](https://github.com/ruby-prof/ruby-prof), [`stackprof`](https://github.com/tmm1/stackprof))
- Factories usage analyzers and profilers
- ActiveSupport-backed profilers
- RSpec and minitest [helpers](https://test-prof.evilmartians.io/#/?id=recipes) to write faster tests
- RuboCop cops
- etc.

*Image: TestProf diagram*

See the [documentation](https://test-prof.evilmartians.io)!

## Who uses TestProf

- [Discourse](https://github.com/discourse/discourse) reduced [~27% of their test suite time](https://twitter.com/samsaffron/status/1125602558024699904)
- [GitLab](https://gitlab.com/gitlab-org/gitlab-ce) reduced [39% of their API tests time](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14370) and [improved factories usage](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26810)
- [CodeTriage](https://github.com/codetriage/codetriage)
- [Dev.to](https://github.com/thepracticaldev/dev.to)
- [Open Project](https://github.com/opf/openproject)
- [...and others](https://github.com/test-prof/test-prof/issues/73)
