well put!  I agree with everything you wrote, with the possible exception
of your point on functional vs unit tests.

1) Writing functional tests only leads to a very slow test suite (clean db,
startup server, etc)
2) unit tests help you write better code.  code that can be swapped
out/mocked, state passed in, single responsibility stuff, etc.  Unit tests
force devs to think about how the code will be interacted with and edge
cases.
3) writing functional tests tends to happen much later in the cycle, which
means it’s harder to do mocks and stubs to get around lousy code issues as
described in point #2.  And in my experience, devs don’t end up mocking
things out which leads to point #1


I think the Test Pyramid is the best way to think about these things:

http://martinfowler.com/bliki/TestPyramid.html

I’m not arguing that we shouldn’t do functional tests, I’m just saying I
think we need the full test stack and Unit Tests are very important.




On Fri, Feb 21, 2014 at 2:47 PM, Cédric Beust ♔ <[email protected]> wrote:

> Not a big fan for multiple reasons:
>
> - TDD introduces a lot of churn, especially in the early phases of your
> coding. If you're beginning to work on a problem from scratch, you will
> most likely throw one or two initial implementations before reaching
> something you feel is acceptable as a v1.0. Writing tests for any version
> prior to this one is a waste of time.
>
> - TDD encourages myopic design. You are more focused on writing your code
> so it can pass trivial unit tests than thinking about how your overall
> design will fit with the rest of the code base.
>
> - TDD has high friction. If you are very zealous with TDD, every minor
> change in the code base will cause you to update tests. I'm okay with a
> little bit of that (it's the purpose of tests) but not to the extent that
> TDD promotes.
>
> - It overly privileges unit tests over functional tests, and my default
> position is that functional tests are more important (if I have the time to
> write a functional or a unit test and just one, I'll always go for
> functional because these tests have a direct impact on users, as opposed to
> unit tests which are just a convenience for you, the developer).
>
> I have more (I wrote a bit of that in my book) but heading out for now.
>
> --
> Cédric
>
>
> --
> Cédric
>
>
>
> On Fri, Feb 21, 2014 at 1:08 PM, Rakesh <[email protected]>wrote:
>
>> Hi,
>>
>> **usual disclaimer about not looking to start a flame war**
>>
>> A friend of mine recently interviewed at a company for a position as an
>> iOS dev.
>>
>> The topic of TDD came up and my friend stated that she was a big fan.
>>
>> The interviewer on the other hand, said he wasn't and that the 'jury was
>> still out'.
>>
>> I'm curious, who is the 'jury'?
>>
>> As for myself, if i can join a team doing tdd or be in a position where i
>> can, i'm happy.
>>
>> This group is stocked with experienced devs so i'm not looking to convert
>> anyone, but surely by now, the nay sayers are in the decline?
>>
>> Thoughts?
>>
>> Rakesh
>>
>> Ps kevin, REALLY interested in your opinion.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Java Posse" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/javaposse.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Java Posse" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/javaposse.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/javaposse.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to