Prevent breaking your design, check dependency rules before merge
It is a common assumption that production code should not depend on anything from the test code. Or in a layered architecture, a middleware component should not depend on an application component. It should always be the other way around.
Breaking these rule can sometimes seem like a fast way to workaround or fix an issue. But most often it leads to unnecessary technical debt and complexity. Afterwards it usually gets difficult to fix it as new things are building on top of a bad dependency architecture and bigger and bigger refactoring needs arise. That's why you want to make rule violations visible. You want to prevent design flaws already before new code is merged to the main branch.
See an example below how we illustrate the case in code review. Here new dependencies have been added that violated the rules (example simple rule):
To prevent intentional and unintentional breaking of the design with bad dependencies, Softagram lets you define dependency rules for your projects. You can define the severity of each violation types, and give clear text reasoning for the author why he's seen the error in first place. If you are already using Softagram, read more on defining the rules from this help file.
Warning in the code review report if an unwanted dependency is being added.
Softagram dependency rule checks allows also effective refactoring. New interface modules would not allow any more imports with automated checks. Existing refactoring needs can be also seen clearly as they are visualized in the whole code base model browsable with Softagram Desktop.
See an example video of how the Softagram Bot shows rule violations e.g. in GitHub pull requests:
Benefits of informing the issues directly in the code review phase
Facebook study shows that issues found by any static analysis are fixed with over 70% rate when reported in code review. The bug fix rate alone clearly a great benefit. The affect is however multiplied by other benefits. If you need to fix a bug, it is easily up to 10 to 100 faster to do right after it's found, before the merge.
You don't have to follow any new process for the fix. There is no need for planning, no splitting of your mind and time between multiple tasks. You don't have to stop your existing work to go back on the case your might not even remember any more. No studying the area of code due it's the latest thing you did, and remember it well.
We all know the hassle if the bug, un-noticed, or not fixed, is found by the customer. All the escalations and planning and studying. It all would have been avoided would the finding been seen already before the code was even merged to main branch!
Dependency violations could be very dangerous. They are causing situations where they are no more fixable without a large refactoring. Detecting them early enough, might be only way to keep the software maintainable. Clear architecture allows to put efforts on new development and decreasing heavily the bug fix times.
If you would like to see how that automation could improve the quality of your codebase, try it for free at https://softagram.com/products
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.