Code Smell 16 - Ripple Effect
Small changes yield unexpected problems.
- Cover with tests.
- Refactor and isolate what is changing.
- Depend on interfaces.
- Legacy Systems
- It is not easy to detect problems before they happen. Mutation Testing and root cause analysis of single points of failures may help.
There are multiple strategies to deal with Legacy and coupled systems. We should deal with this problem before it explodes under our eyes.
Architecture is the tension between coupling and cohesion.
This article is part of the CodeSmell Series.
Decoupling a clock isn't the best example of it, I suppose, because I didn't quite get it 😁
When I work with database for bot, as example, I plant queries in methods of accompanying Models. Does it somehow introduce a Ripple Effect?
which would be the source of time?
How would you test it?
Remember tests must be in full environment control and have no globals involved and 'now()' is a global out of control.
if you couple your model to your database you will indeed have lots of coupling.
Databases are accidental and, thus, unrelated to business models.
Create your bot. Create your chats, create your conversations and test them.
The database comes later on.