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,810 of 33,346   
   Ian Collins to Richard   
   Re: Unit Testing Frameworks (was Re: Sin   
   23 Jan 13 12:03:39   
   
   From: ian-news@this.is.invalid   
      
   Richard wrote:   
   > [Please do not mail me a copy of your followup]   
   >   
   > Ian Collins  spake the secret code   
   >  thusly:   
   >   
   >> But haven't you added a new method to SUT just to avoid the coupling?   
   >   
   > Yes, because I have refactored the code in order to decouple.  This is   
   > all basic stuff done to retrofit tests onto legacy code (i.e. code   
   > without unit tests).  Nothing I'm proposing here is radical or   
   > mind-altering, it's pretty standard stuff.  See "Working Effectively   
   > with Legacy Code" by Michael Feathers.   
      
   I do own a well thumbed copy of that book.   
      
   It's strange that you only chose to respond to that one line in my post,   
   loosing the context from the original discussion.   
      
   > If I were writing this code from scratch, I'd be writing it TDD and it   
   > would already be decoupled from it's collaborators without making me   
   > use link-time substitution for them.   
      
   How do you decouple your code form any system calls it makes?  Your tone   
   suggests that you consider link-time substitution (or interposition)   
   something to be avoided rather then the commonly used testing technique   
   that it is.   
      
   > Writing manual mocks vs. generating them from an interface   
   > specification is orthogonal to decoupling from collaborators.   
      
   Whether you refactor to decouple is orthogonal to whether a singleton   
   makes testing harder which was the topic of this sub-thread.   
      
   --   
   Ian Collins   
      
      
         [ 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