Hi! I'm a beginner in Test Driven Development, and recently I started doing it at work, for a Windows Phone app. It's all working great, however, after 2 months since I started the project I'm realizing that I'm doing TDD wrong. My tests are covering almost anything from the code, but this makes them hard to maintain, and it takes a lot of time to maintain the code coverage.So I started to do some more research about TDD, and I find a presentation of Ian Coopers called "TDD: Where did It All Go Wrong?". Here I learn that tests should not cover each line of production code, instead they should only cover behaviors. I want to know how is this different from BDD? I'm also doing BDD for the project, but those tests don't use the API or interact with the local storage, they use mocks just as the unit tests. If I start doing TDD but only for behaviors, then it will be the same thing as my BDD tests, the only difference being that I'm using SpecFlow for BDD and the unit tests are made with a simple testing framework.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.
--
Tiago Moraes Fone: (85) 4005.1111 | |
Interesting read about this subject: The secret for 100% test coverage: remove code
Tiago Moraes
Desenvolvimento
Fortes InformáticaFone: (85) 4005.1111
ti...@grupofortes.com.br
www.fortesinformatica.com.br
2014-02-28 11:41 GMT-03:00 James Green <james.m...@gmail.com>:
Michel,The LOC count - is that restricted to the application core or does that include infrastructure dependencies too?
On 28 February 2014 14:36, Michel Henrich <michelc...@gmail.com> wrote:I agree with Uncle Bob and Philip, but just to add my recent experiences:In my latest projects, we've been writing most of our tests against the outer interface of my application, and writing few internal tests for the most complex pieces of code (things like tax calculation).Comparing to the Old Me, who pretty much loved Mocks and mocked absolutely EVERYTHING (internals and externals), the current approach has proven to be significantly better in almost every way.Tests are simpler - easier to read, easier to write, and hardly ever require modifications when we refactor parts of the application. The production code is free to change its structure, as long as the outer interface is kept. This is what "testing behavior, not implementation" means to me.As for coverage, as Philip said, whether you test behavior or implementation, you must always strive for 100% coverage. It's likely, however, that a single test file will not be able to cover an entire component. We measure the coverage by running the complete test suite, and in this case, the LOC coverage of our current project is 98%, and branch coverage is 94%. My team is currently working on raising these (low) percentages to 100% right now (and some of that work is to actually delete dead production code!)
On Wednesday, February 26, 2014 9:18:32 PM UTC-3, Bogdan Bujdea wrote:Hi! I'm a beginner in Test Driven Development, and recently I started doing it at work, for a Windows Phone app. It's all working great, however, after 2 months since I started the project I'm realizing that I'm doing TDD wrong. My tests are covering almost anything from the code, but this makes them hard to maintain, and it takes a lot of time to maintain the code coverage.So I started to do some more research about TDD, and I find a presentation of Ian Coopers called "TDD: Where did It All Go Wrong?". Here I learn that tests should not cover each line of production code, instead they should only cover behaviors. I want to know how is this different from BDD? I'm also doing BDD for the project, but those tests don't use the API or interact with the local storage, they use mocks just as the unit tests. If I start doing TDD but only for behaviors, then it will be the same thing as my BDD tests, the only difference being that I'm using SpecFlow for BDD and the unit tests are made with a simple testing framework.--
The only way to go fast is to go well.
---
---
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.