Reputation: 1
Backstory: Trying to differentiate between test coverage and code coverage. I have a decoupled application that uses React for the frontend and Rails for the backend. I have a acceptance criteria to have a minimum of 60% test coverage for both applications. I understand the importance of both test coverage and code coverage. Very basic summary --> Code coverage (white box testing) is a quantitative measurement of the number of lines of code covered by the tests within the web application. On the other hand, test coverage (black box testing) is a qualitative measurement of each test within the web application. Just having a hard time distinguishing whether the following reports would be considered test coverage or code coverage.
Coverage Reports:
rails stats coverage
This summary is a terminal output from the coverage report for the Rails application.
yarn test coverage
This summary is a terminal output from the coverage report for the React application.
At first I was assuming that both fall under the category of test coverage. However, I think I have started merging the concepts of test coverage and code coverage.
Help: Guidance on differentiating test coverage and code coverage reports
Upvotes: 0
Views: 229
Reputation: 1
After a bit more research, I feel that I have a better understanding. I used chatGPT to breakdown the explanations of each methodology. Of course, I dug dipper for verification.
The "rails stats" summary is neither test coverage nor code coverage. It is generally statistics related to Rails application's codebase, such as the total number of lines of code, the number of models, controllers, and helper files, the average number of methods per class, etc.
To obtain test or code coverage reports, we will have to implement tools like SimpleCov (code coverage for Ruby code) or evaluate built-in properties from the React software (code coverage for Jest testing suite) through the command "yarn test --coverage".
I have certainly learned about being mindful of my interpretation of terminology in this development space. However, if there is something missing, please feel free to share.
Here are a couple of references.
React coverage reporting
Code coverage
Rails Stats command
Upvotes: 0