0

This question already has an answer here:

I feel like I've heard the phrase "Automated Test Coverage" but not really sure what it means. I am wondering if there is a way to do some sort of program analysis that will tell you which parts of your code are untested. In this way, figure out what is left to test to build a robust system.

marked as duplicate by gnat, Greg Burghardt, Community Jul 26 '18 at 20:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

The answer depends on your programming language, but what are are looking for is a code coverage tool Just run it on your tests.

https://stackify.com/code-coverage-tools/

  • There are also tools that match code changes in a particular pull request with coverage output, showing what's in the new / changed code is tested or not. – 9000 Jul 26 '18 at 20:09
  • 1
    Note: code coverage tools tell you what code is executed. If you use a code coverage tool during your tests, it tells you which code was executed by your tests. It does not tell you which code was tested by your tests. It can only tell you what code was definitely not tested, namely the one that wasn't even executed. Simple proof: take a test suite with 100% code coverage. Remove all assertions, otherwise keep the tests as is. Run again: still 100% code coverage but nothing is tested. – Jörg W Mittag Jul 27 '18 at 11:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.