Loading ...
Sorry, an error occurred while loading the content.
 

Hi & XP & Bypassing the "private" keyword

Expand Messages
  • Patrick_X99@hotmail.com
    Hi, I was referred to this discussion from Ward s wiki (http://c2.com/cgi/wiki?UnUnitTestableUnits) and enjoyed the points made, especially about how XP came
    Message 1 of 1 , Oct 1, 2000
      Hi,

      I was referred to this discussion from Ward's wiki
      (http://c2.com/cgi/wiki?UnUnitTestableUnits) and enjoyed the points
      made, especially about how XP came from Smalltalk (I'm a big fan of
      Squeak! (http://www.squeak.org))and was intrigued by the last post
      about JUnitX, which I had not heard of before.

      [I'm in the unique position of being called in to unit test other
      peoples code for them. I assume not it's not very XP, but so far so
      good.]

      A problem came in when I encountered classes with a lot of private
      method encapsulation (which IMHO should have been protected, but I'm
      not in a position to change this). Now, some of you say private
      methods should not be unit tested. I would disagree if those said
      private methods are complex and their complexity can not be exercised
      in full through public methods.

      I just remembered an article I read by Mark LaDue
      (http://www.rstcorp.com/hostile-applets/deviant2.html)
      which included the java source to change everything in a directory's
      class files into public access level
      (http://www.rstcorp.com/hostile-applets/PublicEnemy.java). Obviously,
      this could this be useful in my situation (and perhaps as an option
      for JUnitX :). The only problem is, nobody else would be able to use
      the test cases that rely on the trick, unless they also had it.

      --Patrick Parker
    Your message has been successfully submitted and would be delivered to recipients shortly.