4 ms·
Building a sum method.... I get that these techniques should scale to real problems. I hate that I have never really seen them do so.
by taeric 10y ago
Building a sum method.... I get that these techniques should scale to real problems. I hate that I have never really seen them do so.
- mtsmith85 10y agoThat's always where I struggle, too. "How does this scale to real life problems?" That being said, the article goes into that—pretty well, I think—after the sum method. It focuses on an "OrderKindValidator" class that is expanded.
- pzh 10y agoYet real system design is usually so complex that no single technique can cover it. I shudder when I hear TDD proponents claiming that this technique can even be used for emergent design. An amusing example is Ron Jeffries's Sudoku solver attempt: http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-solvers.html?m=1 http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-s...
- taeric 10y agoYes, that is a particularly poignant set of posts. I am still fond of dancing links to solve Sudoku, and I can't easily see how I would have found that through TDD. And yet, among the most agreed ideas you can ever make in popular programming circles is that you are fond of TDD...
- kybernetikos 10y agoIn my experience tdd is useless for discovering algorithms. It is however very useful for implementing them. I've implemented dancing links and i absolutely used tdd for significant parts of the design.
- spc476 10y agoIf I didn't know who Ron Jeffrie was (one of the creators of Test Driven Design) I would have said that those articles were a brilliant piece of satire on test driven design.
- crdoconnor 10y agoThere's a lot of people out there doing unit test driven development that ought to be doing integration/acceptance test driven development. Unit test driven development only really works on "algorithmic" style code. Stuff that's mostly linking disparate systems together - if you try writing unit tests for it you'll end up with a mess of mocks that aren't actually testing if your code works.
- waterlink 10y agoI definitely am using these techniques on real projects with huge complexities to them. Quite successfully. Without bugs. Continuously Integrating and Continuously Deploying to Production. I'm pretty sure, that the case study of such project will take up the whole book, not just 3 blog posts ;)
- thdespou 10y agoI agree that this can work in one liners or very simple programs but it fails to deliver in real world scenarios when nothing is trivial. I just don't get it.
- waterlink 10y agoThank you for your feedback. I'm encouraging you to read the whole article, better, whole series. Because sum method was used to quickly explain Specific/Generic rule on the simplest example. Then it follows through with real-ish (a bit modified) business case, that has gotten me stuck in the past. I know that readers on the internet have limited attention span, so I shouldn't have put a sum method example at the beginning, rather I should have started with the main case study and made a detour before applying this rule to the sum example. Thanks for the feedback again, next time I will try to not make this mistake.
- taeric 10y agoApologies if it sounded overly critical. I actually did read the whole thing. I like the technique. It is very very appealing. I just have a hard time finding evidence in real projects where it has worked. My complaint is akin to the modern complaints on the gang of 4 patterns. Individually they make compelling arguments and if you follow the discussion, it is appealing. And I don't want to throw out the baby, so to speak. I think all of these make fine guidelines. We are just an industry that seems hellbent on finding prescriptive directions where it is becoming apparent none exist.
- waterlink 10y agoTo reassure: I do use this technique on a daily basis. And I have teached it to my team and we are happily applying it. It works well on big complex projects and makes sure you didn't miss any test case, so that Semantic Stability of the test suite is up high.
- waterlink 10y agoAnd thanks for the warm words! :)