Boost logo

Boost Users :

From: Dave Steffen (dgsteffen_at_[hidden])
Date: 2006-09-15 16:41:29


Sohail Somani writes:
> > -----Original Message-----
> > From: boost-users-bounces_at_[hidden]
> > [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> > Aubrey, Jason
>
> > Note1: I've no idea if a formal name for this pattern exists, if
> > not it does now :) Note2: I recognize the security issues with
> > this; however, if it's truly an issue I suppose the pImpl
> > (i.e. pointer to implementation) idiom can be used in tandom so
> > things are truly private from the client.
>
> I just wonder: whats the big deal with breaking all the encapsulation
> rules to do unit tests?

 Do you mean:
    "why are people breaking encapsulation rules for unit tests?"
 or
    "why do people worry about breaking encapsulation rules
     for unit tests?"

If 1), the answer is "to write unit tests that directly test private
member functions and examine private member data"; in effect, "white
box" testing where the test can look at the guts of the thing being
tested and see what's happening.

if 2), I'm not worried at all about doing it, and I don't think anyone
else is, either. The question I originally asked, and to which I've
gotten many good answers, was not "should I" but "what techniques are
other people using to" do it.

----------------------------------------------------------------------
Dave Steffen, Ph.D.
Software Engineer IV Disobey this command!
Numerica Corporation
ph (970) 419-8343 x27
fax (970) 223-6797 - Douglas Hofstadter
dgsteffen_at_[hidden]
___________________
Numerica Disclaimer:
This message and any attachments are intended only for the individual
or entity to which the message is addressed. It is proprietary and
may contain privileged information. If you are neither the intended
recipient nor the agent responsible for delivering the message to the
intended recipient, you are hereby notified that any review,
retransmission, dissemination, or taking of any action in reliance
upon, the information in this communication is strictly prohibited,
and may be unlawful. If you feel you have received this communication
in error, please notify us immediately by returning this Email to the
sender and deleting it from your computer.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net