I’m not sure how possible it even is but as a programmer I have a sense of risk involved when I’m making changes to a code base.
I’ve never seen a tool which basically tells me, as I’m coding, how far reaching my changes potentially are.
Examples off the top of my head (which are probably debatable but this is just to be less abstract):
- Adding a property to a POCO is a “green” change
- Making a field readonly is a “green” change
- Adding a constructor when Unity DI is present is a “yellow” change
- Modifying conditional logic in a public method which has usages that span multiple assemblies is a “red” change
Is it possible? If yes, to which extent?
(Note this question is not a request for a specific tool.)
1
Does anything like this exist, or is it even possible?
Sure, there are tools that try to determine impact of a change across your codebase.
No, they aren’t foolproof. They’re not foolproof because languages invariably allow things to escape their control. Things like reflection, working with files/databases, concurrency… all of these are things that cannot be dealt with via static analysis. If they could be (quickly) then the compiler would do it or we’d use these tools more frequently. Some languages allow more/more useful checks at the expense of flexibility. On the other side is dynamic languages where this sort of thing would be highly impractical.
In practice, this is what unit tests do. They provide a quick, reusable set of regression checks to let you know clearly that your change has impacted stuff (or not). People have even attempted to automatically generate those, but that only tends to get the edge case sort of checks, not the meaty “does this work?” checks that humans know.