Code coverage is one of the important testing metrics. It indicates the ratio of the codebase under unit tests to the entire codebase. Code coverage of 50% means that the unit tests cover half of the codebase.
It is crucial to keep in mind that 100% code coverage doesn’t mean that the software is error-free or there are no bugs. It just means that the unit tests cover all the code. However, it’s still possible that the tests don’t test all branches that code could take or the problems with business logic execution
There are several methods that can be used in code coverage includes:
- Statement Coverage
- Decision Coverage
- Branch Coverage
- Toggle Coverage
Thank you @truonghuy