Metric - Helmut-Ortmann/EnterpriseArchitect_hoTools GitHub Wiki
Metric
For processes like SPICE and Functional Safety you need
- Metrics
- Amount what is traced, verified
- Amount what isn't traced, implemented
- Charts
- Tables and Matrixes
- Filter
- Find
- Group
- Analysis
- Analyze with Excel & Co
- Write Scripts
- Dig deep into the unknown
- Use ad-hoc tools like
- SQL, a tutorial
- LinqQPad
This page shows you with the focus on metrics:
- SQL
- Visualization in EA
The Examples you find at GitHub, ScriptDotNet.eap
Mechanismn
Beneath you see some mechanism to accomplish metrics and visualisations. Always keep in mind:
- Diagrams are powerful to communicate understanding
- Tables and Matrixes are powerful to find and analyse
- Charts help you get the big picture
- Excel & Co suits you well for advanced requirements
- Scripts and advanced analyse-tools like LinqPad help you to dig deep in the data
Check sql
SQL is your basic tool to accomplish this. Here you find some useful references.
- EXISTS
- ANY, true if any of the sub-query values meet the condition
- ALL, true if all of the sub-query values meet the condition
- Group by
- JOIN
- Subquery
- Functions
- UNION
Combine Multiple columns
select "Count Objects" As Metric, t1.CountAll, t2.CountClass, t3.ClassWithOutLinks, t4.ClassWithInLinks, t5.ClassNoLinks, t6.ClassWithLinks, t5.ClassNoLinks + t6.ClassWithLinks As [Sum Classes to check]
from
(Select count(o.name) As CountAll from t_object o ) As t1,
(Select count(o.name) As CountClass from t_object o where o.object_type = "Class") As t2,
(Select count(o.name) As ClassWithOutLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.start_object_id = o.object_id) ) as t3,
(Select count(o.name) As ClassWithInLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.end_object_id = o.object_id) ) as t4,
(Select count(o.name) As ClassNoLinks
from t_object o where o.object_type = "Class" AND NOT exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t5,
(Select count(o.name) As ClassWithLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t6
Combine Multiple rows
select "Count Classes" As Metric, t2.Count, t3.WithOutLinks As [with Out-Links], t4.WithInLinks As [with In-Links], t5.NoLinks as [no Links], t6.WithLinks as [with Links],
t5.NoLinks + t6.WithLinks As [Sum to check]
from
(Select count(o.name) As Count from t_object o where o.object_type = "Class") As t2,
(Select count(o.name) As WithOutLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.start_object_id = o.object_id) ) as t3,
(Select count(o.name) As WithInLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.end_object_id = o.object_id) ) as t4,
(Select count(o.name) As NoLinks
from t_object o where o.object_type = "Class" AND NOT exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t5,
(Select count(o.name) As WithLinks
from t_object o where o.object_type = "Class" AND exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t6
UNION
select "Count Parts" As Metric, t2.Count, t3.WithOutLinks, t4.WithInLinks, t5.NoLinks, t6.WithLinks, t5.NoLinks + t6.WithLinks
from
(Select count(o.name) As Count from t_object o where o.object_type = "Part") As t2,
(Select count(o.name) As WithOutLinks
from t_object o where o.object_type = "Part" AND exists (select * from t_connector c where c.start_object_id = o.object_id) ) as t3,
(Select count(o.name) As WithInLinks
from t_object o where o.object_type = "Part" AND exists (select * from t_connector c where c.end_object_id = o.object_id) ) as t4,
(Select count(o.name) As NoLinks
from t_object o where o.object_type = "Part" AND NOT exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t5,
(Select count(o.name) As WithLinks
from t_object o where o.object_type = "Part" AND exists (select * from t_connector c where c.end_object_id = o.object_id or c.start_object_id = o.object_id) ) as t6
Order by 1
Package, Tagged Value
You have to use a LEFT JOIN for Tagged Values because of possible NULL values.
select o.ea_guid AS CLASSGUID , o.object_type AS CLASSTYPE,
p.Name as [Package], o.name As [Requirement],
Left(o.Note,100) As [Description],
pASIL.Value As ASIL
from (t_object o
inner join t_package p on o.Package_id = p.Package_id)
left join t_objectproperties pASIL on pASIL.object_id = o.object_id
where
o.object_type = "Requirement"
order by 3, 4, 6
GROUP BY
Use the column number, here count(2), instead of count(pASIL.Value), to also count NULL values of the ASIL level.
select
p.Name as [Package],
pASIL.Value As ASIL,
count(2) As Count
from (t_object o
inner join t_package p on o.Package_id = p.Package_id)
left join t_objectproperties pASIL on pASIL.object_id = o.object_id
where
o.object_type = "Requirement"
group by p.Name,pASIL.Value
order by 1,2
Use Model View
SQL
select
p.Name as [Package],
pASIL.Value As ASIL,
count(2) As Count
from (t_object o
inner join t_package p on o.Package_id = p.Package_id)
left join t_objectproperties pASIL on pASIL.object_id = o.object_id
where
o.object_type = "Requirement"
group by p.Name,pASIL.Value
order by 1,2
Edit the View
With Context Menu, Edit List View you have powerfull list functions:
- Filter
- Sort
- Choose column
- Navigate to Browser/Diagram
Charts
Bar
select pASIL.Value As [Series],
p.Name As [GroupName]
from (t_object o
inner join t_package p on o.Package_id = p.Package_id)
left join t_objectproperties pASIL on pASIL.object_id = o.object_id
where
o.object_type = "Requirement"
Pie
select pASIL.Value As [Series]
from (t_object o
inner join t_package p on o.Package_id = p.Package_id)
left join t_objectproperties pASIL on pASIL.object_id = o.object_id
where
o.object_type = "Requirement"
Excel
You can export Searches to Excel & Co for further analysis.
EA Standard
- Run the SQL Query with EA
- Export to CSV or use the Clipboard
hoTools
hoTools allows you to run Queries to Excel, Export to Excel.
Remember
- Insert related Elements in Diagram
- Heat Maps
- Model Views
- Relationship Matrix
- Relationship Window CTRL+Shift+2
- Traceability Window CTRL+Shift+4
Glossary
Term | Description |
---|---|
Heat Map | A heat map uses a warm-to-cool color spectrum to quickly show you important things.A heat map is a two-dimensional representation of data in which values are represented by colors. A simple heat map provides an immediate visual summary of information. More elaborate heat maps allow the viewer to understand complex data sets. A powerful tool to intuively understand complex data |