Ron Jeffries | 1 Nov 2006 01:26
Favicon

Re: Modeling question

Hello, Adam.  On Tuesday, October 31, 2006, at 6:59:15 PM, you
wrote:

> All right, I see. I'm uninstalling all mock frameworks from my machine...

Be sure to format the hard drive ...

Ron Jeffries
www.XProgramming.com
Here is Edward Bear, coming downstairs now, bump, bump, bump, on the back
of his head. It is, as far as he knows, the only way of coming downstairs,
but sometimes he feels that there really is another way, if only he could
stop bumping for a moment and think of it. And then he feels that perhaps
there isn't. -- A. A. Milne

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:testdrivendevelopment-digest <at> yahoogroups.com 
(Continue reading)

Adam Dymitruk | 1 Nov 2006 01:41
Gravatar

Re: Modeling question

Just to be safe.. I want to be 100% mock free.

Adam

On 10/31/06, Ron Jeffries <ronjeffries <at> xprogramming.com> wrote:
>
>   Hello, Adam. On Tuesday, October 31, 2006, at 6:59:15 PM, you
> wrote:
>
> > All right, I see. I'm uninstalling all mock frameworks from my
> machine...
>
> Be sure to format the hard drive ...
>
> Ron Jeffries
> www.XProgramming.com
> Here is Edward Bear, coming downstairs now, bump, bump, bump, on the back
> of his head. It is, as far as he knows, the only way of coming downstairs,
> but sometimes he feels that there really is another way, if only he could
> stop bumping for a moment and think of it. And then he feels that perhaps
> there isn't. -- A. A. Milne
>
>  
>

[Non-text portions of this message have been removed]

 
Yahoo! Groups Links

(Continue reading)

unmesh joshi | 1 Nov 2006 01:54
Picon
Favicon

Starting agile multi-site development group on yahoo

  Hi All,

  I have started a new group on yahoo to discuss patterns and techniques for effective multi-site
development. Please feel free to join and discuss your experiences and ideas.

  http://tech.groups.yahoo.com/group/agilemultisitedevelopment/

  Thanks,
  Unmesh

 
---------------------------------
We have the perfect Group for you. Check out the handy changes to Yahoo! Groups.

[Non-text portions of this message have been removed]

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

George Dinwiddie | 1 Nov 2006 02:28
Favicon

Re: OT: You never /needed/ mocks but why are they bad?

Joakim Ohlrogge wrote:
> Thanks for your input. I have a few questions.
> 
>> I don't like mocks because they carry an assumption with them.  There is an assumption that
>> the way the class uses the mocked interface is the way the class should use the real object.
> 
> Isn't that a fair assumption?

Ummm... no.  I could write a MockFile that expected the close to happen 
before the read.  That's not the way the client class should use a real 
File object.

--

-- 
  ----------------------------------------------------------------------
   * George Dinwiddie *                    gdinwiddie <at> idiacomputing.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
(Continue reading)

Tamas Szabo | 1 Nov 2006 03:08
Picon
Favicon

Re: Modeling question

Hi Ron,

--- Ron Jeffries <ronjeffries <at> XProgramming.com> wrote:

> Hello, Tamas. Some observations below ...
> 
> At the Simple Design and Testing conference, J.B.
> was talking about
> mocks and how he uses them very frequently, and I
> was thinking about
> how I almost never use them. I came up with this
> idea, which might
> explain the difference.
> 
> I build up class's behavior in tiny steps, using
> "fake it till you
> make it" to stub out behavior within the real class
> until it is time
> to implement it. Most people who use mocks are
> really using simple
> stubs or other forms of "Test Double" much of the
> time. So my guess
> is that I may need many fewer mocks, because I build
> Test Double
> behavior into my classes as I build them up, and
> replace it with
> real behavior as I complete them.

I hope I got this right...are you saying that?:
Let's say that you test first class A, when you decide
(Continue reading)

George Dinwiddie | 1 Nov 2006 02:50
Favicon

Re: Modeling question

Ron Jeffries wrote:
> In times of stress, I like to turn to the wisdom of my Portuguese waitress,
> who said: "Olá, meu nome é Marisol e eu serei sua garçonete."
>   -- after Mark Vaughn, Autoweek.

True wisdom, indeed.  If only Marisol were here right now, my problem 
would be solved.

-- 
  ----------------------------------------------------------------------
   * George Dinwiddie *                    gdinwiddie <at> idiacomputing.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:testdrivendevelopment-digest <at> yahoogroups.com 
(Continue reading)

George Dinwiddie | 1 Nov 2006 02:42
Favicon

Re: Modeling question

Tamas Szabo wrote:
> And what do you do if N uses M? And you need that
> dependency because it is used by the method N::n1()
> which is called by Q::Z?

If you're working with legacy code, you do what you can.

If you're designing the code, don't do that.  Long dependency chains are 
a definite design smell.  They make the code hard to change for the same 
reasons they make it hard to test.

  - George

--

-- 
  ----------------------------------------------------------------------
   * George Dinwiddie *                    gdinwiddie <at> idiacomputing.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
(Continue reading)

Ron Jeffries | 1 Nov 2006 03:39
Favicon

Re: Modeling question

Hello, Tamas.  On Tuesday, October 31, 2006, at 9:08:33 PM, you
wrote:

> I hope I got this right...are you saying that?:
> Let's say that you test first class A, when you decide
> that one of its method will need B. You create a class
> B with a fake method. Later on you implement B.

> The first question that pops up is how do you test A
> for different return values or exceptions thrown by B?

Well, I don't generally test for exceptions because I don't
generally use them. I strive to write code that works, not code that
fails. (I mean that in the nicest possible way.)

I might test B directly. I might test A. But anything that B returns
is something that A wants, and therefore some test of A presumably
exercises that.

> I'm also interested what do you do if B uses another
> class? And that another class? How do you test A? Do
> you have to create all the classes that collaborate,
> don't you?

Depends. Generally a class that uses some other class creates the
instance it wants. Why create a big constellation, when the
constellation can create itself as things go on.

> To put it in another way: I think Martin Fowler says
> in Refactoring, that OOP apps seems to be confusing at
(Continue reading)

Tamas Szabo | 1 Nov 2006 04:25
Picon
Favicon

Re: Modeling question

--- Phlip <phlip2005 <at> gmail.com> wrote:

> Tamas wrote:
> 
> > Well, I am getting to far qway from the subject...
> my
> > point is just that I expected a more explicit
> > description of why Mocks are so bad.
> 
> Because we are not here to TDD mocks. We are here to
> TDD production code.
> 
> What if your Mock worked flawlessly but your
> production code had a
> bug, and one little test case could have caught that
> by indirectly
> calling that production code?

That little test should be one of the tests of the
production code we were Mocking. Or it should be an
integration test. Do Mocks stop you in using
integration tests as well?

> TDD is not "unit" testing, where each test failure
> implicates only one
> unit. TDD is "developer testing", where each test
> failure implicates
> the most recent edits. So the failure should be
> expected to happen
> anywhere, even in units other than the one we
(Continue reading)

Phlip | 1 Nov 2006 05:55
Picon
Gravatar

Re: Modeling question

> If someone used a mock where they could have used a stub-object, isn't
> that an OAOO violation?

I just thought of the answer.

The "OAOO" mantra is a way to seek missing abstractions and latent
patterns. A mock isn't pattern-worthy; it's just a convenience object.
So merging it with its mocked object (producing a Stub Object) might
be a worthy goal, but it's not subject to the OAOO aspects of Emergent
Design.

--

-- 
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:testdrivendevelopment-digest <at> yahoogroups.com 
(Continue reading)


Gmane