home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,815 of 33,346   
   Richard to All   
   Re: Unit Testing Frameworks (was Re: Sin   
   24 Jan 13 12:03:47   
   
   From: legalize+jeeves@mail.xmission.com   
      
   [Please do not mail me a copy of your followup]   
      
   Ian Collins  spake the secret code   
    thusly:   
      
   >Richard wrote:   
   >> Ian Collins  spake the secret code   
   >>  thusly:   
   >>   
   >>> Tobias Müller wrote:   
   >>>> That's the point exactly. With DI you make clear which parts of   
   >>>> the environment you are actually using.   
   >>>   
   >>> Maybe, but setting up a mock to enable a test should also make it   
   >>> clear.   
   >>   
   >> It does.  The problem with link-time substitution is that I can't   
   >> take one piece of code and make it use the link-time substitute and   
   >> have another piece of code that uses the real thing and have them   
   >> both live in the same executable.   
   >   
   >Which I'd consider to be positive.   
      
   Fine.  We disagree.  I say it sucks, you say it's the greatest thing   
   since sliced bread.   
      
   >> By using link-time substitution, I'm forced into having more test   
   >> executables than I need.   
   >   
   >Use a test framework or IDE that works with multiple executable.   
      
   Again, it sucks because it introduced unnecessary complexity into my   
   build system, whereas if I just use an interface and DI for   
   collaborators then all this stuff is under control of the test and I   
   don't have to retrofit a whole bunch of changes to my build.   
      
   >> If I use DI, then it's all under control fo the test and not the   
   >> *linker*.   
   >   
   >But you have to create test versions of the collaborators, you can't   
   >simply leave the job to the mocking framework.   
      
   That doesn't follow, unless you equivocate "mocking framework" with   
   "link time substitution".  Just exactly what "mocking framework" are   
   you talking about?   
      
   >I don't like making extra work for myself.   
      
   ...unless it's in your build system?   
      
   >I'm still waiting (but not holding my breath) for a real world   
   >example of why it's much easier to substitute the real code with the   
   >mock when using DI.   
      
   It's been my work experience at various employers since 2008.  That   
   code is not open source for me to share and isn't available to me at   
   this time.   
   --   
   "The Direct3D Graphics Pipeline" free book    
         The Computer Graphics Museum    
             The Terminals Wiki    
      Legalize Adulthood! (my blog)    
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca