Re:Don't start with microservices – monoliths are your friend
by cerved on Friday December 17, 2021 @12:59AM
(#29588427)
interesting, how do you implement such a test?
Re:Don't start with microservices – monoliths are your friend
by alkonaut on Friday December 17, 2021 @02:01AM
(#29588858)
In .NET I do it om the binaries, I reflect over the assemblies and list the dependencies.
In the same run one can also validate that there are no incompatible transitive dependencies.
Within assemblies (between namespaces) is much harder unfortunately. That means assemblies have to be made to make module boundaries obvious, even though it’s a bit of an antipattern. There are tools such as nsdepcop that watch namespace dependencies, but it’s brittle and a lot of work.
Of course, any dev could just remove the test, and by that tear down that boundary too. But that test being removed is much more obvious to the code reviewer who would not have noticed the dependency being snuck in. The architectural tests can also contain comments that form a high level documentation of the architecture. Unlike "architectural documents" in the form of some up front word document, this type tends to stay up to date.