5.9.6. Architecture Analysis Facilities¶
Architecture analysis checks whether two views match in structure. In this process, one view represents the architecture and the other view represents the implementation of that architecture. Three pieces of input data are required for the check: the two views to be checked and a mapping between them. The mapping is also represented as a view. In the descriptions of the interactive architecture analysis features provided by Gravis, it is assumed that a software architecture is being checked against code. However, architecture analysis can also be used for other purposes, e. g., model-to-model checking.
The Architecture Guide describes the general architecture analysis approach and typical Gravis usage scenarios. This section focuses on the Gravis user interface.
Note
The view representing the implementation can be either a single view in the RFG or
a combination of two views: a hierarchy view that specifies the hierarchical
nesting of source code entities and a base view that specifies the dependencies
between them. Whether a single view or two views are used depends on the programming
language from which the RFG was created: source code analysis of C# and Rust produces
a single view, whereas analysis of C/C++ code produces separate views for the
hierarchy and the dependencies. Two alternative combinations of
views can be used: Code Facts as the base view with Module
as the hierarchy view or Declaration Facts as the base view with
File as the hierarchy view. Similarly, C# analysis produces two alternative
views: Code Facts or Assembly. Which of
these two views or combinations of views is the most suitable depends on the way the
software is designed and the architectural properties to be checked.
The choice of views is discussed in more detail in the section Creating the Mapping in the Architecture Guide.
Views involved in the analysis must be assigned roles:
Architecture,
Mapping,
Hierarchy, and
Base. The last two roles are used
for the code (the implementation). If only one view represents the code under
analysis, the
Hierarchy role must be assigned. If two
views are used, the
Hierarchy role is assigned to the view containing the
hierarchy used for mapping, while the
Base role is assigned to the view
containing the relationships among the entities in the code.
Hereafter, the view assigned the
Architecture role is
referred to as the architecture view, the view assigned the
Hierarchy role as the hierarchy view,
and the view assigned the
Mapping role as the mapping view.
Note
The mapping view contains nodes from the architecture view and the hierarchy view.
Additionally, the mapping contains
Maps_To edges from
nodes in the hierarchy to nodes in the architecture. Alternatively to the
dedicated Mapping Window described in the next section, the mapping view can be
reviewed and edited in a standard Graph Window using the menu entry
Open →
Flat...
from the view’s context menu in the
View Box, or by
double-clicking the view while the Mapping role is not assigned to it.
While an architecture project is open,
Gravis assigns the roles automatically and the
View Box does
not show them.
5.9.6.1. Architecture Projects¶
An architecture project contains everything needed to model and check architectures
in Gravis. It consists of one or more architecture checks. Each check specifies an
architecture view, a mapping view, a layout of the architecture view, a base view, a
hierarchy view, and analysis options. The project is stored in a project file with the extension
.gaproj. The GXL files of the architecture and mapping views and the layout files of
the architecture views are stored in the directory of the project file, the project
directory. Keep the project directory under version control together with the
configuration of your analysis project.
An architecture project takes care of the files involved in architecture checking:
Opening the project loads the RFG and then the architecture views, mapping views, and architecture layouts from the project directory.
Gravis tracks which of these views and layouts have been modified and saves them to the project directory on request. There is no need to export views as GXL files or to copy layout files.
When the project is closed, Gravis asks you whether to save modified views and layouts of the project. Other changes to the RFG are discarded without a prompt, because the RFG will eventually be replaced by a newer version from the dashboard anyway.
Each check is run with a single click, using the options stored in the project. The
Analysisdialog is not needed.The rule Architecture-GravisArchitectureProject runs the checks of the project during continuous integration, using the same options as Gravis.
The section Architecture Projects in the Architecture Guide describes how to set up and use an architecture project. This section describes the user interface.
Creating an architecture project¶
An architecture project is created for the currently loaded RFG. Choose
File →
New architecture
project... from the main menu. This entry is available only if the current graph was
loaded from an RFG file. The New Architecture Project dialog offers the
following fields:
Project nameThe name of the project. It is also used as the base name of the project file, so it must not contain any of the characters
\ / : * ? " < > |.LocationAn existing, writable directory.
Browse...opens a directory chooser.Create project directoryIf ticked, a subdirectory named after the project is created in the location and becomes the project directory. Otherwise, the location itself is the project directory.
Below the fields, the dialog shows the path of the project file and of the directory to be created. A path is shown in red if the name or the location is invalid. If the project file exists already, you are asked whether to overwrite it.
Clicking OK closes any open architecture project, creates the project file,
and shows the new project in the Architecture Project
Tree. The New Architecture Check
dialog then opens, because a project needs at least one check to be of any use.
Creating an architecture check¶
The New Architecture Check dialog opens automatically after creating a
project. To add a check to an open project, choose
New architecture check... from the context menu over the project entry or
over the empty space below the entries of the Architecture Project Tree. While a project
has no checks, the tree also shows a New architecture check... button
below the project entry.
The New Architecture Check dialog for an RFG created from C/C++ and Rust code.¶
The dialog offers the following fields:
Check nameThe name of the check. The result view created by running the check has the same name.
Check typeDetermines the base view and the hierarchy view of the check, which are shown in parentheses after each check type. Only check types whose views exist in the RFG are offered:
C/C++ logical language view:Code FactsandModuleC/C++ declarations:Declaration FactsandFileC/C++ includes:IncludeandFileC# Assemblies:Assemblyas both base and hierarchy viewC# Namespaces:Code Factsas both base and hierarchy viewRust:Code Factsas both base and hierarchy view
The question mark button opens the section Choosing the source abstraction of the Architecture Guide, which explains the differences.
Architecture view nameThe name of an existing view or the name of a new view to be created. The drop-down list contains all views of the RFG.
Layout nameThe name of the persistent layout of the architecture view that the project manages. The default is
Default. The name must not start with an underscore.Mapping view nameThe name of an existing view or the name of a new view to be created.
The architecture view and the mapping view must not be used by another check of the project, and they must differ from each other, from the base and hierarchy views, and from the check name. Their names must differ in more than just upper and lower case, because their GXL files would clash otherwise. The check name must differ from the base and hierarchy views.
Clicking OK adds the check to the project:
An architecture view or mapping view that does not exist yet is created as an empty view.
The architecture view and the mapping view are saved as GXL files in the project directory. The file names are derived from the view names.
If the architecture view has a persistent layout with the given layout name, this layout is used. Otherwise, a new persistent layout with that name is created. The layout is copied to the project directory; the file name is derived from the architecture view name and the layout name.
Using existing views and layouts allows converting an architecture setup that was
created without an architecture project. The new check is part of the project only after
the project file has been saved, e. g., using Save all.
Opening and closing an architecture project¶
An architecture project file is opened like a graph file: using
File →
Open... or File →
Open recent, by dragging the file onto the Gravis main window, or by
passing it on the command line. The project file refers to the RFG file by the path
that was loaded when the project was created. Opening the project closes the current
graph, loads this RFG, and then performs the following steps for each check:
The architecture view, the mapping view, and the result view of the check are deleted from the RFG if present. The RFG downloaded from the dashboard may contain these views, but the versions in the project directory take precedence.
The architecture view and the mapping view are imported from their GXL files in the project directory. If a GXL file is missing, you can choose between aborting and starting with an empty view.
The architecture layout is copied from the project directory to the persistent layout storage of the RFG (see Persistent layout storage), replacing the layout with the same name.
The RFG is usually not under version control together with the project, so after
checking out a project, the RFG may not exist at the path stored in the project file. In
this case, a file dialog asks for the RFG, and cancelling it aborts opening the project.
After the RFG has been loaded, Gravis asks whether to store its location in the
project file. Update project file saves the project file with the new
path right away. The path is stored relative to the project file if the previous path
was relative. Keep project file uses the location for the current session
only. Saving the project later keeps the previous path, so that you can commit other
changes to the project without changing a path that applies to other users.
While a project is open, the main menu entries for closing and reloading the graph
change to File → Close architecture project and
File → Reload architecture project. Closing the project also
closes the graph. Reloading the project closes it and opens it again, which also loads the
current version of the RFG file. Use it after replacing the RFG file with a newer version
downloaded from the dashboard. Closing the
View Box closes the
project, too.
When the project is closed, Gravis checks for unsaved changes:
If the project file has unsaved changes, for example a new check or modified check options, a dialog offers
Save all(save the project file and all modified views and layouts of the project),Save(save the project file only),Discard, andCancel.Otherwise, if views or layouts of the project have been modified, a dialog lists the modified views and offers to save them.
Changes to other views of the RFG are discarded without a prompt.
The Architecture Project Tree¶
While an architecture project is open, the
View Box is titled
Architecture/View Box and shows the Architecture Project Tree above the
list of views. The tree contains an entry for the project, an entry for each check, and
entries for the architecture view and the mapping view of each check. Each entry has
buttons for its operations.
The Architecture Project Tree of a project with two checks. The architecture view and the layout of the first check have been modified, and a window showing the result of the first check is open.¶
Project entry
Shows the project name. The tooltip shows the path of the project file.
Run allruns all checks of the project.Save allsaves the project file and all modified views and layouts of the project. The button is enabled only if there is anything to save.
Check entry
Shows the check name and the names of the base view and the hierarchy view.
Runruns the check (see Running architecture checks). While a window showing the result of the check is open, the button is labeledUpdate.opens the Architecture Check Options dialog.
Architecture view entry
Shows the name of the architecture view and the name of its layout. The tooltips show the paths of the GXL file and the layout file in the project directory.
opens the architecture view with its layout in a hierarchical graph window. If the window is already open, it becomes the active window. Double-clicking the entry has the same effect. When this window is closed, layout changes are saved to the persistent layout storage of the RFG without a prompt. To discard layout changes, use
Layout storage→
Revert layout '<layout name>'before closing the window.saves the architecture view to its GXL file and its layout to the project directory, including unsaved layout changes in an open window. Only the modified ones are saved, and the button is enabled only if the view or the layout has been modified.
Mapping view entry
Shows the name of the mapping view. The tooltip shows the path of the GXL file in the project directory.
assigns the roles for the check and opens the Mapping Window with the architecture shown as a tree. Hold down Shift while clicking to show the architecture as a graph. Any other open Mapping Window is closed. Double-clicking the entry has the same effect.
saves the mapping view to its GXL file. The button is enabled only if the view has been modified.
A modified view or layout is shown in blue with an asterisk appended to its name,
and its save button changes to . A layout counts as modified if an
open window shows it with unsaved changes or if its saved state differs from the copy in
the project directory. Layouts are saved to the project directory by the save button of
the architecture view entry, by
Save all, or when confirming the prompt on
closing the project. A check entry is shown in the same way while the options of the
check differ from those saved in the project file, and the project entry while checks
have been added or deleted since the project file was last saved.
The context menu of the Architecture Project Tree contains the following entries:
New architecture check...Available over the project entry and over the empty space below the entries. Opens the
New Architecture Checkdialog (see Creating an architecture check).
Open violations...Available over a check entry. Opens the Violations List of the check or, if it is already open, makes it the active window (see Running architecture checks). The entry is enabled only if the result view of the check exists, that is, after the check has been run.
Revert from projectAvailable over a check entry, an architecture view entry, and a mapping view entry. Discards the unsaved changes of the entry and restores the state saved in the project directory, without reloading the project. Over an architecture view entry, a modified architecture view is imported again from its GXL file together with its layout. If only the layout has been modified, the layout is restored and applied to an open window showing it. Over a mapping view entry, the mapping view is imported again. Over a check entry, the options of the check, its architecture view, its layout, and its mapping view are restored, as far as they have been modified. Importing a view again closes the windows showing it. The window opened by the
button of the architecture view entry and the Mapping Window of the check are reopened at their previous positions in the tabs. The entry is enabled only if there is anything to revert.
Delete check '<check name>'Available over a check entry. After confirmation, removes the check from the project and deletes its architecture view, mapping view, and result view from the RFG, closing any windows showing them. The persistent layouts of the architecture view are deleted from the persistent layout storage of the RFG. If the check has files in the project directory, the confirmation dialog offers to delete them as well. Unless they are deleted, the files remain in the project directory.
While a project is open, views used by the project cannot be deleted from the
View Box, and the layouts managed by the project cannot be renamed
or deleted.
The name, the check type, and the views of an existing check cannot be changed. To change them, create a new check.
Running architecture checks¶
Run in a check entry runs the architecture analysis with the
views and options of the check.
Run all in the project entry
runs all checks. Each check creates a result view named after the check and opens it in
a hierarchical graph window that uses the architecture layout of the check. The result
view contains the violating edges, and both the result edges and the violating edges are
lifted (see The graphical Architecture Check result view). The
Analysis dialog is not involved.
Running a check again replaces its result view. If a window showing the previous result is open, the new result window takes its place in the tabs and keeps its layout, for example the expanded nodes. This allows you to update the result after changing the architecture or the mapping without having to rearrange the result window.
The Violations List is not opened automatically. To open it, choose
Open violations... from the context menu of the
check entry. The list is opened in the tab to the right of the result window or, if it
is already open, made the active window. Alternatively, choose
Open → Violations... from the
context menu of the result view in the
View Box. If the
Violations List of a check is open when the check is run again (e. g., via the
Update button), it is updated alongside the graphical result window. This
only applies to the full Violations List, not to the lists of causing edges opened by
double-clicking a result edge.
Architecture check options¶
The button in a check entry opens the
Architecture Check
Options dialog. These options are stored in the project file and are also used by
Architecture-GravisArchitectureProject.
The Architecture Check Options dialog.¶
Type hierarchyThe root of the edge type hierarchy to be checked. The default is
Source_Dependency.Declaration forwardingEnables the special handling of declarations described in Handling C/C++ Declarations.
Forwarding typesets the edge type of declaration forwarding dependencies.Allow dependencies to parentsPermits all dependencies between elements mapped to a component and elements mapped to one of its ancestors without explicit edges in the architecture.
Ignored edge typesDependencies of these edge types are not reported as divergences or convergences. The button next to the field opens a dialog for choosing the types.
The first three options correspond to the options of the same name in the
Analysis dialog (see Performing Architecture Analysis).
5.9.6.2. Mapping Window¶
The Mapping Window provides convenient facilities for reviewing and editing the mapping
between the source code and the architecture. The
Architecture,
Mapping, and
Hierarchy roles must be assigned
prior to opening the Mapping Window. The window is opened by either double-clicking the view
with the role
Mapping in the
View Box, or by
choosing either Edit →
Architectural
mapping →
Architecture as tree or
Edit →
Architectural
mapping →
Architecture as graph from
the main menu, or by choosing either
Open →
Mapping
with architecture as tree... or
Open →
Mapping
with architecture as graph... from the context menu of the view with the role
Mapping in the
View Box. With an architecture
project, use the button of the mapping view entry in the
Architecture Project Tree, which assigns
the roles automatically.
The Mapping Window is divided into two sections. The left section displays the hierarchy view as a tree, and the right section displays the architecture view as either a tree or a graph.
Note
If the architecture is displayed as a tree, notes are omitted because their contents cannot be displayed in a tree and mapping source code to a note is not meaningful. They are shown if the architecture is displayed as a graph.
The Mapping Window with the architecture shown as a tree.¶
The node symbols in both sections are decorated with blue and white icons indicating each node’s mapping state.
Icon |
Hierarchy section |
Architecture section |
|---|---|---|
|
lacks a mapping |
lacks a mapping |
|
source of a mapping |
target of a mapping |
|
itself not mapped but all children are mapped |
itself not mapped to but all children are mapped to |
|
itself not mapped but some children are mapped |
itself not mapped to but some children are mapped to |
|
implicitly mapped by ancestor node |
ancestor node is mapped to |
|
implicitly mapped by ancestor node and some children are mapped |
ancestor node and some children are mapped to |
Additionally, any node that is directly mapped (or mapped to) displays a small downward-pointing
arrow (
) if there are descendant nodes in its subtree
with a mapping that overrides this node’s mapping. These can be found using
Mapping →
Select mapped
descendants from the context menu (see the next section). A small upward-pointing
arrow (
) is displayed if there is an ancestor node whose
mapping is overridden by this node’s mapping.
The Mapping Tool¶
The hierarchy and architecture sections are tree or graph windows themselves, so
you can use the full range of tools to navigate or even edit both views. However, the
most important tool is the
Mapping Tool, which is
available only in the Mapping window and allows you to inspect and change the
mapping from nodes in the hierarchy view to nodes in the architecture view.
The
Mapping Tool functions like the Select Tool in that it
allows you to select, expand, and collapse nodes (and even move or resize
them in a graph window). What makes it different is that it allows you to drag a node or
a selection of nodes from the left section of the mapping window (the hierarchy) onto a
node in the right section (the architecture) to map the dragged node(s) to the target.
Dragging an unselected node maps only that node to the target. Dragging a selected
node maps the entire selection, i. e., all other selected nodes
are mapped as well. While dragging a selection of multiple nodes, the cursor changes to
to indicate this, as opposed to
when dragging a single node. The curved arrow in the cursor
turns green when it points at a valid target node in the architecture section (
when dragging a single node or
when dragging a selection), and the target node is
highlighted.
Reviewing the mapping¶
The “Mapped to” column in the hierarchy section displays the mapping target of each node. A node has an explicit mapping target (shown in black) if the node itself is mapped. Children of mapped nodes that are not themselves explicitly mapped are implicitly mapped to the same target as their parents. Implicit mappings are shown in gray.
Clicking a node in the hierarchy section that already has a mapping highlights the target node in the architecture view with a flashing purple frame (graph) or a flashing yellow background (tree). If the target node is not visible because it is inside a collapsed parent or ancestor node, the closest visible ancestor node is highlighted instead, though less prominently, to indicate that the mapped node is inside it. In a graph, flashing purple corners appear around the target node, and in a tree, the target node is shown with a flashing pale yellow background.
Similarly, clicking a node in the architecture section highlights all nodes in the hierarchy section that are mapped to this node in yellow (or pale yellow, if the mapped node itself is not visible).
5.9.6.3. Fixing Mapping Problems¶
When opening the mapping dialog or running architecture analysis, Gravis checks the validity of the mapping view before proceeding. If there are any problems, Gravis displays an alert showing the number of problems that were found:
The Mapping Problems alert.¶
Clicking Fix problems resolves the issues by deleting the offending
elements. This is not always the most appropriate solution; it is recommended to
investigate the problems first via Mark offending elements. This
marks all the nodes and edges in the mapping view that cause problems and opens the
mapping view as a flat diagram to show them. A more detailed summary can be obtained by
clicking Details... to open the Mapping Problems Details
dialog:
The Mapping Problems Details dialog.¶
This dialog shows all the details of the mapping problems and allows them to be
investigated or fixed individually by selecting the desired resolution in the
Action column on the right. The default action is to ignore the problem.
Note that you cannot proceed with your original task (opening the mapping dialog or
running architecture analysis) while there are still unresolved major problems. The
entries Fix and Mark correspond to the buttons in the
previous dialog, and the same caveats apply to choosing Fix.
After specifying the actions, click Apply and cancel to apply the
actions and review the results, or Apply and continue to apply the actions
and proceed with the original task (opening the mapping dialog or running architecture
analysis).
5.9.6.4. Performing Architecture Analysis¶
Note
With an architecture project, run checks from the Architecture Project Tree instead
(see Running architecture checks). The
project stores the options of each check, so the Analysis dialog
described in this section is not needed.
To open the Analysis dialog, choose
Edit →
Run analysis... from the main
menu and select Architecture
checking/Perform check in the tree display of available analyses.
The architecture analysis offers the following parameters:
The views used as
Architecture view,Mapping view,Hierarchy view, andBase view. By default, views with the
Architecture,
Mapping,
Hierarchy, and
Base roles assigned in the
View Boxare used.If the hierarchy and the relationships to be checked are both present in a single view, both
Hierarchy viewandBase viewmust be set to that view.The
Type hierarchyparameter defines the root of the edge type hierarchy to be checked. The selected type and all its subtypes are evaluated. The edge types used to model the dependencies in the architecture view must be compatible with those representing the relationships in the base view.Note
For UML users: This is why UML edges from an imported UML architecture model must be interpreted and transformed into source dependency edges.
The
Declaration forwardingoption enables special logic for resolving declaration mapping targets. If enabled, the root of the edge type hierarchy for which this is active can be set up. This mechanism is explained in the section “Handling C/C++-Declarations” in the Architecture Guide Architecture.Allow dependencies to parents: If enabled, all relationships between elements mapped to a child component in the architecture and elements mapped to its parent or ancestor are permitted, without the need to add an explicit dependency edge between the child and parent in the architecture.Result view: The name of the result view that captures the results of the analysis.The remaining checkboxes determine how the result view is structured and opened:
Add violating edges: Adds the edges from the Base view that caused violations (
Absenceand
Divergenceedges) to the result view. This allows
Absenceand
Divergenceedges to be double-clicked in the result view to display the list of Base view edges that caused them.Add conforming edges: Adds the edges from the Base view that caused conformances (
Convergence) to the result view. This allows
Convergenceedges to be double-clicked in the result view to display the list of Base view edges that caused them. Note that this increases processing time and memory requirements because a large amount of extra information must be stored. Since the number of edges that conform to the architecture is typically much higher than the number of edges that violate it, it is recommended to leave this option disabled unless the ability to check conformances is required.Add all nodes from hierarchy: If enabled, all nodes from the Hierarchy view that are mapped to an architecture component are added as children of that component; otherwise, only the nodes from the Hierarchy view that are endpoints of architecture check result edges (and their ancestors) are added to the result view. Disabling this option minimizes the number of source-related graph elements in the result view by excluding elements that do not contribute to any architecture check result edges.Lift architecture check result edges: If enabled, the
Absence,
Divergence, and
Convergenceedges are lifted in the result view; i. e., additional summary edges are created between all enclosing ancestor nodes, up to the top level. This option should typically be enabled, as it makes it much easier to find result edges buried deep in the hierarchical structure of the architecture.Lift violating/conforming edges: If enabled, the edges from the Base view that caused architecture check result edges are also lifted in the result view.Open result list: If checked, a window displaying the architecture check result edges as a table is opened (similar to how the dashboard displays the list of issues found in the analyzed system).Open graphical result view: If checked, a hierarchical graph window displaying the architecture check results is opened.
The Run analysis button executes the analysis. A result view is created and
the requested result windows are opened once the analysis is
complete.
If not opened automatically, the result list can be opened manually using the menu
entries
Open → Violations...,
Open → Conformances...,
or
Open → Result edges...
from the context menu over the result view in the
View Box,
depending on which types of result edges were computed by the analysis (violations only,
conformances only, or both).
If not opened automatically, the architecture check result view can be opened manually
by double-clicking its entry in the
View Box.
Depending on the license, the Dependencies group of the
Analysis dialog offers two additional analyses:
Find cyclesdetects cycles in theBase viewand stores them in a new view with the name specified inResult view. IfInclude self-loopsis selected, nodes with self-loops are also treated as cycles.Dead codeidentifies code in theBase viewthat cannot be reached from an entry point. Entry points are all nodes in theEntries view. Dead code is added to a new view with the name specified inDead view, and alive code to a new view with the name specified inAlive view.
5.9.6.5. Interpreting the Result of Architecture Analysis¶
The results of Architecture Analysis can be viewed in two ways:
As a Violations/Conformances/Result Edges List, which displays architecture check result edges (
Absence,
Divergenceand/or
Convergence) alongside their causing edges in a table. Each architecture check result edge is caused by one or more source-related edges. If multiple causing edges exist for a given result edge, that result edge appears multiple times in the table.As a graphical representation of the generated Architecture Check view, which shows the Architecture view enhanced with architecture check result edges and a browsable mapping in a graph window (see Section Graphical Windows).
The Violations List¶
The Violations/Conformances/Result Edges List window displays the following columns (described here for violations; other types are analogous):
Column |
Contents |
|---|---|
Violation kind |
Indicates whether the result edge is an |
Violation source / Violation target |
The source and target node of the violation in the |
Causing edge count |
The number of edges at the source level that lead to the same violation. |
Parent of source |
The node containing the source node of the violation. This node is in the |
Causing source |
Source node of the violation. |
Causing edge |
Type of the edge from the Base view that causes the violation. |
Parent of target |
Node containing the target node of the violation. |
Causing target |
The target node of the violation. If the edge is a summary, the target node contains the actual targets of the edges at a deeper level. |
The Violations List¶
The first two entries in the Violations List shown above are divergences caused
by a single causing edge: the first by a
Variable_Set edge and the second by a
Static_Call edge. The subsequent causing edges – starting with the
Member_Set edge, followed by a
Member_Use edge followed by many
Enumerator_Use edges – all contribute to a single
Divergence from
IL to
Target_Program. This divergence is caused by a total of 58 causing edges, as indicated in the
Causing edge count column.
Although the Violations List displays nodes, it is fundamentally a list of edges; each
row represents a causing edge. Consequently, when clicking any list entry using the
Select Tool or
Mark Tool,
the causing edge is always selected or marked, regardless of the column clicked.
Similarly, the selection or marking status is displayed only for the causing edge, and
only in the five rightmost columns, which correspond to the causing edge.
Caution
The Violations List is associated with the Architecture Check result view, not the base view. Therefore, selecting a causing edge in the Violations List will not cause it to be shown selected in a graph window showing the base view. You can use marking rather than selection to locate causing edges or their endpoints in a graph window showing the base view. The context menu provides several useful ways to mark causing edges and their endpoints.
Long lists can be reduced in two ways. The Edge Types window applies to
the list as it does to any graph window: a row is shown only if both its violation kind and the
type of its causing edge are selected. In addition, every column can be filtered
individually. Click the filter icon in the column header to set the column’s filter. The
header icon indicates whether a filter is active for that column; filters across
multiple columns are combined.
For all columns except Causing edge count, the filter is a text pattern.
Enter the pattern and press Return. A row is shown only if the text in that column
contains the pattern; the comparison ignores case, * matches any sequence of
characters, and ? matches any single character. An empty pattern removes
the filter.
The Causing edge count column is instead filtered by a range. In the
min field, enter the smallest count to show, and in the
max field, the largest. Increasing the minimum beyond the maximum automatically
increases the maximum. Select Unlimited if you do not want to set an upper limit.
The dialog defaults to a minimum of 0 and Unlimited selected, which
applies no filter; use Reset to return to that state. Absence entries have
no causing edge count, and an empty count is treated as 0.
The two columns displaying edge types – Violation kind and
Causing edge – are subject to both types of filtering. Use the
Edge Types window to select whole subtrees of the type hierarchy, and a
column filter to match the type name as displayed.
The graphical Architecture Check result view¶
The result view consists of the architecture view enhanced with architecture check result edges and a browsable mapping; that is, each architecture component contains the mapped source code elements as children.
The Architecture Check result view¶
This arrangement allows navigating from a
Divergence
summary edge down to its causing edge(s) by drilling down the hierarchy – repeatedly
expanding the nodes at both ends of the edge until the source code edges causing
the divergence are revealed. This is only possible
if both the result edges and the causing edges are lifted in the result view (see the
architecture analysis options
Lift architecture check result edges and
Lift violating/conforming edges in section Performing Architecture
Analysis).
The Architecture Check result view after drilling down to one of the causing edges¶
In the figure above, the causing edge of the Divergence from MessageQueue to
Driver has been revealed to be a Static_Call edge from message_queue_process
to driver_sensor_read. The edge from Main to driver_init is still a
summary edge. Further expansion of Main is required to reveal its causing edge.
Double-clicking on architecture check result edges¶
If the Add violating edges option is enabled, double-clicking a
Divergence edge opens a Violation List window displaying
all source code edges that caused the violation. If the
Divergence is a summary edge, the list contains the causing edges of all
actual violations represented by the summary edge. Similarly, if the Add
conforming edges option is enabled, double-clicking a
Convergence edge opens a Conformances List window displaying all source
code edges that caused the conformance. If the
Convergence is a summary edge, the list contains the causing edges of all
actual conformances represented by the summary edge.
Accepting Violations¶
A violation in the architecture analysis results can mean one of two things:
The architecture model is correct, but there is an unwanted or missing dependency in the source code (unwanted in the case of a divergence or missing in the case of an absence). To fix this, you must adapt the source code and then re-run the architecture analysis.
The source code is correct, but there is a missing or superfluous dependency in the architecture model (missing in the case of a divergence or superfluous in the case of an absence).
If the latter is true, the dialog opened via the
Accept violation... menu entry provides an easy way to adapt the
architecture model to fix the violation.
Caution
Using this feature updates the architecture view in the currently loaded RFG. While this change can be saved by saving the RFG, in a typical CI workflow the RFG is only a transient end product of the analysis. During each analysis run, the RFG is created from scratch and the architecture is typically imported from a GXL file. To use the updated architecture in the next CI analysis run, the updated architecture view must be exported as a GXL file to replace the CI architecture input file.
This applies only if you do not use an architecture
project. With an architecture project, the
modified architecture view is marked in the Architecture Project Tree and saved to the
project directory using its save button or Save all.
Accepting a Divergence¶
A divergence can be fixed by adding a suitable dependency to the architecture model. In
theory, adding an edge of the closest common supertype of all edges contributing to the
divergence would suffice. However, if the architecture model uses a more
general type
throughout – for example,
Source_Dependency – it is usually better to use that type for consistency.
The dialog to accept a divergence¶
The dropdown menu of the Type combo box lists all possible edge types
that would fix the divergence. The default is the most general type, typically
Source_Dependency. Clicking
Update architecture adds an edge of the selected type to the architecture
view.
Accepting an Absence¶
An absence can be fixed by either removing the unmatched dependency from the architecture or keeping it and making it optional. The latter fixes the absence violation while still allowing future software revisions to use the dependency.
The dialog to accept an absence¶
The dialog offers both possible fixes. Clicking Update architecture
performs the selected action.





