Denamix
Denamix

Reputation: 51

collect stats on method usage in non-rails ruby project

I have a project where we keep our acceptance test code. It has about 1100 methods that I use for dealing with various aspects of the UI the project is quite old so I suspect that some methods are stale and never get used. Tests are run as Rspec tests. I would like to somehow create statistics method usage to delete stale ones and create a list of top 20 or 30 which are in active use. Any ideas how I can collect that data?

To give more detail: I have all of the supporting page-object methods in lib directory. I run about 100 spec tests which call methods from these page objects. I want to collect stats on how often these methods from lib/ directory get used.

Upvotes: 0

Views: 111

Answers (2)

akshay takkar
akshay takkar

Reputation: 11

You can try using a deforest

It's an easy to use gem that tracks the number of times your model method are called and presents this data segmented as most used, medium used and least used. Exactly what you are looking for.

Upvotes: 0

Extrapolator
Extrapolator

Reputation: 794

You can try https://github.com/danmayer/coverband it's a dynamic analysis tool, it should get you the data you need

Upvotes: 0

Related Questions