if we're being frank: When you care about the company and feel the company cares about the tech. Both of those aligning are rare. Broken windows and all that.
Now for a proper engineering answer, there's a few (but not limited to) factors to consider when determining software rigidity:
- Halo effect: How much code does this module affect? The more things that can break when the module fails, the more need to get proper testing/architecture.
- Frequency (in both ways): How often are you changing the code (is it cutting edge, or bog standard 50+ year old algorithms?) as well as how often the application calls the code. The more times its called or changed, the more you may appreciate ways to test new implementations with minimal impact to the current iteration.
- Understanding: pretty straightforward. The less you or the team understands the code, the more need to validate that code through tests. This often falls into frequency, because inevitable the less you understand the more you will need to tinker, possibly for unknown unknowns.
It's still subjective at the end of the day, but there are metrics you can use to make your case.