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. General Programming
  3. Design and Architecture
  4. Post-hoc unit testing, and increasing the unit test coverage rate?

Post-hoc unit testing, and increasing the unit test coverage rate?

Scheduled Pinned Locked Moved Design and Architecture
testingcombeta-testingtoolsquestion
5 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.
  • P Offline
    P Offline
    Philip Laureano
    wrote on last edited by
    #1

    I currently have a sizable code base with LinFu that I can't afford to rewrite from scratch, and I want to increase the code coverage rate on existing portions of the library which don't have any coverage at all. Is there any way to apply unit tests to existing code and increase the coverage rate, or is this an exercise in futility?

    Do you know...LinFu?

    L 1 Reply Last reply
    0
    • P Philip Laureano

      I currently have a sizable code base with LinFu that I can't afford to rewrite from scratch, and I want to increase the code coverage rate on existing portions of the library which don't have any coverage at all. Is there any way to apply unit tests to existing code and increase the coverage rate, or is this an exercise in futility?

      Do you know...LinFu?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Philip Laureano wrote:

      Is there any way to apply unit tests to existing code

      Couldn't you use LinFu to do that? :confused: I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something. :confused:

      led mike

      P 1 Reply Last reply
      0
      • L led mike

        Philip Laureano wrote:

        Is there any way to apply unit tests to existing code

        Couldn't you use LinFu to do that? :confused: I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something. :confused:

        led mike

        P Offline
        P Offline
        Philip Laureano
        wrote on last edited by
        #3

        led mike wrote:

        Couldn't you use LinFu to do that? [Confused] I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something.

        Hi Mike, Sorry for the confusion. This question is more of a philosophical question rather than a technical one, so I'll go ahead and rephrase it: "Should unit testing be applied to an existing code base that already works?" If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?

        led mike wrote:

        Couldn't you use LinFu to do that?

        I suppose LinFu could "dogfood" itself and put the tests everywhere, but that's beside the point. The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?

        P R 2 Replies Last reply
        0
        • P Philip Laureano

          led mike wrote:

          Couldn't you use LinFu to do that? [Confused] I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something.

          Hi Mike, Sorry for the confusion. This question is more of a philosophical question rather than a technical one, so I'll go ahead and rephrase it: "Should unit testing be applied to an existing code base that already works?" If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?

          led mike wrote:

          Couldn't you use LinFu to do that?

          I suppose LinFu could "dogfood" itself and put the tests everywhere, but that's beside the point. The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Philip Laureano wrote:

          The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?

          If you're never ever going to change the code again - no. If there's the possibility that the code could change - yes. The unit tests will help give you confidence that your code still works post changes, which is (obviously) hugely important.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          1 Reply Last reply
          0
          • P Philip Laureano

            led mike wrote:

            Couldn't you use LinFu to do that? [Confused] I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something.

            Hi Mike, Sorry for the confusion. This question is more of a philosophical question rather than a technical one, so I'll go ahead and rephrase it: "Should unit testing be applied to an existing code base that already works?" If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?

            led mike wrote:

            Couldn't you use LinFu to do that?

            I suppose LinFu could "dogfood" itself and put the tests everywhere, but that's beside the point. The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?

            R Offline
            R Offline
            Roger Alsing 0
            wrote on last edited by
            #5

            Philip Laureano wrote:

            If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?

            Why not simply add the tests once you do need to change the code? As you say, if it won't change then it's pretty pointless. On the other hand, you might find a bug or two in the existing code if you add tests.

            My Blog

            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