0

We have an existing, large, application, for which we are going back and creating unit tests. We're starting with some of our core methods and then will expand this to include most internal and public methods.

Is there a best practice for keeping track of which methods in our application contain a unit test (or don't)? Perhaps an attribute or some other way? In other words, We'd like to be able to look at a method in our code and know if the method is under a unit test.

Randy Minder
  • 47,200
  • 49
  • 204
  • 358
  • It isn't necessary to mix your production code with some artifacts for unit testing. May be it is better to take a look at unittests _code coverage_ tools? – Akim Dec 24 '12 at 12:39

1 Answers1

4

I think you are looking for Code coverage.

Check these links:

Unit Test Code Coverage - What Is A Good Number?

Code Coverage

What is a reasonable code coverage % for unit tests (and why)?

Community
  • 1
  • 1
Azodious
  • 13,752
  • 1
  • 36
  • 71
  • completely agree. indication that method has a test or not means nothing. often 1 method requires many tests (e.g. parameterized tests) so coverage is much more valuable information. and you don't have to look at your code - you should look at reports (e.g. sonar for java) – piotrek Dec 24 '12 at 12:59