Thursday, February 04, 2021 in Escape the Monolith
Our Unit Test Suite Hurts! TDD, CI, and DevOps assume that unit tests have the following traits:
Domain relevant: Test one thing the user cares about and could describe. One Way to Fail: Can only fail for one reason, which is its assertion. Independent: Execute only the code they verify. You don’t need to update the test if anything else changes. Cover Functionality: The set of tests as a whole cover all behaviors of the system.Thursday, March 04, 2021 in Escape the Monolith
Our Code is Hopelessly Entangled With the Monolith! We really want our code to be a set of services. That unlocks CD and DevOps. However, our code is currently a long ways away from being Service Oriented so we will get to services incrementally.
Our first target is Continuous Integration (CI). We think of CI as a system to rapidly find mistakes so that we can correct them. However, the power of CI comes from an unexpected source — team independence.Tuesday, April 06, 2021 in Escape the Monolith
Other People Keep Messing with My Code! I was working with a company that had about 100 teams in the same product. Each had a different purpose, so each changed different code. However, it wasn’t as clean as that makes it sound.
Each team found itself making contributions across a quarter of the product. Each change impacted the work of a few other teams. Each method or class was shared among 2–4 teams — but it was a different 2–4 teams each time.Tuesday, May 04, 2021 in Escape the Monolith
We also support our readers through the Code by Refactoring Slack channel. Please join us there to discuss any part of the technique along your way to gathering your own scattered component.
My Code is Everywhere! Let’s continue with the last newsletter’s example of an organization with more than 100 teams editing a single codebase. The codebase was well-structured. It had to be in order to support that much change.Thursday, July 08, 2021 in Escape the Monolith
I’m Waiting For the Build…Again! Continuing our case study from the last two articles, let’s focus on one of the 130 teams who were trying to break free of the monolith.
At this point this team had created their component. Actually, there were several components, but each was just a namespace in the monolith. Only one team changed each component, but every change still forced them to recompile the monolith.Thursday, August 12, 2021 in Escape the Monolith
How Will We Debug the Monolith? If your teams are following our approach to escape the monolith that Deep Roots has provided in this year’s newsletters, you can probably see a big problem looming. Your teams are gaining independence at the cost of increasing integration complexity. Who is going to manage that complexity as every team flees the monolith? How?
Let’s look at our example organization to understand the complexity and its solution.Thursday, September 02, 2021 in Escape the Monolith
How Do I Keep This Working? A team that has been following this year’s Devops Series and performing each technique would find themselves able to:
Plan features without dependencies, Edit code independently, Build and verify independently, Isolate changes, and Isolate its integration complexity from its main collaborator. For that team, this is great progress and things seem pretty good for a while. Work is fast, deployment is practical, and integration bugs are lower than they’ve ever been.Monday, October 18, 2021 in Escape the Monolith
How do I Know I’m Using My Dependencies Correctly? Our goal is to simplify integrations between my component and my dependencies. Using techniques from the last two newsletters, we can isolate my component from unwanted complexity in a dependency, and then verify that the dependency continues to work as I expect. However, one glaring hole remains: how do I ensure that my code uses the dependency correctly?
We’ve Already Solved Almost Everything You may recall that we have encapsulated each of our dependencies behind a Port.Thursday, November 18, 2021 in Escape the Monolith
How Can We Deploy Independently Without Chaos?
Continuous and independent deployment sounds great from the team’s perspective. Nothing blocks the flow of value. They can ship each feature when it completes, and fix any bugs with an immediate rollback. The team can interact quickly and directly with customers through A/B tests and previews, and they can do all of this free of the company bureaucracy around release management, timing, and overhead.
But from the organization’s perspective, continuous and independent deployment promises sheer chaos.
Tuesday, January 05, 2021 in Articles
I Can’t Automate This! Many years back I inherited a 30-year-old legacy code base. We were to clean up the C++ and make it work on modern hardware. However, the first step was to get it to even compile.
Before us, building the product required 3 specialized build engineers, each with individual knowledge and unusual machine configurations. Each would remap the source, compile, get a partial success and set of failures, then pass it on to one of the other two.Friday, October 30, 2020 in Articles
Don’t Make Me Touch Ordering! The PM thought the feature was simple. And it should have been. Unfortunately, it requires making a tiny change to payment processing. And payment processing is part of the Order system…which is one monster class.
More than half of our code depends on Order to do something. Each part of that code depends on the Order for a different set of responsibilities. Although there are patterns, the Order class’s sheer size and number of responsibilities make these patterns hard to see.Monday, August 31, 2020 in Articles
My Service Interaction Tests are Slow and Fragile! Any legacy system needs to connect with other systems. However, coding and verifying changes in your legacy system requires the following things.
Simulate remote faults and verify your response. Verify that what you send to the remote system will cause it to do what you want it to do. Know when a release, rollback, or failover of the other system will change a behavior that you depend on.Wednesday, August 26, 2020 in Articles
I got a good legacy code question today in the Code by Refactoring Slack channel.
We have a code module called the state machine which is poorly written and has no tests. We all (we the engineers) agree that we should rewrite the state machine from scratch. However, the current implementation ‘works’, and we are not adding states or other stuff to that module.
Here’s the questions:
a) Do we need to add tests (unit & integration tests) at all?Thursday, July 30, 2020 in Articles
My product is written in the wrong language! Legacy systems tend to be old, and thus written in languages and frameworks that were available at the time they started. It’s no one’s fault, but the code is in the wrong language. This causes:
Slow development. Difficult testing - my tech predates the TDD movement. Reinvention - libraries for new techniques are written in new languages. Difficult hiring - my tech predates most developers.Thursday, June 25, 2020 in Articles
I hate changing the database! Legacy databases present two challenges:
Bad schema that is hard to change. Too much logic in the database. Both delay stories and generate bugs. Both waste your time and each will require thousands of person-hours to fix. We need to find a way to pay that cost incrementally; preferably divided among all the developers on the project.
First let’s divide the problem in half by ignoring the logic for now.Thursday, May 28, 2020 in Articles
All I want to do is edit the freaking document! Unfortunately, so does everything. CDocument is central to what we do. Users think of documents, and so does the UI. Every piece of code reads the CDocument class…unless it modifies CDocument.
And now I need to unit test my code. Also, I want to ship my team’s code independently of the other team. But every single feature touches CDocument. Many of them change CDocument - or one of the 6 wrappers we have created around CDocument over the years to reduce changes to CDocument.Thursday, April 30, 2020 in Articles
I changed a piece of code and 75 tests broke… It was a simple feature. I just added a GDPR approval checkbox when creating a new account. And suddenly half our tests broke. Tests for reporting, tests for core features, all kinds of tests for all kinds of things. Because every one of them needed to create an account.
So I added a default to the test mocks. I updated lots of expecteds.Thursday, October 17, 2019 in Naming as a Process
We all know naming is a pain in the ass and you can’t trust the names in your code. But it doesn’t have to be that way.
Many people try to come up with a great name all at once. This is hard and rarely works well. The problem is that naming is design. Here are the things you are typically trying to do all at once while naming:
Deciding the things the code should do Deciding which things go together Deciding which abstractions best represent those clusters Picking a name that clarifies intent Picking a name that distinguishes from all the other similar intents Describing the side effects of the code Keeping your name under 15 characters This is why naming is hard.