• Multiple changes in different parts of the code required • Every change requires more changes • Coupling ◦ But: Can we prevent all coupling? @[email protected] - @dtanzer.bsky.social 10
your arm off! • In general, we should treat reversible decisions differently than irreversible decisions --Kent Beck, "Tidy First", p. 75 @[email protected] - @dtanzer.bsky.social 11
◦ First, make the change easy, then make the easy change (Kent Beck) • Implement a decision you might need to change later ◦ Any decision! ◦ Can you make future changes easier? @[email protected] - @dtanzer.bsky.social 13
• In software development coupling is the degree of interdependence between software modules • to cohere: to unite or to hold together as a unit • In software development: cohesion refers to the degree to which the elements inside a module belong together @[email protected] - @dtanzer.bsky.social 15
... • DMZ translates and protects • Interfaces to happy zone are well-designed ◦ AND are part of the happy zone • Keep DMZ as thin as possible • Code flows from DMZ to happy zone • cf. Ports and adapters, onion architecture, clean architecture J.B. Rainsberger @[email protected] - @dtanzer.bsky.social 22
◦ Validate all data going across ◦ Do not pass on errors ◦ cf. Circuit breaker pattern • Define interfaces that stop code ripples ◦ Beware of shared code or data structures here • Micro services or modular monoliths • cf. "Breakwater Technique" by GeePaw Hill @[email protected] - @dtanzer.bsky.social 28
to become "attractive code", meaning literally a class/module that attracts behavior towards it as new methods/functions. --J.B. Rainsberger @[email protected] - @dtanzer.bsky.social 30
◦ Equal ◦ Upstream / Downstream ◦ Separate Ways • Open Host Service vs. Consumer Driven Contracts • Contain the damage ◦ Anti Corruption Layer @[email protected] - @dtanzer.bsky.social 31
it is a real option. --Maassen/Matts/Geary, "Commitment", p. 59 • Options have value ◦ The value of the benefit ◦ AND the value of the fact that you can still decide • Options expire • Never commit early unless you know why @[email protected] - @dtanzer.bsky.social 32
straight line! • You can only find the real path by taking small steps ◦ and getting feedback ◦ and adjusting @[email protected] - @dtanzer.bsky.social 40
as safety net • Tests as thinking aid • Tests that verify safe interfaces • Further risk reduction: BDD, Double-Loop TDD, Agile Acceptance Testing, ... @[email protected] - @dtanzer.bsky.social 52
the internal structure of the software to make it easier to understand and cheaper to modify without changing its observable behavior -- Martin Fowler • Feature-for-feature and bug-for-bug compatible • How can we know we have not changed anything? @[email protected] - @dtanzer.bsky.social 55
is a net negative for humanity. • -but- • Not using it comes with risks and drawbacks ◦ Especially if you are the only one not using it • Using it is probably unethical • Not using it is probably unethical too https://en.wikipedia.org/wiki/Tragedy_of_the_commons @[email protected] - @dtanzer.bsky.social 60
impact of a change ◦ "Did this code change alter behavior?" ◦ "Did this code change impact performance?" • Good at analyzing code ◦ Architecture / Design ◦ Code Smells • OK / Not completely bad at coming up with a series of small steps @[email protected] - @dtanzer.bsky.social 61
least not what we considered refactoring in the past • May introduce side effects (seldom, nowadays) • Often creates big changes that are hard to review • Valuable tool if you use it with guard rails @[email protected] - @dtanzer.bsky.social 62
keeps context small • Automated safety nets help validate AI results • Small steps make human review easier • -> What helps us make decision reversible also makes it easier to work with AI @[email protected] - @dtanzer.bsky.social 63
Decisions to Make Changes Easier • MMMSS • Feedback • Practice Refactoring • AI Benefits and Can Help @[email protected] - @dtanzer.bsky.social Conclusions 64