Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While I 100% agree with you on this point, you should take a few minutes and read this: https://medium.com/@adrianbooth/test-driven-development-wars...

It's a fantastic comparison of the Detroit school of testing (what you and I believe) vs the London school, which is simply a different mental model about code and testing and mocks especially.

Framing the differences this way make it clearer why some people might disagree with us, and it's not because they're stupid or wrong- they just have a different school of thought on the matter. This doesn't excuse, however, the people who are doing a little bit of both and they don't know why, and they're getting the benefits of neither side of that coin.



Nice framework for thinking about it, thanks. Totally agree.

For me, the biggest benefit is that I want to be able to refactor the internals of my code and have the tests (which map to business requirements, not implementation details) still pass.

It's also because a lot of the code I work with is inherently concurrent, and in my estimation, you're getting a lot more test coverage with the detroit model because a lot of your threading cases are simply covered if you use real objects and test it black-box style.


What if I like outside-in, black-box testing

Because I like to test everything, not just little parts I isolate?


Then you follow the classicist, Detroit-school of testing. Me too.

But if you read the article, you can see that this isn't the only school of thought.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: