Using State Counters (HP ALM/QC)

Posted by Albert Gareev on May 13, 2015 | Categories: HP ALM / QCSource code

This is a technical entry with my research-and-experiment notes. Feel free to add or argue. Try at your own risk.

I continue my study journal figuring out HP ALM configuration. This entry is about customization with VBScript.

General Idea

How many times we had to reopen failed fixes? How many times regression defects ruined testing schedule? Tracking such occurrences is useful both for learning testing lessons and for project management. There’s even a metric called Fault Feedback Ratio.

But how technically we can obtain such data? Obviously, we don’t want to know just the number of issues currently existing in ‘Reopen’ state.. One way is to utilize Workflow events system and track state transitioning in real-time, increasing counters of failures and reopens every time the issue transitions to this state.

Code Examples

Initialize Counters

Sub Template_Bug_New
  'start reopen counter
  Bug_Fields.Field("BG_USER_TEMPLATE_01").Value = 0

  'start failed counter
  Bug_Fields.Field("BG_USER_TEMPLATE_17").Value = 0
End Sub

Update Counters

Function Template_Bug_CanPost
  'Count Reopen and Count Failed
  If Bug_Fields("BG_STATUS").IsModified AND (Bug_Fields("BG_STATUS").Value = "Reopen") Then
      If Bug_Fields("BG_USER_TEMPLATE_01").IsNull Then
           Bug_Fields("BG_USER_TEMPLATE_01").Value = 1
           Bug_Fields("BG_USER_TEMPLATE_01").Value = Bug_Fields("BG_USER_TEMPLATE_01").Value + 1
      End If

      If Bug_Fields("BG_USER_TEMPLATE_14").IsModified AND (Bug_Fields("BG_USER_TEMPLATE_14").Value = "Failed") Then
            If Bug_Fields("BG_USER_TEMPLATE_17").IsNull Then
                 Bug_Fields("BG_USER_TEMPLATE_17").Value = 1
                 Bug_Fields("BG_USER_TEMPLATE_17").Value = Bug_Fields("BG_USER_TEMPLATE_17").Value + 1
            End If
      End If
  End If
End Function

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.