Code Coverage for executable written in GoLang

(Rakesh Sharma) #1

I have one exe file which contains code written in the Go language. I don’t have a source code for this. Is there a tool or technique by which I can determine the code Coverage for this executable. I will trigger my test cases by using this exe.

(Christophe Meessen) #2

Code coverage is usually given on source code. To get the coverage, you thus need the source code. If you don’t have the source code of the program, you can’t get source code coverage since you can’t tell which instruction is executed in the tests.

You would need to determine the coverage on the machine code, but there is no standard tool that does this. This is too rarely needed.

(Rakesh Sharma) #3

Thank you so much @Christophe_Meessen.