[ruby-core:67940] [ruby-trunk - Feature #10816] [Open] Add the ability to capture Coverage information

0 views
Skip to first unread message

tende...@ruby-lang.org

unread,
Feb 1, 2015, 6:57:58 PM2/1/15
to ruby...@ruby-lang.org
Issue #10816 has been reported by Aaron Patterson.

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816

* Author: Aaron Patterson
* Status: Open
* Priority: Normal
* Assignee: Yusuke Endoh
----------------------------------------
Hi,

I would like to periodically capture coverage information. The reason is because I would like to be able to pair test methods with the lines executed for that test method. The question I would like to answer is "If I modify file A on line B, which tests should I execute?"

I've attached a patch that returns a snapshot of the current coverage information. It means that I can grab coverage information before and after each test case, then calculate which lines of code a particular test executed.

---Files--------------------------------
snapshot.diff (3.39 KB)


--
https://bugs.ruby-lang.org/

ma...@ruby-lang.org

unread,
Feb 2, 2015, 7:02:14 AM2/2/15
to ruby...@ruby-lang.org
Issue #10816 has been updated by Yusuke Endoh.


Sounds good to me. I'm positive to import the feature.

I'd like to hear any opinion from the direct users of the feature, such as the authors of coverage measurement frontend tool (such as simplecov) or testing frameworks.

> The question I would like to answer is "If I modify file A on line B, which tests should I execute?"

FYI: I think it is called "regression test selection."

--
Yusuke Endoh <ma...@ruby-lang.org>

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816#change-51334

ryand...@zenspider.com

unread,
Feb 12, 2015, 7:01:59 PM2/12/15
to ruby...@ruby-lang.org
Issue #10816 has been updated by Ryan Davis.


I can absolutely see tying this into minitest-autotest to make it smarter about what tests to run on edit.

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816#change-51478

tende...@ruby-lang.org

unread,
Feb 12, 2015, 8:25:00 PM2/12/15
to ruby...@ruby-lang.org
Issue #10816 has been updated by Aaron Patterson.


I made a proof of concept program (using the patch I've posted here):

https://gist.github.com/tenderlove/fba8eaf2b2e3d84d77c5

Here is a video of it being used:

https://www.youtube.com/watch?v=Qsn7nZEccBU

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816#change-51480

ma...@ruby-lang.org

unread,
Feb 13, 2015, 9:12:03 AM2/13/15
to ruby...@ruby-lang.org
Issue #10816 has been updated by Yusuke Endoh.


Sorry for leaving this ticket and thank you for commenting and creating a proof-of-concept.
Fair enough. Aaron, could you commit your patch?

--
Yusuke Endoh <ma...@ruby-lang.org>

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816#change-51494

tende...@ruby-lang.org

unread,
Feb 13, 2015, 10:47:28 AM2/13/15
to ruby...@ruby-lang.org
Issue #10816 has been updated by Aaron Patterson.


> Sorry for leaving this ticket and thank you for commenting and creating a proof-of-concept.

No problem. I'm really excited about this feature (sorry if I seem impatient).

> Aaron, could you commit your patch?

Yes, I'll commit it.

----------------------------------------
Feature #10816: Add the ability to capture Coverage information
https://bugs.ruby-lang.org/issues/10816#change-51496
Reply all
Reply to author
Forward
0 new messages