Junior — Middle
How do you evaluate the level of test coverage in your project?
sobes.tech AI
Answer from AI
I evaluate the level of test coverage using tools that show the percentage of code covered by tests. In Python, coverage.py is often used, which allows you to see which lines of code are executed during tests. Good coverage is usually 70% and above, but it's not only about quantity; the quality of tests matters too: coverage should include critical and complex parts of the code.
Example of using coverage:
coverage run -m pytest
coverage report
coverage html # for a visual report
I also assess how well tests check different scenarios, boundary cases, and errors, not just the "happy path".