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. The Lounge
  3. Testing Existing Code

Testing Existing Code

Scheduled Pinned Locked Moved The Lounge
ai-testingtestingbeta-testingquestion
12 Posts 9 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.
  • B Offline
    B Offline
    blackjack2150
    wrote on last edited by
    #1

    The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

    R N N S K 5 Replies Last reply
    0
    • B blackjack2150

      The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      blackjack2150 wrote:

      Automated Testing'

      To me, this is very tight to Unit Testing. Automated means (to me, again) checking out the code during the night, compiling and running all unit testing on a dedicated test computer. This is what "automated" stands for. As you come in on morning you have a mail with the test results waiting for you, especially those that failed.

      1 Reply Last reply
      0
      • B blackjack2150

        The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

        N Offline
        N Offline
        Nagy Vilmos
        wrote on last edited by
        #3

        Automated testing generally refers to programatic, rather then user, testing and is used for regression testing of an application. In test driven development you may well create a script to test what is being developed, e.g. JTest in Java, and then run the script at each iteration. Now the important bit is to keep all these tests and after eighteen years and three months, you have 863,497 scripts. By combining them there is your 'automated testing' its fun and at every release you can nearly always guarantee that 612 tests will fail. This is hopefully because the test case is no longer valid, rather then some monkey has stollen all the peanuts.


        Panic, Chaos, Destruction. My work here is done.

        L 1 Reply Last reply
        0
        • N Nagy Vilmos

          Automated testing generally refers to programatic, rather then user, testing and is used for regression testing of an application. In test driven development you may well create a script to test what is being developed, e.g. JTest in Java, and then run the script at each iteration. Now the important bit is to keep all these tests and after eighteen years and three months, you have 863,497 scripts. By combining them there is your 'automated testing' its fun and at every release you can nearly always guarantee that 612 tests will fail. This is hopefully because the test case is no longer valid, rather then some monkey has stollen all the peanuts.


          Panic, Chaos, Destruction. My work here is done.

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          williamnw wrote:

          Now the important bit is to keep all these tests and after eighteen years and three months, you have 863,497 scripts. By combining them there is your 'automated testing' its fun and at every release you can nearly always guarantee that 612 tests will fail. This is hopefully because the test case is no longer valid, rather then some monkey has stollen all the peanuts.

          And what happens when there is an extra failure? Do you need to go through all 613 failures to find it? Or does it get simply ignored like the other 612 failures? Broken unit tests are worse than anything else.

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 4a out now (29 May 2008)

          N 1 Reply Last reply
          0
          • L leppie

            williamnw wrote:

            Now the important bit is to keep all these tests and after eighteen years and three months, you have 863,497 scripts. By combining them there is your 'automated testing' its fun and at every release you can nearly always guarantee that 612 tests will fail. This is hopefully because the test case is no longer valid, rather then some monkey has stollen all the peanuts.

            And what happens when there is an extra failure? Do you need to go through all 613 failures to find it? Or does it get simply ignored like the other 612 failures? Broken unit tests are worse than anything else.

            xacc.ide - now with TabsToSpaces support
            IronScheme - 1.0 alpha 4a out now (29 May 2008)

            N Offline
            N Offline
            Nagy Vilmos
            wrote on last edited by
            #5

            leppie wrote:

            does it get simply ignored

            Oh no! That's the fun of having the automated testing. It automatically provides work as either the script (the usual case) or the code needs to be changed.

            leppie wrote:

            Broken unit tests are worse than anything else

            What about missing unit tests?


            Panic, Chaos, Destruction. My work here is done.

            S 1 Reply Last reply
            0
            • B blackjack2150

              The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

              N Offline
              N Offline
              Nemanja Trifunovic
              wrote on last edited by
              #6

              Automated testing refers just to the way of running the tests and analyzing the rezults. For instance, I have rarely had an opportunity to develop unit tests (only once, IIRC), but have used automated tests for functional, integration and regression testing.

              Programming Blog utf8-cpp

              1 Reply Last reply
              0
              • B blackjack2150

                The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

                S Offline
                S Offline
                Simon P Stevens
                wrote on last edited by
                #7

                Automated testing is writing tests that run automatically. To me, the most important reason to have them is that when in 6 months time you come to write some additional features to the app, you can run all the automated tests again to make sure you didn't break anything. Any app you currently have that doesn't have unit tests you should add them to if you are going to extend the app before making any extensions. They protect against breaking existing functionality while writing the new. My test scripts are _fully_ automated with the build. By that I mean that absolutely everything is done automatically, right from creating databases at the start, running all the tests, and deleting or restoring databases at the end. And yeah, sometimes I make a few changes and a unit test breaks, and it turns out maybe some assumption in the test was wrong, but this is also useful, it means I take another look at the area and often end up writing a few extra test cases to cover the missed assumptions.

                Simon

                1 Reply Last reply
                0
                • N Nagy Vilmos

                  leppie wrote:

                  does it get simply ignored

                  Oh no! That's the fun of having the automated testing. It automatically provides work as either the script (the usual case) or the code needs to be changed.

                  leppie wrote:

                  Broken unit tests are worse than anything else

                  What about missing unit tests?


                  Panic, Chaos, Destruction. My work here is done.

                  S Offline
                  S Offline
                  Simon P Stevens
                  wrote on last edited by
                  #8

                  williamnw wrote:

                  leppie wrote: Broken unit tests are worse than anything else What about missing unit tests?

                  Nope, both wrong. The worst is unit tests that exist, pass fine, but don't actually test anything. Where I used to work someone had written a unit test and got some logic wrong in it and basically the test could never fail It hide a bug that should have been highlighted earlier. So there was the confidence gained by unit testing, but non of the actual advantages. :laugh:

                  Simon

                  L P M 3 Replies Last reply
                  0
                  • B blackjack2150

                    The trend is now that everybody does (or talks about) Unit Testing. There are two terms which are commonly used: 'Automated Testing' and 'Test Driven Development'. The meaning of the later is clear to me. You write tests before the code, thus not allowing errors to slip in the code. (test-fail-code-pass methodology). But what does 'Automated Testing' really refer to? Is it a method that can be applied for an existing code base? The terminology suggests so, but it may also be misleading. In other words: Is there a productive way to test existing code in an efficient manner? (not manual) Thanks.

                    K Offline
                    K Offline
                    Kevin McFarlane
                    wrote on last edited by
                    #9

                    blackjack2150 wrote:

                    Is there a productive way to test existing code in an efficient manner?

                    There's a book called Working Effectively with Legacy Code[^] that appears to be helpful for this task. I have the book. Unfortunately I haven't had time to do more than read the first chapter or two. That's why I say "appears to be helpful." :) BTW, his definition of "legacy code" is code without tests. He justifies this definition in the preface.

                    Kevin

                    1 Reply Last reply
                    0
                    • S Simon P Stevens

                      williamnw wrote:

                      leppie wrote: Broken unit tests are worse than anything else What about missing unit tests?

                      Nope, both wrong. The worst is unit tests that exist, pass fine, but don't actually test anything. Where I used to work someone had written a unit test and got some logic wrong in it and basically the test could never fail It hide a bug that should have been highlighted earlier. So there was the confidence gained by unit testing, but non of the actual advantages. :laugh:

                      Simon

                      L Offline
                      L Offline
                      leppie
                      wrote on last edited by
                      #10

                      [Test]
                      public void TestEverything()
                      {
                      Assert.IsTrue(true); // brillant!
                      }

                      xacc.ide - now with TabsToSpaces support
                      IronScheme - 1.0 alpha 4a out now (29 May 2008)

                      1 Reply Last reply
                      0
                      • S Simon P Stevens

                        williamnw wrote:

                        leppie wrote: Broken unit tests are worse than anything else What about missing unit tests?

                        Nope, both wrong. The worst is unit tests that exist, pass fine, but don't actually test anything. Where I used to work someone had written a unit test and got some logic wrong in it and basically the test could never fail It hide a bug that should have been highlighted earlier. So there was the confidence gained by unit testing, but non of the actual advantages. :laugh:

                        Simon

                        P Offline
                        P Offline
                        Pawel Krakowiak
                        wrote on last edited by
                        #11

                        Simon Stevens wrote:

                        So there was the confidence gained by unit testing, but non of the actual advantages.

                        It's always emphasized that unit tests don't guarantee your code is correct, but yeah...

                        1 Reply Last reply
                        0
                        • S Simon P Stevens

                          williamnw wrote:

                          leppie wrote: Broken unit tests are worse than anything else What about missing unit tests?

                          Nope, both wrong. The worst is unit tests that exist, pass fine, but don't actually test anything. Where I used to work someone had written a unit test and got some logic wrong in it and basically the test could never fail It hide a bug that should have been highlighted earlier. So there was the confidence gained by unit testing, but non of the actual advantages. :laugh:

                          Simon

                          M Offline
                          M Offline
                          Mike Dimmick
                          wrote on last edited by
                          #12

                          Yes, I think this is Microsoft's problem now. They've either fired, or moved, all their STEs (Software Test Engineers). They now only have SDE/Ts (Software Design Engineers in Test). The difference is that STEs used to test all the code by hand, while SDE/Ts write code to exercise it. An SDE/T can perform many more tests repeatably on a given build, in a given timeframe, but it requires much more effort to add a new test to the suite and to verify that the test is actually testing what it should do. I think there's a massive problem with false negatives (i.e. the test didn't fire, but should have).

                          DoEvents: Generating unexpected recursion since 1991

                          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