3
votes

We have a huge java based application , which is there since few years.We also have a large set of block box test cases with QA team to carry out regression testing. There is an initiative being taken in our project to improve the quality of the application and on the same lines we have to measure the code which is getting covered by these black box test cases.

I know that we can have a code coverage report through code coverage tools like EMMA,Code Cover,Cobertura ,these tools work along with White Box Unit test cases(i.e JUnit test cases).

I want to know whether any of these tools can be used to generate similar code coverage reports when black box test cases are executed on the application. With regards to this I have done some google search and found out that the application code can be "Instrumented" and it is possible to generate code coverage reports.

Now what I am trying to do is to 1.Instrument the code in Eclipse using "Code pro" eclipse plugin, 2.Once the code is instrumented ,will generate the jar file of the instrumented code and deploy the same on the test Environment (Unix box).

Now the question is, whether I am going in right direction? How and where the code coverage reports will be generated when black box testing is being done on the instrumented code on server(not local machine).

2

2 Answers

3
votes

Take a look at jacoco

http://www.eclemma.org/jacoco/trunk/doc/mission.html

This uses a java agent and can instrument your code at runtime

3
votes

You can use jacoco for this, set the jvm under to test to run with the tcpserver option, run tests and then connect to it using the tcpclient option. If you want to collect coverage separately for n runs then you can connect to it over jmx and call reset