The page describes the computation of the metric grade at application level. Computation need to be done on the Central Database.
This computation can be useful when comparing two snapshot results or when the metric grade at system/application/module level is not as expected (0, 4 or any other).
|Microsoft SQL Server|
- Check that the Consolidation mode is used. This can be viewed in Expert mode in the CAST Management Studio > Assessment Model editor, under Quality Model > Consolidation Settings:
For more information on various consolidation modes see the documentation here: Defining consolidation settings
- Select from the below list depending on what is selected in Cast-MS Assessment Model -
The grade is calculated without any impact of modules by summing up the impact of the technical criteria associated with the business criteria.
the metric grade at application level = SUM (<WEIGHT_OF_TECHNICAL_CRITERION>*<METRIC_GRADE_OF_EACH_TECHNICAL_CRITERION at Application Level>)/SUM(<WEIGHT_OF_EACH_TECHNICAL_CRITERIA>)
Here we are computing the grade of Documentation Business Criteria -
Sum (grade of each technical criteria * weight) / Sum (weight) = (2.71*1 + 3.01*1 + 4*1 + 4*1)/(1 + 1 + 1 + 1) = 13.72/4 = 3.43
When there are critical metrics involved :
When you have some critical metrics involved in the grade calculation then you need to take the minimum grade among those critical metrics grade and from the result of above formula.
From above screenshot, let's calculate the grade of TC-Programming Practices - Error and Exception Handling. There are 4 critical rules here with grade 1,1,1.95,2.81
=Min( ( (SUM (<WEIGHT_OF_QR>*<GRADE_OF_EACH_QR>)/SUM(<WEIGHT_OF_EACH_QR>)/SUM(<WEIGHT_OF_EACH_QR>),1,1,1.95,2.81)
=1 ( Min value of above list of values)
Average of Modules
The grade at application level is calculated with the impact of all modules taking a simple average of grades of the metric at module level.
the metric grade at application level = SUM(<METRIC_GRADE_OF_EACH_MODULE>)/NUMBER_OF_MODULES
In the below screenshot we are calculating grade for Quality Rule - Avoid Open SQL Queries in Loops
the metric grade at application level = (1+1+1)/3 = 1
For business criteria and Technical criteria - Get the grades at module level from the Investigation Quality Model Drill down view of dashboard by clicking on each module displayed in the drop down box situated at the left top of the dashboard.
Average of Modules (weighted by Business Value)
the metric grade at application level = SUM (<WEIGHT_OF_MODULE>*<METRIC_GRADE_OF_EACH_MODULE>)/SUM(<WEIGHT_OF_ALL_MODULES>)
Get the ID of the metric used for module weight using following query to be executed on central database -Example
SELECT OPTION_VALUE FROM SYS_SITE_OPTIONS WHERE OPTION_NAME = 'ADG_CENTRAL_WEIGHT_METRIC'
Result - 10152 .
It means the metric bearing the ID 10152 is used as aggregation Weight
Get values of weight per module by running the below query on central database -Example
SELECT dmr.metric_num_value AS "WEIGHT", ap.object_id AS "MODULE_ID", ap.object_name AS "APP_NAME", dmr.snapshot_id AS "SNAPSHOT_ID" FROM dss_objects AP, dss_metric_results DMR, dss_links DL WHERE dmr.metric_id = <weight_metric_id> AND dmr.metric_value_index = 1 AND dmr.object_id = ap.object_id AND dl.previous_object_id = <application_id> AND dl.next_object_id = ap.object_id AND ap.object_type_id = 20000 AND dl.link_type_id = 1
Use this page to get the APPLICATION_ID - SQL Queries - CAST Central Base - Queries on applications - How to get the ID of the application.
SELECT DMR.metric_num_value AS "WEIGHT", AP.object_id AS "MODULE_ID", AP.object_name AS "APP_NAME", DMR.snapshot_id AS "SNAPSHOT_ID" FROM dss_objects AP, dss_metric_results DMR, dss_links DL WHERE DMR.metric_id = 10152 AND DMR.metric_value_index = 1 AND DMR.object_id = AP.object_id AND DL.previous_object_id = 3 AND DL.next_object_id = AP.object_id AND AP.object_type_id = 20000 AND DL.link_type_id = 1 Result - WEIGHT;MODULE_ID;APP_NAME;SNAPSHOT_ID 2;52251;"RECIPE BL";1 4;52252;"RECIPE COMMON";1 2;52253;"RECIPE DAL";1 1;52254;"RECIPE DATABASE";1 4;52255;"RECIPE MODEL";1 1;52256;"RECIPE SECURITY";1 4;52257;"RECIPE WEB";1
Get the grades at module level from the Investigation Quality Model Drill down view of dashboard by clicking on each module displayed in the drop down box situated at the left top of the dashboard.
Calculation Example -
|Weight from query||Module Name||Grade From Dashboard|
(2*2)+(4*1)+(2*1)+(1*1)+(4*3)+(1*2)+(4*2) / (2+4+2+1+4+1+4) = 1.83