Measure code coverage of Java applications testing them at GUI level

34 views
Skip to first unread message

antoni...@gmail.com

unread,
Jun 6, 2017, 1:22:29 PM6/6/17
to JaCoCo and EclEmma Users
Hi!

I would like to measure code coverage of java applications with JaCoCo, but I want to measure it while testing the applications at the GUI level, without using unit tests. If someone has done it or know how it could work it would be great!

Thanks.

Antonio

Evgeny Mandrikov

unread,
Jun 6, 2017, 4:08:12 PM6/6/17
to JaCoCo and EclEmma Users, antoni...@gmail.com
Hi,

Actually the same way as with unit tests
  1. run your application with JaCoCo agent ( see http://www.jacoco.org/jacoco/trunk/doc/agent.html ) to obtain exec file
  2. generate report based on exec file, class and source files of application by using small Ant script with Report Task ( see http://www.jacoco.org/jacoco/trunk/doc/ant.html ), or by using not yet released Command Line Interface ( see http://www.jacoco.org/jacoco/trunk/doc/cli.html ), or by calling JaCoCo APIs directly ( see ReportGenerator.java at http://www.jacoco.org/jacoco/trunk/doc/api.html )

yutia...@snapchat.com

unread,
Jun 6, 2017, 4:34:58 PM6/6/17
to JaCoCo and EclEmma Users, antoni...@gmail.com
You can use offline instrument and run the instrumented app, click on your GUI then shutdown the JVM.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages