# background
Group code coverage platform because of network problems can not be used, only under their own research.
Coverage is a measure of the effectiveness of an automated use case, but only an auxiliary indicator, high coverage does not mean good quality, but low coverage can explain some problems,
# comparison
Comparison of coverage tools, direct reference material:
Blogs with great teams: https://tech.youzan.com/code-coverage/
# Understanding
1. In combination with the business form, the service cannot be stopped by the measured services;
2. Through the Javaagent way to start the Jacoco;
3. Javaagent mode can be used File,tcpserver, tcpclient three modes, commonly used is tcpserver format
4. After mounting the javagent, the ip:port can be used to interact with the javaagent, generate the Exec file and generate the report;
# detail
1. Jacoco Official website: https://www.eclemma.org/jacoco/up to download Agent.jar package;
2. Javaagent Format:
-javaagent:[yourpath/]jacocoagent.jar=[option1]=[value1],[option2]=[ Value2]
More parameters: https://www.jacoco.org/jacoco/trunk/doc/agent.html
Practical Example:-javaagent:/home/tools/jacocoagent.jar=includes=*,output=tcpserver,address=xxx.xxx.xx.xx,port=6300,append =true
3. Generating the Exec file is not limited to ant tools, but the underlying is still accessed via TCP connection;
4. Generate exce after the need to parse into a report, more trouble, to have compiled class file also have to source. The most understanding of the state should be taken from the server back to the local operation;
5. Actual landing: The tested service Mount Javaagent--"Execute automation use case-" Generate exec file--"generated report (exec file generated on the tested server)
# questions
1. Jacoco only support the time period code coverage statistics, and can not be refined to which method/interface;
2. What is the difference between Javaagent's TCPServer and tcpclient? Flipping through documents is basically tcpserver, no tcpclient.
Preliminary study on Jacoco