ConDec presents metrics calculated on the knowledge graph data structure in a knowledge dashboard. The dashboard comprises five dashboard items that show the following metrics:
- the rationale coverage of requirements and code, e.g., how many decisions are documented for a requirement?,
- intra-rationale completeness, e.g., are there arguments for the decisions?,
- general metrics, e.g., how many rationale elements are documented per origin/documentation location?,
- metrics on the knowledge in git, e.g., do the rationale elements documented in code comments and commit messages of a branch fulfill the definition of done (DoD)?, and
- metrics on the decision levels and decision groups, e.g. Which decision groups are there in the project? How many decisions are documented per decision level and group?
The metric plots are created using the Apache ECharts library. The five dashboard items are shown in the following sections.
This dashboard item shows the coverage of requirements, code, and other software artifacts (=knowledge elements) with a specific decision knowledge type, in particular, decision problem or decision. For example, this dashboard item shows how many decisions are reachable from a requirement or how many decisions are reachable from a code file within a certain link distance in the knowledge graph. Note that the rationale coverage is not calculated for rationale elements as source elements because there are dedicated metrics for intra-rationale completeness (see below).
Rationale coverage dashboard item showing the issue/decision problem coverage and decision coverage using boxplots and pie charts
This dashboard item presents metrics regarding the intra-rationale completeness. In particular, metrics are shown to answer the following questions:
- How many issues (=decision problems) are solved by a decision? How many issues are not solved by a decision?
- How many issues have at least one alternative documented? How many issues have no alternatives documented?
- For how many decisions is the issue (=decision problem) documented? For how many decisions is no issue documented?
- How many decisions have at least one pro-argument documented? How many decisions have no pro-arguments documented?
- How many decisions have at least one con-argument documented? How many decisions have no con-arguments documented?
- How many alternatives have at least one pro-argument documented? How many alternatives have no pro-arguments documented?
- How many alternatives have at least one con-argument documented? How many alternatives have no con-arguments documented?
Intra-rationale completeness dashboard item showing the metrics using pie charts
This dashboard item presents the following metrics on the knowledge graph data structure after the graph was filtered with the given filter settings:
- Number of comments per Jira issue
- Number of commits per Jira issue
- Number of linked Jira issues per code file (via commits with a Jira issue key in the commit message), number of unlinked code files that are not reachable from Jira tickets
- Number of lines of code (LOC) per code file and total number of lines of code
- Number of code files and requirements in the project
- Number of rationale elements per origin/documentation location
- Number of comments with and without decision knowledge
- Number of decision knowledge elements per decision knowledge type
- Number of knowledge elements fulfilling and violating the definition of done (DoD)
The metrics involving code files work on those files that are added to the knowledge graph. The rationale manager can configure which file types (e.g. java, js, ts, ...) to include in the knowledge graph.
General metrics dashboard item showing metrics using boxplots and pie charts
This dashboard item presents decision knowledge-related and general metrics on the git branches of a Jira project. Branches are represented as a Diff object. In particular, the following metrics are shown:
- Quality status of git branches: incorrect, i.e. violates the DoD, good, i.e. fulfills the DoD, or no rationale, i.e. no rationale elements documented in code comments and commit messages of a branch.
- Quality problems in git branches to explain the DoD violations, e.g. Issue does not have a valid decision
- Number of issues/decision problems in code comments and commit messages of a branch
- Number of decisions in code comments and commit messages of a branch
- Number of alternatives in code comments and commit messages of a branch
- Number of pro-arguments in code comments and commit messages of a branch
- Number of con-arguments in code comments and commit messages of a branch
- Overview on Jira issues related to git branches
Dashboard item showing metrics about the knowledge in git using boxplots and pie charts
This dashboard item presents an overview on the decision levels and decision groups that the knowledge elements (in particular, the decision problems and solution options) documented within a project belong to. The following metrics are shown:
- Number of knowledge elements per decision level
- Number of knowledge elements per decision group
- Number of decision groups assigned to the knowledge elements (=decision group coverage)
Dashboard item showing metrics about the decision levels and decision groups
All dashboard items can be filtered and the filter settings are persisted for every dashboard item. The filter settings are used to filter the knowledge graph similar to the knowledge graph views. For example, the status filter specifies whether the decision problems should be resolved or unresolved. Per default, both resolved and unresolved decision problems (issues) are included. Similarly, the filter settings can be used to specify that the coverage of decisions should only include decisions with status decided and no decisions with status rejected or challenged.
Filter settings for rationale coverage dashboard item
Developers can navigate to the detail views of the knowledge elements or git branches that are shown in the dashboard metric plots, for example, to fix violations of the DoD. The metric plots are interactive and the developers can click on data points in the metrics plots. When clicking on a metric plot, ConDec presents a dialog with hyperlinks to the detail views of the respective knowledge elements or git branches. The overall goal is to support ubiquitous linking.
Navigation dialog with elements violating the DoD
The following class diagram gives an overview of relevant backend classes for the dashboard.
Overview class diagram for the dashboard
The Java code for metric calculation and the dashboard creation can be found here:
- Java code for the metric calculation
- Java code for the dashboard creation
- Java REST API for dashboard
The UI code for the dashboard can be found here:
In the following, knowledge elements regarding the knowledge dashboard are listed. The knowledge elements were exported via ConDec's knowledge export feature starting from the user sub-task ST: Analyze quality of documented decision knowledge and other knowledge (requirements, code). Code files and decision knowledge elements that are (transitively) linked to the sub-task are shown.
- ST: Analyze quality of documented decision knowledge and other knowledge (requirements, code) (CONDEC-202)
- Should there be one REST API method per dashboard or per single metric?
- Should the rationale manager be able to change the definition of done (DoD) in the dashboard?
- Should the metrics for the dashboards be calculated in the frontend or the backend?
- How should the thumbnail for the dashboard item look like?
- ConDecDashboardItem.java
- Which filter settings should be supported in the dashboard items?
- GeneralMetricsDashboardItem.java
- Which metrics should be plotted in the dashboard?
- How can the rationale manager and the developers see which decision groups are used in the project and which decisions are assigned to the decision levels and decision groups?
- Where to calculate metrics on the knowledge documentation?
- How to display the rationale coverage for requirements (Jira issues) and code?
- Which Jira issue types should the user be able to select when creating the decision knowledge report/dashboard?
- How can we reduce the coupling between ConDec classes?
- How to enable navigation from metrics plots in dashboard to detail views?
- Should all diagrams in the knowledge dashboard support the navigation function?
- How can we enable the user to navigate to the Jira issue belonging to a data point in a metric visualization?
- Which default value should be used for the link distance filter?
- GeneralMetricCalculator.java
- Which dashboard items does the rationale manager need?
- The rationale manager needs a 1) basic statistics dashboard that shows metrics such as #requirements in the project, #decision problems in the project, #decisions in the project, #commits per Jira issue, #comments per Jira issue, 2) a dashboard for viewing the rationale coverage status/quality of requirements/work items, 3) a dashboard for viewing the intra-rationale completeness, 4) a dashboard for decision groups and levels, and 5) a dashboard for viewing the documentation status/quality of feature branches!
- Should the metrics be calculated in Java or JavaScript code?
- Should all metrics be gather in one dashboard or be split up into multiple different dashboards?
- BranchMetricCalculator.java
- DashboardRest.java
- JiraIssueMetric.java
- CommentMetricCalculator.java