Architectural Analyses

CodeScene’s architectural analyses lets you run Hotspots, Temporal Coupling and more on the architectural level of your high level design. The results give you the power to evaluate how well your architecture supports the evolution of your system.

What’s an Architectural Component?

An Architectural Component is a logical building block in your system. For example, if you build a Microservices architecture, each microservice could be considered a logical block. Similarly, if you organize your code in layers (MVC-, MVP-, MVVM-patterns, etc), each layer would be a logical block.

An example of architectural components

Fig. 46 An example of architectural components.

An Architectural Component could also be much more coarse. For example, let’s say that you’re interested in the co-evolution of your application code versus the test code. Perhaps because you suspect that you spend way too much effort on keeping your automated tests up to date. In that case, you’d define two Architectural Components: Application Code and Automated Tests.

So, the short answer is that what you consider an Architectural Component depends upon your architectural style. You want to specify components that help you answer the questions you have. For example, do the change patterns in the code match the intent of the architecture? Often, the potential for large maintenance savings are found in these architectural analyses once you spot patterns that violate your architectural principles.

Define your Architectural Components

You need to configure your Architectural Components in order to enable the corresponding analyses.

CodeScene offers flexibility in how you define your components. The tool uses glob patterns to identify the files that belong to a specific component as illustrated in Fig. 47.

Configure architectural components

Fig. 47 Configure architectural components by specifying glob patterns for each logical component.

As you see in the picture above, you need to specify a pattern and the name of your component. All content in your codebase that matches your glob pattern will be assigned to an architectural component with the name you specified. For example, in the configuration above, all content below ‘spaceinvaders/source/sprites’ will be considered as the component Sprites. Note that you can provide much more granular filters and, with the power of glob patterns, even match individual files.

Interpret the Architectural Analysis Results

The Architectural Analyses lets you focus on logical building blocks rather than individual files. This allows you to identify architectural Hotspots, as shown in Fig. 48.

Architectural hotspots

Fig. 48 Using the hotspot analysis for architectural components.

The architectural analyses also let you identify expensive modification patterns where code changes ripple through multiple logical components, as seen in in Fig. 49.

Architectural temporal coupling

Fig. 49 Temporal coupling between architectural components.