--
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.
The difference between my approach and the GOOS book is a common issue. First, there _is_ a pretty big difference. They start at the periphery of the system and work in. I start in the center of the system and work out. Oddly, that's about where the difference ends. The "hexagonal architecture" that they promote is remarkably similar to the "Clean Architecture" that I promote.
Why do these two techniques result in the same architecture? Because our goals and emphases are the same, and we're both firing tracer bullets. Both techniques are agile, both techniques recommend developing in tiny iterations, and both techniques push you end to end within the confines of an iteration. Both wind up with acceptance tests running through the GUI at the end of the iteration. And both want those acceptance tests written at the start of the iteration.
Somehow people have gotten the idea that I don't think you should have tests at the GUI. This is probably because I often stridently assert that you should not test business rules through the GUI, and people infer that to mean _no_ tests of the GUI. OF COURSE you will test the GUI. I just don't want you testing business rules through the GUI. When write tests at the GUI, I want them to be GUI tests. And yes, this means that the technique of writing BDD style cucumber tests through the GUI bothers me deeply. I think the Rails community has gotten way off course with this approach.
Whether you follow my approach, or the GOOS approach, you will still isolate the GUI and the Database from the business rules. You will still create an architecture where the GUI and Database are plugins. The only difference is whether, in the course of an iteration, you are moving from the outside in, or the inside out.While that difference in direction creates almost no difference in the structure of the application, it creates a _profound_ difference in the structure of the tests. Inside out tests have a _lot_ fewer mocks. Outside in tests are _dominated_ by mocks. When you code from the inside out your tests depend on return values and state. When you code from the outside in, your tests depend more on mocks that spy on the way your system work. Inside out tests depend on results. Outside in tests depend on mechanism and algorithm.
This last issue will be the topic of one of the upcoming episodes in the Advanced TDD thread.
Philip
1) Walking skeleton predates GOOS. Cockburn wrote about it last century http://alistair.cockburn.us/Walking+skeleton.
2) When people speak about deferring decisions they're usually concerned with avoiding premature commitment. Cockburn specifically says that the Walking Skeleton "need not use the final architecture, but it should link together the main architectural components. The architecture and the functionality can then evolve in parallel."
3) In an old article (http://martinfowler.com/ieeeSoftware/whoNeedsArchitect.pdf), Martin Fowler says "one of an architect’s most important tasks is to remove architecture by finding ways to eliminate irreversibility in software designs." He's talking about making design decisions that protect us from making hard-to-change architectural commitments. Too much flexibility and the system becomes over-complex, too little and you're at the mercy of every change (whether due to your product owner or a changing 3rd party component)
4) BDD has never recommended driving development through the UI. BDD encourages us to focus on the behaviour of the system. Exercise the system at the layer appropriate for the behaviour that you are developing. It's worth keeping the Testing Pyramid in mind, and probably the Testing Iceberg too (http://claysnow.co.uk/?p=175315341). And always remember that the GUI itself is just another component.
5) I don't agree with Uncle Bob that outside-in and inside-out approaches result in profoundly different test structures. Specifically I have seen no evidence that outside-in tests necessarily lead to more mocks, or to mocks/doubles that rely on mechanism rather than results.
6) More contentiously, I think that we're all working outside-in anyway. TDD by it's very definition works from the outside of a component, driving its design and implementation through an emerging public API. Further, if there's no clear link from your user's requirements through to the code you're implementing something is going very wrong, so we're all working from the outside after all.
The difference between my approach and the GOOS book is a common issue. First, there _is_ a pretty big difference. They start at the periphery of the system and work in. I start in the center of the system and work out. Oddly, that's about where the difference ends. The "hexagonal architecture" that they promote is remarkably similar to the "Clean Architecture" that I promote.
Why do these two techniques result in the same architecture? Because our goals and emphases are the same, and we're both firing tracer bullets. Both techniques are agile, both techniques recommend developing in tiny iterations, and both techniques push you end to end within the confines of an iteration. Both wind up with acceptance tests running through the GUI at the end of the iteration. And both want those acceptance tests written at the start of the iteration.
Somehow people have gotten the idea that I don't think you should have tests at the GUI. This is probably because I often stridently assert that you should not test business rules through the GUI, and people infer that to mean _no_ tests of the GUI. OF COURSE you will test the GUI. I just don't want you testing business rules through the GUI. When write tests at the GUI, I want them to be GUI tests. And yes, this means that the technique of writing BDD style cucumber tests through the GUI bothers me deeply. I think the Rails community has gotten way off course with this approach.
Whether you follow my approach, or the GOOS approach, you will still isolate the GUI and the Database from the business rules. You will still create an architecture where the GUI and Database are plugins. The only difference is whether, in the course of an iteration, you are moving from the outside in, or the inside out.
While that difference in direction creates almost no difference in the structure of the application, it creates a _profound_ difference in the structure of the tests. Inside out tests have a _lot_ fewer mocks. Outside in tests are _dominated_ by mocks. When you code from the inside out your tests depend on return values and state. When you code from the outside in, your tests depend more on mocks that spy on the way your system work. Inside out tests depend on results. Outside in tests depend on mechanism and algorithm.