-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/v1/cover/coverage这个接口建议添加一下说明,获取的是语句块的覆盖率 #348
Comments
Hi @gxchenqiang , what do you mean by this request? Are you experiencing any specific issues or challenges related to your idea? |
The calculation formula for code coverage in this API (/v1/cover/coverage) is "have_cover_count_code_block / all_code_block," not "have_cover_count_line / all_code_line." I believe that what people need more is code coverage based on lines of code. So, to prevent misuse of this API, should we annotate it to clarify that it calculates code coverage based on code blocks, not lines of code? |
@gxchenqiang To clarify, the algorithm for code coverage in the Go language primarily focuses on statement coverage, which is closely related to line coverage. In Go, the addition of counters around code blocks serves the purpose of effectively identifying the logic of statements. By placing counters within individual code blocks, it becomes apparent whether a statement within that block has been covered or executed during testing. This approach helps track the coverage of statements more accurately. |
I see, but this API calculates code coverage based on code blocks, not statements. So, should we make a note of it? :- ) |
A code block consists of statements, and they are not mutually exclusive. Strictly speaking, in Go language, code coverage is calculated based on statement coverage, which has no direct relationship with code blocks. Code blocks only represent the internal logical understanding of the statements being measured. |
/v1/cover/coverage这个接口是获取的语句块的覆盖率,而不是代码行的覆盖率。是不是在接口那里添加个注释说明一下,比较好
The text was updated successfully, but these errors were encountered: