Using and working with Impact Factor
Note that Impact Factor is ONLY used when the measurement mode is set to Enhancement Function Points (EFP) in the CAST Management Studio. If the mode is set to the default Automated Enhancement Points (AEP) then a read-only Complexity Factor is used instead.
An Impact Factor is a value that is applied to a Transactional Function or a Data Function. By default, all Transactional Functions / Data Functions are given a default Impact Factor value of 1.0 - this can be seen in the Enhancement node - Right hand panel by selecting either the Data Function or the Transactional Functions sub node:
The EFP (Enhancement Function Points) value of a Transaction is derived from the multiplication of the Impact Factor and the EFP value (IF x EFP = EFP) - therefore, by manually modifying the Impact Factor value up or down (based on whether a change in the Transactional Function / Data Function is high or low impact) it is possible to influence the resulting EFP value.
Take the following example for Transactional Functions. All items are using the default 1.0 Impact Factor value:
Then, the Impact Factor value is changed to 0.4 for all DELETED Transactional Functions. The result is that the EFP value has been changed to 3 (0.4 x 7 = 2.8, rounded to 3):
Implementing custom Impact Factor values
The CAST Dashboard Service is delivered with three empty SQL procedures that will be executed (when a custom option is set to do so) during the snapshot generation process. The code in the SQL procedures will cause the Impact Factor value to be changed.
Implementing custom Impact Factor values is a multi-step process, described below:
1) Enabling the custom option to call the SQL procedures
To call the SQL procedures during the snapshot generation, you must first enable (set to ON) a custom option in the Dashboard Service.
CSS | /* Replace <name_of_Dashboard_Service> with the name of your Dashboard Service schema */set search_path=<name_of_Dashboard_Service>;select set_tcc_option_fpcustom (1,1) |
Oracle | declare returnCode int =0;beginreturnCode = SET_TCC_OPTION_FPCUSTOM (1,1);end; |
MS SQL Server | exec SET_TCC_OPTION_FPCUSTOM 1,1 |
Each of the above options will cause a new line to appear in the SYS_SITE_OPTIONS table when running the following query:
select * from SYS_SITE_OPTIONS where OPTION_NAME = 'TCC_FP_EXECCUSTOM_STEPS'
Result:
"TCC_FP_EXECCUSTOM_STEPS";"TRACE_ON"
2) Disabling the custom option to call the SQL procedures
If you no longer require the SQL procedure, then run the following queries:
CSS | /* Replace <name_of_Dashboard_Service> with the name of your Dashboard Service schema */set search_path=<name_of_Dashboard_Service>; |
Oracle | declare returnCode int =0;beginreturnCode = SET_TCC_OPTION_FPCUSTOM (0,0);end; |
MS SQL Server | exec SET_TCC_OPTION_FPCUSTOM 0,0 |
This will remove the option from the SYS_SITE_OPTIONS table:
select * from SYS_SITE_OPTIONS where OPTION_NAME = 'TCC_FP_EXECCUSTOM_STEPS'
Result:
no results
3) SQL Procedures
The three empty SQL procedures can be found in the Dashboard Service - each one corresponds to the state that a Transactional Function/Data Function can be in (there is no SQL procedure for the UNCHANGED status):
Type | Name | Status | Table To Update |
---|---|---|---|
Data Function | EFP_USR_IF_DEL_DF_RULE | DELETED | EFP_DF_Info |
Data Function | EFP_USR_IF_MOD_DF_RULE | MODIFIED | EFP_DF_Info |
Data Function | EFP_USR_IF_ADD_DF_RULE | ADDED | EFP_DF_Info |
Transactional Function | EFP_USR_IF_DEL_TF_RULE | DELETED | EFP_Tran_Info |
Transactional Function | EFP_USR_IF_MOD_TF_RULE | MODIFIED | EFP_Tran_Info |
Transactional Function | EFP_USR_IF_ADD_TF_RULE | ADDED | EFP_Tran_Info |
4) Table to update for the Impact Factor
The Impact Factor value is available for all Transactional Functions/Data Functions of a given snapshot. It is stored in two tables (one for Transactional Functions, one for Data Functions) in the CAST Dashboard Service. The tables are described below:
Data Functions - EFP_DF_Info
column Name | description | type | Information | How to use |
---|---|---|---|---|
Snapshot_ID | The Snapshot Id | Integer | not null | READ-ONLY |
Object_ID | Data Function Id : : to find the name join the table DSS_OBJECTS | Integer | not null | READ-ONLY |
Object_Checksum | Data Function Checksum | Integer | not null | READ-ONLY |
Impact_Factor | Data Function Impact Factor | Float | not null , DEFAULT = 1.0 | READ-WRITE can be updated by CUSTOM CODE |
Status | Data Function Status: ADDED, MODIFIED, DELETED, UNCHANGED | String | Computed by the snapshot | READ-ONLY |
Transactional Functions - EFP_Tran_Info
Column Name | Description | Type | Information | How to use |
Snapshot_ID | The Snapshot Id | Integer | not null | READ-ONLY |
Object_ID | Transaction Id : : to find the name join the table DSS_OBJECTS | Integer | not null | READ-ONLY |
Object_Checksum | Transaction Checksum | Integer | not null | READ-ONLY |
Impact_Factor | Transaction Impact Factor | Float | not null , DEFAULT = 1.0 | READ-WRITE can be updated by CUSTOM CODE |
Status | Transaction Status: ADDED, MODIFIED, DELETED, UNCHANGED | String | Computed by the snapshot | READ-ONLY |
5) How to implement the SQL procedures
To implement the custom code to modify the Impact Factor, you need to edit the correct function corresponding to the specific status you want to update - i.e. use the EFP_USR_IF_DEL_TF_RULE procedure if you want to change the Impact Factor of Transactional Functions with the status DELETED and use the EFP_USR_IF_DEL_DF_RULE procedure if you want to change the Impact Factor of Data Functions with the status DELETED. You must update the impact factor based on a defined scope and condition.
The Update Clause should always contain the two following rows:
Snapshot_ID= I_SNAPSHOT_ID --> this is the parameter of the proc
and Status = <APPROPRIATE_STATUS> --> this is the one on the name of the proc
Example - to set the Impact Factor = 0.40 for all DELETED Transactional Functions of the snapshot. The SQL procedure to update is EFP_USR_IF_DEL_TF_RULE:
CREATE OR REPLACE FUNCTION EFP_USR_IF_DEL_TF_RULE( I_SNAPSHOT_ID int, I_CUSTOM_TRACE int)RETURNS integer AS$BODY$DECLARE L_ERRORCODE INTEGER DEFAULT 0;L_ROWCOUNT int := 0 ;Begin if ( I_CUSTOM_TRACE > 0 ) then perform cast_log('TCC-FP-CUSTOM- EFP_USR_IF_DEL_TF_RULE for I_SNAPSHOT_ID ' || to_char(I_SNAPSHOT_ID)); end if;--************** THE CUSTOM CODE STARTS BELOW ****************-update EFP_Tran_Infoset Impact_Factor = 0.40Where Snapshot_ID = I_SNAPSHOT_ID and Status = 'DELETED' ;Get Diagnostics L_ROWCOUNT := Row_Count; if ( I_CUSTOM_TRACE > 0 ) then perform cast_log('TCC-FP-CUSTOM- EFP_USR_IF_DEL_TF_RULE for I_SNAPSHOT_ID ' || to_char(I_SNAPSHOT_ID)|| ' update the Impact factor 0.40 for count : ' || to_char(L_ROWCOUNT)); end if; --************** THE CUSTOM CODE ENDS HERE ****************-Return L_ERRORCODE;END;$BODY$LANGUAGE plpgsql;
If the custom option is set to ON, then when the snapshot is generated the EFP_USR_IF_DEL_TF_RULE procedure containing the above query will be executed. The Impact Factor is set for DELETED Transactional Functions in the Dashboard Service and the resulting EFP is adjusted by the Impact Factor.
Notes
- The objective is to provide an automated process to produce "adjusted" EFP meaning that the end-user can implement specific algorithms in custom procedures to calculate IF for each transaction.
- IF is saved as a decimal value enclosed between 0 and 1.25
- Adjusted EFP are saved as integers (the decimal value produced by the multiplication of un-adjusted EFP by IF is rounded to the closer integer value) meaning there is no impact in the CAST Transaction Configuration Center, dashboards and Rest API regarding this number.
- The CAST Health Dashboard and Engineering Dashboards display the adjusted EFP in place of the current "un-adjusted" EFP. They do not display the Impact Factor.
- The Rest API provides for each transaction the adjusted EFP in place of the un-adjusted EFP and the associated IF.