Hacker News new | past | comments | ask | show | jobs | submit login

That wasn't the central premise. The central premise is that there is a trade-off in class design when doing unit testing.



And I say that if you are making design decisions BECAUSE Of testing you are doing it wrong.

The premise of TDD (and one I've found true) is that there is a natural correlation between easily tested code and well factored code, not that you should be compromising your design for testing. Thus the original comment about bad api design as a result of TDD rings false with me.

You have apparently encountered cases where people have introduced unnecessary DI in the name of ease of testing when in reality they should have been fixing their central design problems. Software with long dependency chains and complex IoC containers are not easy to test, though looking through the comments it seems that many people have fooled themselves into thinking they are.




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

Search: