| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「ファンクションポイント 簡易マクロ」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の2版が非表示)
1行目: 1行目:
==ファンクションポイント 簡易マクロ==
+
==[[ファンクションポイント 簡易マクロ]]==
[[ファンクションポイント]][[Excel VBA]]
+
[[ファンクションポイント]] | [[Excel VBA]] |
  
  
  Const KEY_VALUE_DELIM_CHAR = ":"
+
  Const KEY_VALUE_DELIM_CHA[[R]] = ":"
  Const TRANSACTIONAL_TYPE_EI = "EI"
+
  Const T[[R]]ANSACTIONAL_TYPE_EI = "EI"
  Const TRANSACTIONAL_TYPE_EO = "EO"
+
  Const T[[R]]ANSACTIONAL_TYPE_EO = "EO"
  Const TRANSACTIONAL_TYPE_EQ = "EQ"
+
  Const T[[R]]ANSACTIONAL_TYPE_EQ = "EQ"
 
   
 
   
  Const TRANSACTIONAL_COMPLEXITY_LOW = "LOW"
+
  Const TRANSACTIONAL_[[COM]]PLEXITY_LOW = "LOW"
  Const TRANSACTIONAL_COMPLEXITY_AVG = "AVG"
+
  Const TRANSACTIONAL_[[COM]]PLEXITY_AVG = "AVG"
  Const TRANSACTIONAL_COMPLEXITY_HIGH = "HIGH"
+
  Const TRANSACTIONAL_[[COM]]PLEXITY_HIGH = "HIGH"
 
   
 
   
 
   
 
   
16行目: 16行目:
 
  'トランザクショナルファンクションの複雑度を判定
 
  'トランザクショナルファンクションの複雑度を判定
 
  '
 
  '
  Public Function FP_CALC_COMPLEXITY(TransactionalFunctionType As Range, det As Range, ftr As Range) As String
+
  Public Function FP_CALC_[[COM]]PLEXITY(TransactionalFunctionType As Range, det As Range, ftr As Range) As String
 
     Dim ft      As String
 
     Dim ft      As String
 
     Dim intDet  As Integer
 
     Dim intDet  As Integer
 
     Dim intFtr  As Integer
 
     Dim intFtr  As Integer
 
      
 
      
     ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0)
+
     ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHA[[R]])(0)
 
     intDet = CInt(Val(det(1, 1).Text))
 
     intDet = CInt(Val(det(1, 1).Text))
 
     intFtr = CInt(Val(ftr(1, 1).Text))
 
     intFtr = CInt(Val(ftr(1, 1).Text))
 
      
 
      
 
     Select Case ft
 
     Select Case ft
     Case TRANSACTIONAL_TYPE_EI
+
     Case T[[R]]ANSACTIONAL_TYPE_EI
 
         ret = CalcComplexityEI(intDet, intFtr)
 
         ret = CalcComplexityEI(intDet, intFtr)
     Case TRANSACTIONAL_TYPE_EO
+
     Case T[[R]]ANSACTIONAL_TYPE_EO
 
         ret = CalcComplexityEO_EQ(intDet, intFtr)
 
         ret = CalcComplexityEO_EQ(intDet, intFtr)
     Case TRANSACTIONAL_TYPE_EQ
+
     Case T[[R]]ANSACTIONAL_TYPE_EQ
 
         ret = CalcComplexityEO_EQ(intDet, intFtr)
 
         ret = CalcComplexityEO_EQ(intDet, intFtr)
 
     End Select
 
     End Select
 
      
 
      
     FP_CALC_COMPLEXITY = ret
+
     FP_CALC_[[COM]]PLEXITY = ret
 
  End Function
 
  End Function
  Public Function FP_CALC_FUNCTION_POINT(TransactionalFunctionType As Range, complexity As Range) As Integer
+
  Public Function FP_CALC_FUNCTION_[[POI]]NT(TransactionalFunctionType As Range, complexity As Range) As Integer
 
     Dim ret    As String
 
     Dim ret    As String
 
     Dim ft      As String
 
     Dim ft      As String
 
     Dim comp    As String
 
     Dim comp    As String
 
      
 
      
     ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0)
+
     ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHA[[R]])(0)
 
     comp = UCase(Trim(complexity(1, 1).Text))
 
     comp = UCase(Trim(complexity(1, 1).Text))
 
      
 
      
 
     Select Case ft
 
     Select Case ft
     Case TRANSACTIONAL_TYPE_EI
+
     Case T[[R]]ANSACTIONAL_TYPE_EI
 
         Select Case comp
 
         Select Case comp
         Case TRANSACTIONAL_COMPLEXITY_LOW
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
             ret = "3"
 
             ret = "3"
         Case TRANSACTIONAL_COMPLEXITY_AVG
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
             ret = "4"
 
             ret = "4"
         Case TRANSACTIONAL_COMPLEXITY_HIGH
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
             ret = "6"
 
             ret = "6"
 
         End Select
 
         End Select
     Case TRANSACTIONAL_TYPE_EO
+
     Case T[[R]]ANSACTIONAL_TYPE_EO
 
         Select Case comp
 
         Select Case comp
         Case TRANSACTIONAL_COMPLEXITY_LOW
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
             ret = "4"
 
             ret = "4"
         Case TRANSACTIONAL_COMPLEXITY_AVG
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
             ret = "5"
 
             ret = "5"
         Case TRANSACTIONAL_COMPLEXITY_HIGH
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
             ret = "7"
 
             ret = "7"
 
         End Select
 
         End Select
     Case TRANSACTIONAL_TYPE_EQ
+
     Case T[[R]]ANSACTIONAL_TYPE_EQ
 
         Select Case comp
 
         Select Case comp
         Case TRANSACTIONAL_COMPLEXITY_LOW
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
             ret = "3"
 
             ret = "3"
         Case TRANSACTIONAL_COMPLEXITY_AVG
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
             ret = "4"
 
             ret = "4"
         Case TRANSACTIONAL_COMPLEXITY_HIGH
+
         Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
             ret = "6"
 
             ret = "6"
 
         End Select
 
         End Select
75行目: 75行目:
 
      
 
      
 
      
 
      
     FP_CALC_FUNCTION_POINT = CInt(Val(ret))
+
     FP_CALC_FUNCTION_[[POI]]NT = CInt(Val(ret))
 
  End Function
 
  End Function
 
   
 
   
88行目: 88行目:
 
     If ftr <= 1 Then
 
     If ftr <= 1 Then
 
         If det <= 4 Then
 
         If det <= 4 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 5 <= det And det <= 15 Then
 
         If 5 <= det And det <= 15 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 16 <= det Then
 
         If 16 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
     End If
 
     End If
100行目: 100行目:
 
     If ftr = 2 Then
 
     If ftr = 2 Then
 
         If det <= 4 Then
 
         If det <= 4 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 5 <= det And det <= 15 Then
 
         If 5 <= det And det <= 15 Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
         If 16 <= det Then
 
         If 16 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
     End If
 
     End If
112行目: 112行目:
 
     If 3 <= ftr Then
 
     If 3 <= ftr Then
 
         If det <= 4 Then
 
         If det <= 4 Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
         If 5 <= det And det <= 15 Then
 
         If 5 <= det And det <= 15 Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
         If 16 <= det Then
 
         If 16 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
     End If
 
     End If
132行目: 132行目:
 
     If ftr <= 1 Then
 
     If ftr <= 1 Then
 
         If det <= 5 Then
 
         If det <= 5 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 6 <= det And det <= 19 Then
 
         If 6 <= det And det <= 19 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 20 <= det Then
 
         If 20 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
     End If
 
     End If
144行目: 144行目:
 
     If 2 <= ftr And ftr <= 3 Then
 
     If 2 <= ftr And ftr <= 3 Then
 
         If det <= 5 Then
 
         If det <= 5 Then
             ret = TRANSACTIONAL_COMPLEXITY_LOW
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW
 
         End If
 
         End If
 
         If 6 <= det And det <= 19 Then
 
         If 6 <= det And det <= 19 Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
         If 20 <= det Then
 
         If 20 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
     End If
 
     End If
156行目: 156行目:
 
     If 4 <= ftr Then
 
     If 4 <= ftr Then
 
         If det <= 5 Then
 
         If det <= 5 Then
             ret = TRANSACTIONAL_COMPLEXITY_AVG
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG
 
         End If
 
         End If
 
         If 6 <= det And det <= 19 Then
 
         If 6 <= det And det <= 19 Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
         If 20 <= det Then
 
         If 20 <= det Then
             ret = TRANSACTIONAL_COMPLEXITY_HIGH
+
             ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH
 
         End If
 
         End If
 
     End If
 
     End If

2020年2月16日 (日) 04:19時点における最新版

ファンクションポイント 簡易マクロ

ファンクションポイント | Excel VBA |


Const KEY_VALUE_DELIM_CHAR = ":"
Const TRANSACTIONAL_TYPE_EI = "EI"
Const TRANSACTIONAL_TYPE_EO = "EO"
Const TRANSACTIONAL_TYPE_EQ = "EQ"

Const TRANSACTIONAL_COMPLEXITY_LOW = "LOW"
Const TRANSACTIONAL_COMPLEXITY_AVG = "AVG"
Const TRANSACTIONAL_COMPLEXITY_HIGH = "HIGH"


'
'トランザクショナルファンクションの複雑度を判定
'
Public Function FP_CALC_COMPLEXITY(TransactionalFunctionType As Range, det As Range, ftr As Range) As String
    Dim ft      As String
    Dim intDet  As Integer
    Dim intFtr  As Integer
    
    ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0)
    intDet = CInt(Val(det(1, 1).Text))
    intFtr = CInt(Val(ftr(1, 1).Text))
    
    Select Case ft
    Case TRANSACTIONAL_TYPE_EI
        ret = CalcComplexityEI(intDet, intFtr)
    Case TRANSACTIONAL_TYPE_EO
        ret = CalcComplexityEO_EQ(intDet, intFtr)
    Case TRANSACTIONAL_TYPE_EQ
        ret = CalcComplexityEO_EQ(intDet, intFtr)
    End Select
    
    FP_CALC_COMPLEXITY = ret
End Function
Public Function FP_CALC_FUNCTION_POINT(TransactionalFunctionType As Range, complexity As Range) As Integer
    Dim ret     As String
    Dim ft      As String
    Dim comp    As String
    
    ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0)
    comp = UCase(Trim(complexity(1, 1).Text))
    
    Select Case ft
    Case TRANSACTIONAL_TYPE_EI
        Select Case comp
        Case TRANSACTIONAL_COMPLEXITY_LOW
            ret = "3"
        Case TRANSACTIONAL_COMPLEXITY_AVG
            ret = "4"
        Case TRANSACTIONAL_COMPLEXITY_HIGH
            ret = "6"
        End Select
    Case TRANSACTIONAL_TYPE_EO
        Select Case comp
        Case TRANSACTIONAL_COMPLEXITY_LOW
            ret = "4"
        Case TRANSACTIONAL_COMPLEXITY_AVG
            ret = "5"
        Case TRANSACTIONAL_COMPLEXITY_HIGH
            ret = "7"
        End Select
    Case TRANSACTIONAL_TYPE_EQ
        Select Case comp
        Case TRANSACTIONAL_COMPLEXITY_LOW
            ret = "3"
        Case TRANSACTIONAL_COMPLEXITY_AVG
            ret = "4"
        Case TRANSACTIONAL_COMPLEXITY_HIGH
            ret = "6"
        End Select
    End Select
    
    
    FP_CALC_FUNCTION_POINT = CInt(Val(ret))
End Function



'
' EIの複雑度を計算
'
Private Function CalcComplexityEI(det As Integer, ftr As Integer) As String
    Dim ret As String
    
    If ftr <= 1 Then
        If det <= 4 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 5 <= det And det <= 15 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 16 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
    End If

    If ftr = 2 Then
        If det <= 4 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 5 <= det And det <= 15 Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
        If 16 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
    End If
    
    If 3 <= ftr Then
        If det <= 4 Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
        If 5 <= det And det <= 15 Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
        If 16 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
    End If
    
    CalcComplexityEI = ret
End Function
'
' EO、EQ の複雑度を計算
'
Private Function CalcComplexityEO_EQ(det As Integer, ftr As Integer) As String
    Dim ret As String
    
    If ftr <= 1 Then
        If det <= 5 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 6 <= det And det <= 19 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 20 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
    End If

    If 2 <= ftr And ftr <= 3 Then
        If det <= 5 Then
            ret = TRANSACTIONAL_COMPLEXITY_LOW
        End If
        If 6 <= det And det <= 19 Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
        If 20 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
    End If
    
    If 4 <= ftr Then
        If det <= 5 Then
            ret = TRANSACTIONAL_COMPLEXITY_AVG
        End If
        If 6 <= det And det <= 19 Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
        If 20 <= det Then
            ret = TRANSACTIONAL_COMPLEXITY_HIGH
        End If
    End If
    
    CalcComplexityEO_EQ = ret

End Function