If jacoco can "extract" used code into a mini slice of the original large project

19 views
Skip to first unread message

benjam...@gmail.com

unread,
Jul 16, 2019, 1:47:13 PM7/16/19
to JaCoCo and EclEmma Users
Friends suggested I take a look at this project when I asked them the following scenario. Perfectly fine if this is too far outside the use case, thank you for any advice!

Background: I found a large-ish open source java project (lots of plugins, old code, a swing GUI, etc) and was able to get a test run working that successfully executes the feature I was looking for. Great first step! I then rampaged around and deleted all other main() calls and test cases. In theory, the only thing that can be run are the lines I'm particularly interested in.

Goal: Is there a way to use JaCoCo (or a profiler's log or some other method) to run the app, watch which lines get used, and "lift" out *only* the minimal necessary code into a new mini-project?

I've tried using IntelliJ "unused declaration" to iteratively prune, but the compiler said that broke everything.

Marc Hoffmann

unread,
Aug 9, 2019, 6:00:06 AM8/9/19
to JaCoCo and EclEmma Users
Hi,

I remember a quite old tool (based on Clover) which exactly did what you want:

https://github.com/codehaus/ashcroft/tree/master/guantanamo

I never tried it.

Regards,
-marc
> --
> You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/e9c899ff-9975-437f-9344-08a5a08c9554%40googlegroups.com.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages