Franz Allan Valencia See | 1 Mar 02:32 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

Interesting. It's been awhile since I've played with GWT. May I ask for a
simple example of what you mean? :-)

Thanks,
-- 
Franz Allan Valencia See | Java Software Engineer
franz.see <at> gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Fri, Feb 26, 2010 at 9:48 PM, Josue Barbosa dos Santos <
josuesantos <at> gmail.com> wrote:

> On Thu, Feb 25, 2010 at 11:35 PM, Franz Allan Valencia See
> > How about displaying info in the UI?
> >
> > i.e. Viewing of personal information in a webapp from a data source. And
> if
> > there are layering, then each layer would probably have to ask for that
> > information till the presentation layer gets it.
> >
> > WDYT?
>
> I think if you use a MVP pattern, for example, the presenter will tell de
> UI
> de information.  I am working with GWT and this is possible in that
> framework (and one of others reasons that I like GWT so much.). I think
> that
> is not always possible in all views/presentation frameworks.
>
(Continue reading)

J. B. Rainsberger | 1 Mar 02:36 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

On Sun, Feb 28, 2010 at 12:27 PM, Joshua Kerievsky
<jlk <at> industriallogic.com> wrote:

> Injecting a canvas into a formatter isn't an improvement if such flexibility
> isn't required. We have no such requirement.

There is a minor improvement in the precision on the names and in the
cohesion of the code, especially if your design preference is to put
small things together, rather than break big things apart. I certainly
agree with you that we can easily add the flexibility when we actually
need it.
--
J. B. (Joe) Rainsberger :: http://www.jbrains.ca ::
http://www.thecodewhisperer.com
Your guide to software craftsmanship
JUnit Recipes: Practical Methods for Programmer Testing
2005 Gordon Pask Award for contribution Agile Software Practice

------------------------------------

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)

J. B. Rainsberger | 1 Mar 02:34 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

On Fri, Feb 26, 2010 at 8:28 AM, Sebastian <paymentexpert <at> yahoo.de> wrote:

> sorry, this is a little bit off topic but in your presentation "Integration Tests are a Scam" you said that
the number of tests required to cover a certain amount of code would increase with the factorial of the
lines of code under test.
> How do you get to this result?

I don't remember saying "the factorial of the lines of code under
test", because I don't think that's right. I might have said it, but
if I did, I regret saying it.

The number of tests required to cover a system is combinatoric over
the code paths in each layer. In other words, if your layers have 2,
4, 8, 6, 2, 3, and 7 codepaths respectively, then you need
approximately 2*4*8*6*2*3*7 tests.

Alternately, we can estimate the number of tests as O(c^n) where we
have on average c codepaths per layer and n layers.
--
J. B. (Joe) Rainsberger :: http://www.jbrains.ca ::
http://www.thecodewhisperer.com
Your guide to software craftsmanship
JUnit Recipes: Practical Methods for Programmer Testing
2005 Gordon Pask Award for contribution Agile Software Practice

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
(Continue reading)

J. B. Rainsberger | 1 Mar 02:41 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

On Sun, Feb 28, 2010 at 1:06 PM, Joshua Kerievsky
<jlk <at> industriallogic.com> wrote:

> FWIW, I like "Simulator" over "Lightweight Implementation" because something
> like HSQLDB is a non-trivial piece of faking technology and doesn't feel so
> "lightweight." We say "Simulator" when a fake is a lot more work to produce
> than a simple test-double.

Here I mean "lightweight" compared to the real thing, and not in some
absolute sense. Compared to a standard RDBMS, anything that doesn't
touch a disk is lightweight.

I've been saying "simulator" somewhat synonymously with "test double",
and I want to rethink that.

> We once storytest-drove a Simulator for a complicated hardware/software
> product. That Simulator was key in clearly communicating how the hardware
> was supposed to work. The hardware folks were thousands of miles away from
> the software team. Creation of the Simulator acted almost as a
> communication bridge between the two highly distributed teams.

This fits with the traditional notion of simulator. I like that.

> I'm surprised to hear you say you try to replace "Lightweight
> Implementations" with test doubles at your earliest convenience. We have no
> plans to replace HSQLDB since it is functioning just fine for our faking
> purposes.

I merely shared what I do; I didn't judge what you did. I use HSQLDB
when test doubles aren't yet convenient.
(Continue reading)

Adam Sroka | 1 Mar 02:57 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

I don't know about lines of code, but it makes sense if we look at the
number of unique objects. The upper bound would be O(n!) combinations if the
object graph were strongly connected (i.e. each object has a direct
relationship to every other object in the system.) Minimally no object would
have a direct relationship to more than a single other object. That would be
O(n). The average is somewhere between those (I would estimate about O(n^2)
but I haven't tried to prove it.) Remember that relationships between
objects are directional.

On Sun, Feb 28, 2010 at 5:34 PM, J. B. Rainsberger <jbrains762 <at> gmail.com>wrote:

>
>
> On Fri, Feb 26, 2010 at 8:28 AM, Sebastian <paymentexpert <at> yahoo.de<paymentexpert%40yahoo.de>>
> wrote:
>
> > sorry, this is a little bit off topic but in your presentation
> "Integration Tests are a Scam" you said that the number of tests required to
> cover a certain amount of code would increase with the factorial of the
> lines of code under test.
> > How do you get to this result?
>
> I don't remember saying "the factorial of the lines of code under
> test", because I don't think that's right. I might have said it, but
> if I did, I regret saying it.
>
> The number of tests required to cover a system is combinatoric over
> the code paths in each layer. In other words, if your layers have 2,
> 4, 8, 6, 2, 3, and 7 codepaths respectively, then you need
> approximately 2*4*8*6*2*3*7 tests.
(Continue reading)

Franz Allan Valencia See | 1 Mar 02:58 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

This is interesting. Here are probably some factors that affects me having a
substantial amount of 'ask'.

My style is usually top-down, which means I almost always start with UI. And
like most systems, I deal with a lot more with 'ask' than 'tell' (aka. a lot
more read than write, or a lot more R than C.U.D).

Of course, there would be business rules & flows in there and some
interesting infrastructure, but since most data comes from the data source,
there's usually quite a bunch of retrieval from the data source before
something intelligent can be done.

I wonder how others manage this.

Thanks,

--

-- 
Franz Allan Valencia See | Java Software Engineer
franz.see <at> gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Fri, Feb 26, 2010 at 9:03 PM, J. B. Rainsberger <jbrains762 <at> gmail.com>wrote:

>
>
> ...This is exactly the example that Franz mentioned. Again, I don't claim
> it's wise to do, but I wonder what web presentation would look like
> without asking. I wonder whether the web UI paradigm itself forces us
> to ask.
(Continue reading)

Joshua Kerievsky | 1 Mar 03:51 2010

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

On Sun, Feb 28, 2010 at 5:41 PM, J. B. Rainsberger <jbrains762 <at> gmail.com>wrote:

> I merely shared what I do; I didn't judge what you did. I use HSQLDB
> when test doubles aren't yet convenient.
>

I'm not judging, just voicing confusion about your statement.  HSQLDB
provides fake DB behavior without one lifting a finger (i.e. writing test
code).  What could be more convenient than that?

-- 
best regards,
jk

Industrial Logic, Inc.
Joshua Kerievsky
Founder, Extreme Programmer & Coach
http://industriallogic.com

Learn Code Smells, Refactoring and TDD at
http://industriallogic.com/elearning

[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/
(Continue reading)

Gojko Adzic | 1 Mar 09:19 2010

ATDD research

Hi,

I'm writing a new book on agile acceptance testing implementation 
stories, and I'd like to interview lots of teams as who have implemented 
acceptance testing/ATDD/BDD or any of the other alternative names, using 
Fit/FitNesse, Concordion, Robot Framework, JBehave, Cucumber or any of 
the other tools.

I'm doing this mostly inspired by two things. One was Tom Gilb's rant at 
agile testing days last year how agile is crap and nobody is really 
doing it, people apparently just lie and talk about their gutfeel. 
Another was the InfoQ post about acceptance testing in June that more or 
less took the line that the process is something that only a few "elite" 
people have been able to implement. I want to contradict both of these 
by showing examples of real teams who have been doing it and present how 
they are doing the process.

So if your team uses acceptance testing, and you think you have a 
successful implementation of the process, I'd like to interview you for 
the book. It will only take a short while (45-60 mins) and you'll help a 
lot. Please get in touch by sending an e-mail to gojko@...

Best regards,

--

-- 
Gojko Adzic
http://gojko.net
Acceptance Testing and TDD workshops http://neuri.co.uk/training

------------------------------------
(Continue reading)

Josue Barbosa dos Santos | 1 Mar 14:20 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

>>Interesting. It's been awhile since I've played with GWT. May I ask for a
>>simple example of what you mean? :-)

TotT: Be an MVP of GUI Testing
http://googletesting.blogspot.com/2009/02/with-all-sport-drug-scandals-of-late.html

TotT: Testing GWT without GwtTestCase
http://googletesting.blogspot.com/2009/08/tott-testing-gwt-without-gwttest.html

If the links is not clear, below is a simple sketch of why we don´t need do
ask (if you don´t want to)

Change on model:
Model changes->Model tell to your listener(s)(Presenter)->Presenter tell to
view the new value.

Change on view:
View changes->View tell to your listener(s)(Presenter)->Presenter tell to
model the new value.

Makes sense?

--

-- 
Abraços,
Josué
http://twitter.com/josuesantos

On Sun, Feb 28, 2010 at 10:32 PM, Franz Allan Valencia See <
franz.see <at> gmail.com> wrote:

(Continue reading)

Carlo Bottiglieri | 1 Mar 16:35 2010
Picon

Re: For those who switched from Mocks to Fakes/Stubs/Spies, why did you do that? (was Re: What is testable? (was Re: Is it OK to add code to a class *only* to improve its testability...))

Hello,
I would be very careful in mixing the concepts of ask/tell and
read/write. You can "ask" in order to write and you can "tell" in
order to read.

About J's consideration :
>> ...This is exactly the example that Franz mentioned. Again, I don't claim
>> it's wise to do, but I wonder what web presentation would look like
>> without asking. I wonder whether the web UI paradigm itself forces us
>> to ask.

This has been my very same doubt for years now. I summarized it in the
question "Should the domain contain the responsibility of representing
itself?"
My answer, lately, is yes, but most UI frameworks answer no and this
is a show stopper for me when I have to accept the use of a UI
framework.

On Mon, Mar 1, 2010 at 2:58 AM, Franz Allan Valencia See
<franz.see <at> gmail.com> wrote:
> This is interesting. Here are probably some factors that affects me having a
> substantial amount of 'ask'.
>
> My style is usually top-down, which means I almost always start with UI. And
> like most systems, I deal with a lot more with 'ask' than 'tell' (aka. a lot
> more read than write, or a lot more R than C.U.D).
>
> Of course, there would be business rules & flows in there and some
> interesting infrastructure, but since most data comes from the data source,
> there's usually quite a bunch of retrieval from the data source before
(Continue reading)


Gmane