📜  软件工程 |函数点(FP)的计算

📅  最后修改于: 2022-05-13 01:57:00.024000             🧑  作者: Mango

软件工程 |函数点(FP)的计算

函数点 (FP) 是软件开发的一个元素,它有助于在流程的早期估算开发成本。它可以从用户的角度衡量功能。

计数函数点(FP):

  • 第1步:
    F = 14 * scale

    根据复杂性调整因子 (CAF) 的字符,比例从 0 到 5 不等。下表显示比例:

    0 - No Influence
    1 - Incidental
    2 - Moderate
    3 - Average
    4 - Significant
    5 - Essential 
  • 步骤 2:计算复杂度调整因子 (CAF)。
    CAF = 0.65 + ( 0.01 * F )
  • 步骤 3:计算未调整的函数点 (UFP)。

    表(必填)

    Function UnitsLowAvgHigh
    EI346
    EO457
    EQ346
    ILF71015
    EIF5710

    将每个单独的函数点与 TABLE 中的相应值相乘。

  • 第四步:计算函数点。
    FP = UFP * CAF

例子:
给定以下值,计算所有复杂度调整因子 (CAF) 和加权因子平均时的函数点。

User Input = 50
User Output = 40
User Inquiries = 35
User Files = 6
External Interface = 4 

解释:

  • 第 1 步:由于复杂性调整因子是平均的(在问题中给出),因此,
    scale = 3.
    F = 14 * 3 = 42 
  • 第2步:
    CAF = 0.65 + ( 0.01 * 42 ) = 1.07 
  • 步骤 3:由于权重因子也是平均的(在问题中给出),因此我们将每个单独的函数点乘以表中的相应值。
    UFP = (50*4) + (40*5) + (35*4) + (6*10) + (4*7) = 628 
  • 第四步:
    Function Point = 628 * 1.07 = 671.96 

    这是必需的答案。

计算函数点的程序如下:-

#include 
using namespace std;
   
// Function to calculate Function Point
void calfp(int frates[][3], int fac_rate)
{
   
    // Function Units
    string funUnits[5] = {
        "External Inputs",
        "External Outputs",
        "External Inquiries",
        "Internal Logical Files",
        "External Interface Files"
    };
   
    // Weight Rates
    string wtRates[3] = { "Low", "Average", "High" };
   
    // Weight Factors
    int wtFactors[5][3] = {
        { 3, 4, 6 },
        { 4, 5, 7 },
        { 3, 4, 6 },
        { 7, 10, 15 },
        { 5, 7, 10 },
    };
   
    int UFP = 0;
   
    // Calculating UFP (Unadjusted Function Point)
    for (int i = 0; i < 5; i++) {
   
        for (int j = 0; j < 3; j++) {
   
            int freq = frates[i][j];
   
            UFP += freq * wtFactors[i][j];
        }
    }
   
    // 14 factors
    string aspects[14] = {
        "reliable backup and recovery required ?",
        "data communication required ?",
        "are there distributed processing functions ?",
        "is performance critical ?",
        "will the system run in an existing heavily utilized operational environment ?",
        "on line data entry required ?",
        "does the on line data entry require the input transaction to be built over multiple screens or operations ?",
        "are the master files updated on line ?",
        "is the inputs, outputs, files or inquiries complex ?",
        "is the internal processing complex ?",
        "is the code designed to be reusable ?",
        "are the conversion and installation included in the design ?",
        "is the system designed for multiple installations in different organizations ?",
        "is the application designed to facilitate change and ease of use by the user ?"
    };
   
    /*
    Rate Scale of Factors
    Rate the following aspects on a scale of 0-5 :-
    0 - No influence 
    1 - Incidental 
    2 - Moderate 
    3 - Average 
    4 - Significant 
    5 - Essential 
    */
   
    int sumF = 0;
   
    // Taking Input of factors rate
    for (int i = 0; i < 14; i++) {
   
        int rate = fac_rate;
   
        sumF += rate;
    }
   
    // Calculate CFP
    double CAF = 0.65 + 0.01 * sumF;
   
    // Calculate Function Point (FP)
    double FP = UFP * CAF;
   
    // Output Values
    cout << "Function Point Analysis :-" << endl;
   
    cout << "Unadjusted Function Points (UFP) : " << UFP << endl;
   
    cout << "Complexity Adjustment Factor (CAF) : " << CAF << endl;
   
    cout << "Function Points (FP) : " << FP << endl;
}
   
// driver function
int main()
{
    int frates[5][3] = {
        { 0, 50, 0 },
        { 0, 40, 0 },
        { 0, 35, 0 },
        { 0, 6, 0 },
        { 0, 4, 0 }
    };
   
    int fac_rate = 3;
   
    calfp(frates, fac_rate);
   
    return 0;
}
输出:
Function Point Analysis :-
Unadjusted Function Points (UFP) : 628
Complexity Adjustment Factor (CAF) : 1.07
Function Points (FP) : 671.96