[LRUG] How can you tell if TDD was used on a project

Abdel A Saleh abdel.a.saleh at gmail.com
Wed Mar 21 04:16:41 PDT 2012


With all the chat about dependency injection (bringing memories of Java
back), here's an oldie but goodie take on it using Ruby from Jim Weirich
(circa 2004):

http://onestepback.org/index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc

Abdel

On 21 March 2012 09:53, Stephen Masters <stephen.masters at me.com> wrote:

> TDD tends to lead to using well-established patterns of loose coupling,
> dependency injection and clean interfaces. But you get there because the
> methodology forces you to get there. However, it's also perfectly possible
> to write such 'good' code without using  TDD.
>
> So given a well-structured project that (as Steve Tooke described) is easy
> to test, it's not so easy to say whether that project was written using
> TDD. However, given a project packed with exceedingly long methods, obscure
> interfaces and no capability to inject dependencies, I could make the safe
> assumption that it was not developed using TDD.
>
> It's a bit like what my dad used to say about recognising which of his
> students were copying their programming homework from others. It's hard to
> spot copying when two pieces of homework are written well and bug-free.
> It's the flaws that raise the red flags.
>
>
> On a side note relating to Sidu's (if I remember right) blog post
> yesterday, the wording of the question implies that a non-TDD project would
> not have any tests written for it in the first place. There are plenty of
> projects with lots of automated tests, but where the tests have been
> written in parallel or after the code.
>
> In terms of the final code-base, such projects should be more or less the
> same as TDD projects. However, the process to get there would be somewhat
> different. With a test-after approach, you're more likely to write slightly
> more difficult-to-test code, which needs refactoring to support testing. As
> you get used to testing, you're likely to learn what patterns make code
> more testable, so this goes away somewhat. You're may also end up in a
> situation where you're using code coverage tools to help you chase nice
> stats. If you followed a strict TDD approach, then you should have very
> high coverage percentages without needing such a tool to guide you.
>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120321/cd5646db/attachment.html>


More information about the Chat mailing list