Growing object-oriented softwareSteve Freeman
Growing object-oriented software
by Steve Freeman · first published 2009
27mentions
16recommended by
23HN commenters
2011–2026first – last mentioned
70% recommend30% neutral
Why HN recommends it
Shows how to do test-driven development in an object-oriented way: walking skeleton, acceptance tests first, and mocks used for design. Suits Java developers avoiding framework sprawl and avoiding test anti-patterns.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






…mainstream usage has evolved. I assert you can write "nice Java", either with something like (shameless plug): http://draconianoverlord.com/2011/03/17/frameworkless-di.htm... Or, for a better source, GooS, Growing Object-Oriented Software, by Steve Freeman and Nay Pryce: http://www.growing-object-oriented-software.com/ ...although, yes, a more succinct language like Scala helps too.
on “Dependency Injection is a Virtue” ↗…you then that’s great, but it’s misleading to say that that’s why “they’re there”. Steve Freeman & Nat Pryce’s book [0], for example, is an excellent illustration of what mocks are for. [0] http://www.growing-object-oriented-software.com/
on “Why I don't mock” ↗…at your use cases and build out. Pick your frameworks and databases judiciously and as late as possible. Read: https://blog.8thlight.com/uncle-bob/2012/05/15/NODB.html Read: http://www.amazon.co.uk/Growing-Object-Oriented-Software-Gui... [EDIT] Removed the unnecessary/unhelpful opening statement.
on “Ask HN: What stack would you use to build a CRUD web app on the JVM today?” ↗Well, one thing I learned from all this recent TDD related discussion is that almost nobody is aware of this book [1] and the entire school of TDD it spawned. [1] http://www.amazon.com/Growing-Object-Oriented-Software-Guide...
on “Test Isolation Is About Avoiding Mocks” ↗Hands down the best book. Plus the authors are really nice guys! http://www.growing-object-oriented-software.com
on “Ask HN: How to make fewer mistakes?” ↗…Dog extends Animal` in sight. It's written by one of those Smalltalkers, and I think it's got a lot of very valuable ideas about software design, not just OOP specifically. The "callback-y" approach in Growing Object-Oriented Software sounds fascinating. > Immediately I remind myself that the implementation from the book ignores the problem of persistence completely. If you close that application it loses all the state. I think this…
on “Growing object-oriented software vs. what I would do” ↗Annotations and auto-wiring for a "serious project"? Please no. If you want to see how to write code in java without going framework mad, look at this book http://www.growing-object-oriented-software.com I have worked with one of the authors on a "serious project" in a bank and over time we gradually ripped out the frameworks, making the code much more explicit and less magic.
on “Twitter Shifting More Code to JVM, Citing Performance and Encapsulation” ↗…write until I realized how much time they were saving me in debugging and headaches after the fact. Do it now, before your code size gets much bigger. I highly recommend this book http://www.amazon.com/Growing-Object-Oriented-Software-Guide... Again, happy to order it for you (it's not cheap) or just toss in some more BTC if you promise to order it and read it. I don't know what cred I can give you other than to tell you I'm "GSpotAssassin",…
on “Bitcoin drops 50% overnight as China’s Biggest BTC exchange stops Yuan deposits” ↗…The only known resolutions of tech debt are costly refactorings or global rewrites. The way to reduce the risk there is to first unit-test the existing code. These books help: http://smile.amazon.com/Growing-Object-Oriented-Software-Gui... http://smile.amazon.com/Refactoring-Improving-Design-Existin...
on “Leaf: Machine learning framework in Rust” ↗It's all in this book: http://www.growing-object-oriented-software.com/
on “Is TDD Dead? (2014)” ↗…be easy. But you will learn so much more about the software you are writing the test against rather than writing code in the edit-and-pray methodology. I highly recommend reading http://www.amazon.com/Growing-Object-Oriented-Software-Guide...
on “Testing code is simple” ↗short version "programmers can mess up unit tests" let me suggest: http://www.amazon.com/Growing-Object-Oriented-Software-Guide...
on “Why Most Unit Testing is Waste [pdf]” ↗By coincidence, I read this recently, after following a reference from Growing Object-Oriented Software (http://www.growing-object-oriented-software.com/) by Freeman and Pryce (which is also highly recommended). It contains a lot of clearly-expressed wisdom and practical techniques for when you're given…
on “Object-Oriented Reengineering Patterns (CC BY-SA Ebook)” ↗> None is willing to take on the risks associated with technical debt repayment. This risk is vastly mitigated with good test coverage. https://smile.amazon.com/Growing-Object-Oriented-Software-Gu... https://codeclimate.com/blog/refactoring-without-good-tests/
on “Ask HN: As a CTO, what is your most frustrating problem with technical debt?” ↗The standard book on avoiding the test anti-patterns described here is http://www.growing-object-oriented-software.com/ .
on “Against Testing” ↗