In the story in this post, one important thing that happened was that the team (with management) came together to acknowledge the tech debt problem, acknowledge they want to solve it and talk through potential solutions. This moves the problem from something individuals care about to something the team as a whole acknowledges it care about (a shift from individual knowledge to common knowledge). Once everyone agrees this is a problem, individual engineers will know they’re acting against the will of the tribe by writing lazy pull requests. And being reprimanded by their coworkers for doing so will have much more weight.
Yes, though technical solutions go a long way towards making cultural solutions work and stick.
Eg running your tests automatically when someone makes a Pull Request is much more robust, even in a cultural sense, than asking developers to manually run the tests.
Technical solutions can help make the culturally favoured approach also be the path-of-least resistance.
Of course, you still have to write the tests. (Though even there, you can make your technical tools check for eg test coverage. That can be gamed, but that's more effort than when you can just ignore it; and even gamed coverage is better than no coverage.)
Technical solutions are the best solutions when they work. But being technologists will bias us towards looking for technological ways to solve problems. Its not always the best approach. A few hours chatting over lunch is usually a much more effective way to change how your team works.
Some of the worst tests I've ever seen were in places where managers measured test coverage. Reams and reams of absolutely useless tests that may not have checked anything that mattered, but that did bump the coverage metric up.
Reams and reams of absolutely useless tests that may not have
checked anything that mattered, but that did bump the coverage
metric up.
I would go farther than that, and call those tests worse than useless. Tests that are written to appease some kind of automated coverage metric god tend to be tests that test internal implementations rather than API contracts. So you end up with a codebase where a single line change to production code requires something like 150 lines of test code changes, all because the internal representation of some data was changed in some kind of trivial way.It's possible to avoid this failure mode, but the teams that are smart enough to avoid this failure mode are also generally smart enough to avoid having unreasonable coverage goals.
``` if (var) assert(var) else assert(!var) ```
in the outsourced test suite for a level A air plane software.
Cultural change is hard enough, so getting as many of the technical nudges as you can, is good.
People respond to an organizations actual priorities not whatever platitudes people toss out. If you want quality you need to sacrifice something even if long term results improve in the short term quality takes time.
This was a long time ago, but I still think about it as a moment when I learned what POSIWID really meant.
It's well done, because it's almost impossible to prove.
Those of us who still care about system health and helping users just wait two years after they launch something, ask leadership for permission to delete it, and keep trying to build abstractions that reduce the harm misconduct has on our parts of the system.
The problem is they keep getting promoted because no one notices that almost nothing they've built is still in production.
A few of us have tried raising the issue to leadership but no one in leadership wants to know. It's a bit spooky. My current theory is that no one has the power to deal with it anymore, and at higher levels, launching garbage features that get deleted is actually desirable.
Theory: senior leadership keeps saying "drop what you're doing and build X". This group does that, but in a way that's half baked enough that we can kill it later. Middle management benefits because senior leadership is happy, and deleting it is fine because leadership forgot about it.
I wish I knew a way out.
A little ironic, because Leetcode interviews arguably send the message that the org is about nonsense hoop-jumping and politics.
Loaded language not withstanding one of the premier books is all about “mindless/mechanical” changes to structure without changing behavior. It is about step by step safe microchanges.
This might be the biggest difference between refactoring and rewriting.
But you are right it is pushing bits around with no behavioral change. That’s the point.
The open question is if this newly refactored software is more maintainable, more understandable, easier to change in the dimensions it will mutate in the future. Often the answer is “no” and you are right to be frustrated.
You're right about my misconstruing 'no behaviorial change' as that is always a requirement. There should however be a change in where the seams of the implementation lie which better suits the direction of expected changes.
Having just spent a week clearing up and properly implementing my colleagues' 'fake completed' sprint tasks, I can resonate deeply. I'm making it clear to my boss that it wasn't 'refactoring', I was just implementing the actual requirements properly.
I'm going to go over their next PR with a fine-tooth comb, no matter how long it takes
IMHO, at the point you have engineers misrepresenting that something is done, even if you're not in an application domain in which engineers go to jail for that, you take a step back and fix your engineering/product culture.
That might include nuking your current methodology from orbit, just to reinforce that organization needs to learn a new way of thinking. (Not just "don't do that" on one symptom, when whatever culture weakness that caused the fudging is still in play.)