Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Why reaching 100% code coverage must NOT be your testing goal

Why reaching 100% code coverage must NOT be your testing goal

Scheduled Pinned Locked Moved The Insider News
sharepointtestingbeta-testingquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Code4It[^]:

    Average teams aim at 100% Code Coverage just to reach the number. Great teams don’t. Why?

    Uncovering the answer

    M M 2 Replies Last reply
    0
    • K Kent Sharkey

      Code4It[^]:

      Average teams aim at 100% Code Coverage just to reach the number. Great teams don’t. Why?

      Uncovering the answer

      M Offline
      M Offline
      MarkTJohnson
      wrote on last edited by
      #2

      Kent Sharkey wrote:

      Great teams don’t. Why?

      Because it's kinda silly to test getters and setters and such?

      I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

      1 Reply Last reply
      0
      • K Kent Sharkey

        Code4It[^]:

        Average teams aim at 100% Code Coverage just to reach the number. Great teams don’t. Why?

        Uncovering the answer

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #3

        Code coverage is like trying to get to the speed of light. The more code coverage you have, the more massive your code. At some point, the energy required to go the next 0.00001% of coverage becomes impossible because the mass of code is so close to infinite. ;P Not to mention the whole time dilation effect, where your tests are obsoleting faster and faster as other coders make changes. Something like that. :laugh:

        Latest Articles:
        A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

        T 1 Reply Last reply
        0
        • M Marc Clifton

          Code coverage is like trying to get to the speed of light. The more code coverage you have, the more massive your code. At some point, the energy required to go the next 0.00001% of coverage becomes impossible because the mass of code is so close to infinite. ;P Not to mention the whole time dilation effect, where your tests are obsoleting faster and faster as other coders make changes. Something like that. :laugh:

          Latest Articles:
          A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

          T Offline
          T Offline
          trønderen
          wrote on last edited by
          #4

          OK, I get your point. But then, testing shouldn't go by the code lines, but what those code lines do. There should be no reason to change/update a test because the code is changed - only when what the code is supposed to do changes. Tests should be developed and implemented by people who know nothing of the code. They should make tests for all the functionality, regardless of the lines of code to implement it. If some code is not run during a complete test, it either indicates that the code is dead and can be removed, or that there is some functionality that the test developers never were told about. Maybe the developer didn't tell anybody about this functionality - which is really bad. Secret, undocumented, untested functionality is bad for any software. So don't strive for 100% code coverage. Strive for 100% functionality coverage. If that doesn't lead to 100% code coverage, you should take a close look at the code and ask: What the elephant is that code there for?

          Religious freedom is the freedom to say that two plus two make five.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups