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. It's OK Not to Write Unit Tests

It's OK Not to Write Unit Tests

Scheduled Pinned Locked Moved The Lounge
csharpc++comtestingbeta-testing
46 Posts 24 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.
  • N Offline
    N Offline
    Nemanja Trifunovic
    wrote on last edited by
    #1

    A very nice article that describes my pain points with unit testing as well[^].

    utf8-cpp

    L P S C J 15 Replies Last reply
    0
    • N Nemanja Trifunovic

      A very nice article that describes my pain points with unit testing as well[^].

      utf8-cpp

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      *Deep heartfelt growl* Too many people think a long test report means the tests have some value. Don't get me started. :mad:

      Join the cool kids - Come fold with us[^]

      1 Reply Last reply
      0
      • N Nemanja Trifunovic

        A very nice article that describes my pain points with unit testing as well[^].

        utf8-cpp

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        I once was like you. Testing is nice and such, but mocking this and mocking that is a pain. That is, until I found the perfect product for me. Why should I ever have to mock a file system or database access, If there's a packaged product that does this for me? Once you recognize that it is silly of thousands of developers to individually mock tiny fragments, you realize there must be a complete, mroe holistic approach. MockOS[^] - all my unit tests run on it. :cool:

        Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
        | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server

        S 1 Reply Last reply
        0
        • N Nemanja Trifunovic

          A very nice article that describes my pain points with unit testing as well[^].

          utf8-cpp

          S Offline
          S Offline
          Single Step Debugger
          wrote on last edited by
          #4

          Nemanja, correct me if I’m wrong, but I think this entire “unit testing” madness originates from Java. Regarding my experience lot of the Java dedicated programmers are also enthusiastic in writing unit tests.

          The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.

          N M 2 Replies Last reply
          0
          • S Single Step Debugger

            Nemanja, correct me if I’m wrong, but I think this entire “unit testing” madness originates from Java. Regarding my experience lot of the Java dedicated programmers are also enthusiastic in writing unit tests.

            The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.

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

            Deyan Georgiev wrote:

            I think this entire “unit testing” madness originates from Java

            IMHO, it is from Smalltalk - switched to Java folks. The same crowd that invented "Extreme Programming", "Design Patterns", etc. Anyway, I am happy to see that even Java programmers are comming to their senses[^]

            utf8-cpp

            S D 2 Replies Last reply
            0
            • N Nemanja Trifunovic

              Deyan Georgiev wrote:

              I think this entire “unit testing” madness originates from Java

              IMHO, it is from Smalltalk - switched to Java folks. The same crowd that invented "Extreme Programming", "Design Patterns", etc. Anyway, I am happy to see that even Java programmers are comming to their senses[^]

              utf8-cpp

              S Offline
              S Offline
              Single Step Debugger
              wrote on last edited by
              #6

              Nemanja Trifunovic wrote:

              IMHO, it is from Smalltalk - switched to Java folks. The same crowd that invented "Extreme Programming", "Design Patterns", etc.

              We need to uninvent them.

              The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.

              1 Reply Last reply
              0
              • S Single Step Debugger

                Nemanja, correct me if I’m wrong, but I think this entire “unit testing” madness originates from Java. Regarding my experience lot of the Java dedicated programmers are also enthusiastic in writing unit tests.

                The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.

                M Offline
                M Offline
                MidwestLimey
                wrote on last edited by
                #7

                I once spent 3 months writing a reporting API in C# that spat out Excel docs sucking data from a localized data cube. Now the sales guys and gals could wow potential clients and it was generally well received. 'Twas a thing of surprising beauty considering it featured the words "Excel" and "reporting" in it. Then a Java guy plodded over and wanted to see the Unit Tests. I had none. He pointed out it was policy, and demanded to know how I could qualify a generated report. I jokingly suggested that I build an Excel document parser and run it against different templates based on desired output. He was not amused. Then I ran the app, set it for one year for one product variety and ran the report. I handed the printout to an Argentinean sales rep who happened to be in the office to see a demo. He said it looked good. Unit test complete.

                10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011

                F K 2 Replies Last reply
                0
                • N Nemanja Trifunovic

                  A very nice article that describes my pain points with unit testing as well[^].

                  utf8-cpp

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  Wow, I thought unit testing was all about focusing on the functionality of a quite logical independent unit, "not (a) test (that) cannot talk to a database, communicate across the network, touch the filesystem, run concurrently with another test, or require extensive setup. If they are any dependencies, they are mocked away". Dogmatic approaches are pretty useless for me. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  P K 2 Replies Last reply
                  0
                  • C CPallini

                    Wow, I thought unit testing was all about focusing on the functionality of a quite logical independent unit, "not (a) test (that) cannot talk to a database, communicate across the network, touch the filesystem, run concurrently with another test, or require extensive setup. If they are any dependencies, they are mocked away". Dogmatic approaches are pretty useless for me. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    Right. If I write a method that connects to a database and I want to unit test it, it had better connect to an actual database.

                    J 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Right. If I write a method that connects to a database and I want to unit test it, it had better connect to an actual database.

                      J Offline
                      J Offline
                      Judah Gabriel Himango
                      wrote on last edited by
                      #10

                      That's not "against the law" when writing tests. What you just described is an integration test.

                      Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                      P 1 Reply Last reply
                      0
                      • N Nemanja Trifunovic

                        A very nice article that describes my pain points with unit testing as well[^].

                        utf8-cpp

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

                        From the article: Unit testing is no substitute for adversarial testing. A man after my own heart. Too many companies think that testers should be chums with engineering. That's dumb. Testers should have an adversarial relationship with engineering; their job isn't to prove a product works, but that it doesn't. Another way to put it is that testers should think engineers are arrogant assholes and set out to prove it. Engineering should be attempting prove otherwise. That said, I do think "unit" testing has it's place. When I write libraries and classes, I want to make sure they work the way I designed them to work. Writing them in a slightly more organized way helps me to debug them as well. (One of the beefs I do have with many testing suites is that they are awful in helping you debug.) However, I never for a moment believe that I'm doing anything but testing low level functionality and that it's any substitute for system/integration testing. (I'd even say that if my company were big enough and we had a separate testing department, they wouldn't use any of my tests. They'd write their own!) (I should point out that I use "unit" testing quite loosely here. When testing classes, I test them as a class. I just rewrote a Trie class; my test put stuff in and looked it up--I tested only the public interfaces, which tests the protected/private interfaces. But what about those private interfaces that aren't used by the public interfaces? There aren't any.)

                        L K 2 Replies Last reply
                        0
                        • N Nemanja Trifunovic

                          A very nice article that describes my pain points with unit testing as well[^].

                          utf8-cpp

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

                          Nemanja Trifunovic wrote:

                          A very nice article that describes my pain points with unit testing as well[^].

                          Actually, I found the article to be overly abstract, convoluted, and ultimately pointless. It certainly didn't pass my "mental unit test." It was the comments to the article that kept my interest, and frankly were much better than the article itself (and a lot more entertaining!) Marc

                          Will work for food. Interacx

                          I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner

                          1 Reply Last reply
                          0
                          • J Judah Gabriel Himango

                            That's not "against the law" when writing tests. What you just described is an integration test.

                            Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango

                            P Offline
                            P Offline
                            PIEBALDconsult
                            wrote on last edited by
                            #13

                            Judah Himango wrote:

                            is an integration test

                            I don't quite see it that way; in my opinion, connecting to A database isn't the same as connecting to THE database.

                            M 1 Reply Last reply
                            0
                            • P peterchen

                              I once was like you. Testing is nice and such, but mocking this and mocking that is a pain. That is, until I found the perfect product for me. Why should I ever have to mock a file system or database access, If there's a packaged product that does this for me? Once you recognize that it is silly of thousands of developers to individually mock tiny fragments, you realize there must be a complete, mroe holistic approach. MockOS[^] - all my unit tests run on it. :cool:

                              Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
                              | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server

                              S Offline
                              S Offline
                              Shog9 0
                              wrote on last edited by
                              #14

                              peterchen wrote:

                              Testing is nice and such, but mocking this and mocking that is a pain.

                              I just mock my own code. It saves a lot of trouble (and bruised egos) in the long run... :rolleyes:

                              1 Reply Last reply
                              0
                              • N Nemanja Trifunovic

                                A very nice article that describes my pain points with unit testing as well[^].

                                utf8-cpp

                                M Offline
                                M Offline
                                Member 96
                                wrote on last edited by
                                #15

                                Unit tests like so much methodology these days are simply ways to commoditize software development. Nothing more, nothing less and like cows to slaughter most developers eat up these kinds of methodologies like candy all the while ignoring the fact that these were designed primarily to make us replaceable worthless cogs in a big machine of corporate development. Unit tests are on most levels counterproductive and worthless to any decent software developer who can recognize bad code before or while they are writing it and nip it in the bud. They're great for accounting and managerial types though so .... yay for them! :) Software developers used to be gods in their domain, now they're just easily replaced cogs in a giant machine of mediocrity and have no one to blame but themselves when their work can be easily outsourced or indeed they themselves can be easily replaced with someone cheaper and less experienced.


                                "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

                                C K 2 Replies Last reply
                                0
                                • N Nemanja Trifunovic

                                  A very nice article that describes my pain points with unit testing as well[^].

                                  utf8-cpp

                                  G Offline
                                  G Offline
                                  Giorgi Dalakishvili
                                  wrote on last edited by
                                  #16

                                  One more nice article about unit testing[^]

                                  Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

                                  1 Reply Last reply
                                  0
                                  • N Nemanja Trifunovic

                                    A very nice article that describes my pain points with unit testing as well[^].

                                    utf8-cpp

                                    M Offline
                                    M Offline
                                    macu
                                    wrote on last edited by
                                    #17

                                    I think the main problem with unit testing is the assumption that anyone can right a "complete" set of tests. If anyone was capable of doing that their code probably wouldn't need testing in the first place because they'd have covered all scenarios in the code itself as well. But the thing I love about unit testing is the fact that you can test stuff in minutes that would literally take hours to test properly otherwise. For example you've got a web app in which you need to login, navigate down a couple of pages then fill in a form then click GO! The old approach to testing starts when you click GO! With unit testing you can simulate the login process and the form data and have a whole range of tests without needing to use a browser or make up another set of form data. In practice I've found it means you test stuff much more thouroughly even if that doesn't mean "completely" and also that you can test those bits of code that may never have been touched by navigating through some front end or other in order to do your testing.

                                    1 Reply Last reply
                                    0
                                    • M Member 96

                                      Unit tests like so much methodology these days are simply ways to commoditize software development. Nothing more, nothing less and like cows to slaughter most developers eat up these kinds of methodologies like candy all the while ignoring the fact that these were designed primarily to make us replaceable worthless cogs in a big machine of corporate development. Unit tests are on most levels counterproductive and worthless to any decent software developer who can recognize bad code before or while they are writing it and nip it in the bud. They're great for accounting and managerial types though so .... yay for them! :) Software developers used to be gods in their domain, now they're just easily replaced cogs in a giant machine of mediocrity and have no one to blame but themselves when their work can be easily outsourced or indeed they themselves can be easily replaced with someone cheaper and less experienced.


                                      "Creating your own blog is about as easy as creating your own urine, and you're about as likely to find someone else interested in it." -- Lore Sjöberg

                                      C Offline
                                      C Offline
                                      ciricivan
                                      wrote on last edited by
                                      #18

                                      Amin :)

                                      1 Reply Last reply
                                      0
                                      • P PIEBALDconsult

                                        Judah Himango wrote:

                                        is an integration test

                                        I don't quite see it that way; in my opinion, connecting to A database isn't the same as connecting to THE database.

                                        M Offline
                                        M Offline
                                        Member 3346080
                                        wrote on last edited by
                                        #19

                                        So it's a mock database

                                        1 Reply Last reply
                                        0
                                        • J Joe Woodbury

                                          From the article: Unit testing is no substitute for adversarial testing. A man after my own heart. Too many companies think that testers should be chums with engineering. That's dumb. Testers should have an adversarial relationship with engineering; their job isn't to prove a product works, but that it doesn't. Another way to put it is that testers should think engineers are arrogant assholes and set out to prove it. Engineering should be attempting prove otherwise. That said, I do think "unit" testing has it's place. When I write libraries and classes, I want to make sure they work the way I designed them to work. Writing them in a slightly more organized way helps me to debug them as well. (One of the beefs I do have with many testing suites is that they are awful in helping you debug.) However, I never for a moment believe that I'm doing anything but testing low level functionality and that it's any substitute for system/integration testing. (I'd even say that if my company were big enough and we had a separate testing department, they wouldn't use any of my tests. They'd write their own!) (I should point out that I use "unit" testing quite loosely here. When testing classes, I test them as a class. I just rewrote a Trie class; my test put stuff in and looked it up--I tested only the public interfaces, which tests the protected/private interfaces. But what about those private interfaces that aren't used by the public interfaces? There aren't any.)

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #20

                                          I don't have an adverserial relationship, I test to test. Some people test to pass, some test to fail and each approach has it's own risks.

                                          Join the cool kids - Come fold with us[^]

                                          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