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. The myth of code coverage

The myth of code coverage

Scheduled Pinned Locked Moved The Insider News
5 Posts 5 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

    Preslav Rachev[^]:

    1/3 of the code every software project is irrelevant, buggy, overly complicated, or simply sucks

    2 out of 3 lines of code approve of this message

    J M 2 Replies Last reply
    0
    • K Kent Sharkey

      Preslav Rachev[^]:

      1/3 of the code every software project is irrelevant, buggy, overly complicated, or simply sucks

      2 out of 3 lines of code approve of this message

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      I don't understand the logic here; a third of code in a given solution is poor, so don't test it. Instead, test the "good" code. (And how does he know which is which? Apparently magic.)

      1 Reply Last reply
      0
      • K Kent Sharkey

        Preslav Rachev[^]:

        1/3 of the code every software project is irrelevant, buggy, overly complicated, or simply sucks

        2 out of 3 lines of code approve of this message

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

        Ironically, I completely disagree with his recommendations. It is actually the crappy code and the frequently changing code that requires the most code coverage! That is certainly how I base my unit and integration tests - what's changing the most, and what is so fragile and poorly documented and understood. Because when I get around to refactoring shitty code, I want test to verify that I haven't broken something!

        Latest Articles:
        Thread Safe Quantized Temporal Frame Ring Buffer

        Sander RosselS D 2 Replies Last reply
        0
        • M Marc Clifton

          Ironically, I completely disagree with his recommendations. It is actually the crappy code and the frequently changing code that requires the most code coverage! That is certainly how I base my unit and integration tests - what's changing the most, and what is so fragile and poorly documented and understood. Because when I get around to refactoring shitty code, I want test to verify that I haven't broken something!

          Latest Articles:
          Thread Safe Quantized Temporal Frame Ring Buffer

          Sander RosselS Offline
          Sander RosselS Offline
          Sander Rossel
          wrote on last edited by
          #4

          My thoughts exactly! Besides, it's not even about percentages, but about writing effective tests. I've literally seen some untestable code that had a high coverage. The code couldn't be tested because it relied on some settings that could only be set in production (HttpContext or some such) and couldn't be mocked (well, it could, if better developers had written it). Every test simply checked if the code throwed the expected NullReferenceException :laugh: But they could tell their customers they had a high test coverage :sigh:

          Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

          1 Reply Last reply
          0
          • M Marc Clifton

            Ironically, I completely disagree with his recommendations. It is actually the crappy code and the frequently changing code that requires the most code coverage! That is certainly how I base my unit and integration tests - what's changing the most, and what is so fragile and poorly documented and understood. Because when I get around to refactoring shitty code, I want test to verify that I haven't broken something!

            Latest Articles:
            Thread Safe Quantized Temporal Frame Ring Buffer

            D Offline
            D Offline
            Dominic Burford
            wrote on last edited by
            #5

            My thoughts exactly. I would rather have higher test coverage around the poorly written code that is more likely to break somewhere.

            "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare Home | LinkedIn | Google+ | Twitter

            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