Software scale measurement method, device and equipment
By abstracting software function names and matching with a scale metric dictionary, the complex measurement process of the COSMIC method is simplified, improving measurement efficiency and accuracy. It solves the problems of process complexity and reliance on professional skills in existing technologies, and realizes software scale measurement that is easy to operate, widely applicable, and reliable in terms of results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP DESIGN INST
- Filing Date
- 2025-12-10
- Publication Date
- 2026-05-12
AI Technical Summary
The existing COSMIC method is complex and time-consuming in software scale measurement, and it is highly dependent on the professional skills of the measurement personnel, which affects the accuracy and consistency of the measurement.
By abstracting the names of the software functions to be measured into general combinations of features that accurately reflect the function's behavior, and then using a scale metric dictionary for matching, the measurement process is simplified and the reliance on professional expertise is reduced.
It enhances the flexibility and applicability of function recognition, reduces reliance on the level of detail in software documentation, broadens application scenarios, improves measurement efficiency and accuracy, and ensures the objectivity and consistency of results.
Smart Images

Figure CN122018975A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software engineering, and more particularly to a method, apparatus, and device for measuring software size. Background Technology
[0002] With the rapid development of information technology, the standardization and normalization of software engineering have become a research focus. Existing technologies primarily achieve accurate software development cost assessment from two dimensions: function point analysis and scale measurement. On the one hand, the function point method is used to construct a technical framework for software scale measurement; on the other hand, scientific and reasonable measurement processes are designed based on international standards and industry norms. These solutions provide technical support for software project cost estimation and resource planning. The COSMIC method, as one of the function point methods recommended by national standards, is widely used in the function and scale measurement of commercial application software and real-time systems. In practical applications, this method relies on detailed software documentation and the professional level of the measurement personnel to ensure the accuracy and consistency of the measurement results.
[0003] Existing COSMIC metrics require sufficiently detailed software documentation to identify business data flows and implementation logic. However, in practice, much software documentation fails to meet this requirement, rendering the method unsuitable. Furthermore, the COSMIC method requires identifying data groups and data movements during the mapping phase, a complex and time-consuming process that heavily relies on the expertise of the measurement personnel. Different personnel may arrive at inconsistent results, impacting the accuracy and consistency of the measurement. Therefore, there is an urgent need for a software scale measurement method that can reduce measurement difficulty, shorten time, broaden applicability, and minimize the impact of human factors. Summary of the Invention
[0004] This application provides a software size measurement method to address the problems of existing software size measurement methods being complex, time-consuming, and highly dependent on the professional capabilities of the measurement personnel, thus affecting the accuracy and consistency of the measurement.
[0005] Firstly, a method for measuring software size is provided. This includes: identifying the functions of the software to be measured; abstracting the names of the functions to obtain abstract function names; determining the size value of the functions based on the matching between the abstract function names and a size measurement dictionary; and determining the functional size of the software to be measured based on the size value of the functions.
[0006] In conjunction with the first aspect, in some possible implementations of the first aspect, the characteristic is: The scale metric dictionary includes a scale metric dictionary directory and corresponding quick scale values; the scale metric dictionary directory contains the abstract function names of the software, and the abstract function names in the scale metric dictionary directory are used to match the abstract function names to be measured; the quick scale values are the scale values that correspond one-to-one with the abstract function names.
[0007] In conjunction with the first aspect, in some possible implementations of the first aspect, the size value of a function is determined based on the matching of the abstract function name with the size metric dictionary, including: if the abstract function name matches successfully with the size metric dictionary, determining the fast size value matched in the size metric dictionary as the size value of the function; if the abstract function name does not match successfully with the size metric dictionary, calculating the computed size value of the function, and recording the computed size value of the function as the size value of the function.
[0008] In conjunction with the first aspect, in some possible implementations of the first aspect, the method further includes: storing the computed scale value when the abstract function name fails to match the scale metric dictionary; and adding the abstract function name and the corresponding computed scale value to the scale metric dictionary when the amount of computed scale value data corresponding to the abstract function name reaches a threshold, with the computed scale value recorded as a fast scale value in the scale metric dictionary.
[0009] In conjunction with the first aspect, in some possible implementations of the first aspect, the method further includes: constructing a scale metric dictionary, including: collecting historical metric data, which includes requirements analysis documents and scale metric tables to indicate the functions and attributes of the software to be measured and their corresponding data details; performing integrity and validity checks on the historical metric data, retaining reliable data, which is divided into new function data and changed function data based on the functional attributes of the software; abstracting the function names of the software to obtain abstract function names, forming a scale metric dictionary directory; determining the function size values in the scale metric dictionary based on the weighted average size value of the software functions and its corresponding standard deviation, as well as the median size value of the software functions and its corresponding standard deviation; and constructing a scale metric dictionary based on the scale metric dictionary directory and the size values of the software functions, whereby the scale metric dictionary directory is obtained based on the abstraction of the software function names.
[0010] In conjunction with the first aspect, in some possible implementations of the first aspect, the weighted average size value is calculated by weighting the proportion of different size values in the credible data; the median size value is obtained by the size value in the middle position after the credible data is sorted.
[0011] In conjunction with the first aspect, among some possible implementations of the first aspect, the integrity check includes: checking whether the historical data simultaneously includes the requirements analysis document and the scale metric table; removing historical data with empty key fields in the scale metric table at the function level; key fields include at least one of the following: function user, function, subprocess, data movement type, and data group record; the validity check includes: removing invalid historical data, verifying whether the function after removing invalid historical data belongs to the user's functional requirements, whether the function granularity meets the functional characteristics, whether the measurement results conform to the software measurement rules, and whether they are consistent with the business data interaction in the requirements analysis document.
[0012] Secondly, a software size measurement device is provided, comprising: a first determining module for determining the functions of the software to be measured, and abstracting the names of the functions to obtain abstract function names; a second determining module for determining the size value of the functions based on the matching of the abstract function names with a size measurement dictionary; and a third determining module for determining the functional size of the software to be measured based on the size value of the functions.
[0013] Thirdly, a software scale measurement device is provided, comprising: a processor and a memory for storing computer programs, the processor for calling and running the computer programs stored in the memory, performing the steps of the methods of any of the preceding aspects.
[0014] Fourthly, a computer program product is provided, comprising: a computer program that, when executed by a processor, implements the steps of the method in any of the above aspects.
[0015] Fifthly, a computer-readable storage medium storing a computer program is provided, which, when executed by a processor, causes the processor to perform the steps of the method in any of the preceding aspects.
[0016] Based on the method provided in this application, this software scale measurement method abstracts the function names of the software to be measured into general feature combinations that accurately reflect functional behavior. This effectively improves the flexibility and applicability of function identification, reduces the reliance on the level of detail in software documentation, and thus broadens the application scenarios of the method. Based on the matching mechanism between abstract function names and the scale measurement dictionary, the complex measurement process in traditional software scale measurement methods is simplified, significantly improving measurement efficiency. Simultaneously, this method, through standardized dictionary matching, reduces the reliance on the professional level and business understanding of measurement personnel, making the measurement results more objective and consistent, supported by historical data, and improving the accuracy and reliability of the measurement. Overall, this method achieves the technical advantages of ease of operation, wide applicability, and reliable results while maintaining the scientific nature of the measurement. Attached Figure Description
[0017] Figure 1 This is a flowchart of the existing COSMIC metric method; Figure 2 This is a schematic diagram of a software size measurement method applicable to the embodiments of this application; Figure 3 This is a schematic diagram illustrating the construction of a scale metric dictionary provided in the embodiments of this application; Figure 4 This is a schematic diagram of a COSMIC dictionary formation process applicable to the embodiments of this application; Figure 5 This is a schematic diagram of a rapid software scale measurement business process based on a COSMIC dictionary provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of a software scale measurement device applicable to the embodiments of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operating methods in the method embodiments can also be applied to the device embodiments or system embodiments. In the description of this application, unless otherwise stated, "multiple" means two or more.
[0019] In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions of different embodiments are consistent and can be referenced by each other. The technical features of different embodiments can be combined to form new embodiments according to their inherent logical relationship.
[0020] It is understood that the various numerical designations used in this application are merely for descriptive convenience and are not intended to limit the scope of this application. The order of the process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.
[0021] The terms "first," "second," "third," "fourth," and other various terminology (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] To facilitate understanding of the embodiments of this application, the terminology involved in the embodiments of this application will be briefly explained below.
[0023] COSMIC dictionary: A reference table used to store abstract function names and their corresponding size values, supporting rapid matching and measurement of software function size, and its formation is based on the analysis and processing of historical measurement data.
[0024] Weighted average size value: The functional size value is calculated by weighting the proportion of different size values in reliable historical data, and is used to reflect the typical size of this type of function.
[0025] Median size value: The value in the middle after sorting the historical size values of the same type of function, used to measure the central tendency of the size of that type of function.
[0026] The existing COSMIC metric method has the following process: Figure 1As shown, after receiving input from the measurement initiator, this measurement phase is divided into three stages: the COSMIC measurement strategy stage, the COSMIC mapping stage, and the COSMIC measurement stage, to implement software scale measurement. Each stage has clear measurement tasks and standards. The main tasks of the COSMIC measurement strategy stage are to identify which parts of the software to be measured fall within the scope of this measurement (i.e., determine the measurement purpose and scope), which belong to user functional requirements (i.e., identify user functional requirements), which layers the software is divided into (i.e., identify layers), and which objects interact with the software for business data (i.e., identify functional users). The COSMIC mapping stage converts the user functional requirements of the software to be measured into a COSMIC general software model representation. This stage requires identifying functions, identifying data groups, and identifying data movements. Function identification is relatively easy, while identifying data groups and data movements is the most difficult part of the entire COSMIC method. It requires sufficiently detailed software documentation for accurate identification and demands a high level of business understanding and COSMIC expertise from the measurement personnel. It also requires significant time, especially when identifying data movements. Personnel with different skill levels measuring the same function may measure inconsistent amounts of data movements due to differences in their expertise. The COSMIC measurement phase requires calculating and summing the function size, counting data movements within each function requirement to obtain the function size unit for that function. Each data movement is counted as one CFP, and the CFPs of all functions are summed to obtain the total function size of the entire software. Existing COSMIC measurement methods require sufficiently detailed software documentation to identify business data flows and implementation logic, but in practice, many software documents do not meet this requirement, making the method difficult to apply. Furthermore, the COSMIC method requires identifying data groups and data movements during the mapping phase, a complex and time-consuming process that is highly dependent on the expertise of the measurement personnel; different personnel may yield inconsistent results, affecting the accuracy and consistency of the measurement.
[0027] Based on this, this application provides a software size measurement method, apparatus, and device to overcome the problems of existing software size measurement methods being complex, time-consuming, and highly dependent on the professional capabilities of measurement personnel, thus affecting the accuracy and consistency of measurement.
[0028] Figure 2 This is a schematic flowchart of a software size measurement method included in an embodiment of this application. Figure 2 As shown, the method includes steps S201, S202, and S203. Step S201: Determine the functions of the software to be measured, and abstract the names of the functions to obtain abstract function names.
[0029] Specifically, the function names and their descriptions or contexts of the software to be measured are collected. Natural language processing techniques are used to extract keywords, ensuring that the keywords contain verbs to reflect the core purpose of the function. Through de-business-specific processing, business-related terms are replaced with general terms or omitted, forming abstract function names that reflect the functional characteristics and are unrelated to business. If a single verb is insufficient to express all the features of the function, multiple related verbs or adjectives are combined to form a more descriptive name.
[0030] Step S202: Determine the size value of the function based on the matching of the abstract function name and the size metric dictionary. Specifically, the scale metric dictionary includes a scale metric dictionary directory and corresponding quick scale values; the scale metric dictionary directory contains the abstract function names of the software, which are used to match the abstract function names to be measured. If the scale metric dictionary directory contains the abstract function names to be measured, the match is successful; otherwise, the match fails; the quick scale values are scale values that correspond one-to-one with the abstract function names. Step S203: Determine the functional scale of the software to be measured based on the functional scale value. Specifically, if an abstract function name matches the size metric dictionary, the function's size value is automatically recorded as a quick size value in the dictionary. If the match fails, existing software size measurement methods are used to measure the function's size, recording its size value and storing it as historical measurement data. Once the amount of reliable data for this type of function reaches a set value, the size metric dictionary formation method is applied to add this type of function to the dictionary. The size values of all functions in the software to be measured are then summed to obtain the software's overall size.
[0031] In some implementations, such as Figure 2 The method described includes a scale metric dictionary directory and corresponding quick scale values. The scale metric dictionary directory contains the abstract function names of the software, which are used to match the abstract function names to be measured. If the scale metric dictionary directory contains the abstract function name to be measured, the match is successful; otherwise, the match fails. The quick scale values are the scale values corresponding to the abstract function names one-to-one. This improves matching efficiency, reduces manual judgment, and enhances measurement accuracy. In some implementations, such as Figure 2The method described above determines the size value of a function based on the matching between the abstract function name and the size metric dictionary. This includes: if the abstract function name matches successfully with the size metric dictionary, determining the function's size value as the fast size value found in the dictionary; if the match fails, calculating the function's computed size value and recording it as the function's size value. This ensures both fast measurement when a match is successful and accurate calculation when a match fails, improving overall measurement efficiency and reliability. In some implementations, such as Figure 2 In the method shown, when a match fails, the computational scale value is stored. When the amount of computational scale value data corresponding to an abstract function name reaches a threshold, the abstract function name and its corresponding computational scale value are added to the scale metric dictionary, and the computational scale value is recorded as a fast scale value in the scale metric dictionary. This continuously optimizes the scale metric dictionary content, enhancing the automation and accuracy of subsequent measurement processes.
[0032] based on Figure 2 The proposed software size measurement method abstracts the names of software functions into generic combinations of features that accurately reflect functional behavior. This significantly improves the flexibility and applicability of function identification, reduces reliance on the level of detail in software documentation, and broadens the application scenarios of the method. Based on a matching mechanism between abstract function names and a size measurement dictionary, the method simplifies the complex measurement process of traditional software size measurement methods, significantly improving measurement efficiency. Furthermore, the standardized dictionary matching method reduces reliance on the professional level and business understanding of measurement personnel, making the measurement results more objective, consistent, and supported by historical data, thus enhancing the accuracy and reliability of the measurement. Overall, this method maintains the scientific nature of the measurement while achieving the technical advantages of ease of operation, wide applicability, and reliable results.
[0033] Figure 3 This is a schematic diagram illustrating one method of constructing a scale metric dictionary, as included in an embodiment of this application. Figure 3 As shown, the method includes steps S301 to S306.
[0034] Step S301: Collect historical measurement data.
[0035] Specifically, historical measurement data includes requirements analysis documents and scale metrics tables, used to indicate the functions, attributes, and corresponding data details of the software to be measured. The requirements analysis documents should show whether a function is new or existing, and the interaction between the function's business data and data from other function users or persistent storage media. The scale metrics tables should contain detailed measurement information, including at least the following fields: function user, function, subprocess, data movement type, and data group.
[0036] Step S302: Perform integrity and validity checks on historical measurement data and retain reliable data.
[0037] Specifically, a completeness check is performed on historical measurement data: Each historical measurement document is checked to ensure it includes both a requirements analysis document and a scale measurement table. Historical data containing only a requirements analysis document or only a scale measurement table is removed. Historical data in the scale measurement table with empty records for function user, function, sub-process, data movement type, or data group are removed at the function level (i.e., if the sub-process, data movement type, data group, or function user data corresponding to function A is incomplete, function A and its corresponding data are removed from the historical data; data for other functions in the same table that are complete are retained).
[0038] Perform validity checks on historical measurement data: The requirements analysis document should show whether a function is a new or existing function, and the interaction between the function's business data and data from other function users or persistent storage media. In the scale measurement table, functions that belong to user functional requirements (i.e., the content implemented by code development) are considered reliable when the function granularity meets the functional characteristics, the measurement results conform to the rules, and the interaction with business data in the requirements analysis document is consistent.
[0039] After performing integrity and validity checks on historical measurement data, reliable data is retained. Based on functional attributes, reliable historical data is divided into two categories at the functional granularity: newly added and changed. Newly added function data: Based on the requirements analysis document, functions newly added to the system are considered newly added functions, and the newly added function data contains functional size measurement data for these functions. Changed function data: Based on the requirements analysis document, functions existing in the system that undergo sub-processing additions, deletions, or changes are considered changed functions, and the changed function data contains functional size measurement data for these changed functions.
[0040] Step S303: Abstract the function names to form a scale metric dictionary directory.
[0041] Specifically, business-related function names are abstracted into business-independent names that reflect functional characteristics, thus forming a scale metric dictionary. This dictionary consists of the abstracted function names, which must meet the following conditions: 1) Reflect the functional purpose. 2) Be distinct from other functions. 3) Usually be verbs. 4) Be unrelated to any specific business function. The abstract model is as follows: ① Functional Feature Extraction Functional feature extraction may specifically include: Input analysis: First, collect all business-related function names and their descriptions or contexts.
[0042] Keyword extraction: Use natural language processing techniques (such as TF-IDF, TextRank, etc.) to extract keywords from each function name. These keywords should reflect the core purpose of the function, or suitable keywords can be assigned through semantic analysis.
[0043] Verb recognition: Ensure that the extracted or assigned keywords contain verbs, as verbs usually best express the function or action.
[0044] ② Abstract function name The abstract function names specifically include: De-business-related terms: Replace business-related terms (such as business names, data names, etc.) in the extracted keywords with general terms or omit them.
[0045] Verb optimization: Ensure that the final abstract name is primarily verb-based and accurately reflects the function's behavior.
[0046] Feature combination: If a single verb is insufficient to express all the features of a function, consider combining multiple related verbs or adjectives to form a more descriptive name.
[0047] ③ Dictionary index construction: The construction of a dictionary catalog may specifically include: Deduplication and Classification: The abstracted function names are deduplicated and classified according to the similarity of functions.
[0048] Standardized naming: Establish uniform naming rules for each type of function to ensure consistency and readability of names.
[0049] Create a dictionary: Organize the categorized function names into a dictionary directory of scale metrics.
[0050] Step S304: Calculate the weighted average size value of the software function and its corresponding standard deviation, as well as the median size value and its corresponding standard deviation.
[0051] ① Weighted scale of calculation function There are N (N≧10) reliable historical data points for the same type of function (e.g., query), with M different scale values. The weighted scale for each function type is calculated based on the proportion of each of the M scale values in the N data points. The calculation formula is as follows:
[0052]
[0053] In the formula: It is the size value obtained by weighted averaging the historical data of the i-th function in the COSMIC dictionary; This refers to the number of different scale values in the i-th type of function. For example, in the query function, there are 1000 samples with 4 different scale values. It is 4; It is the j-th value of the function size in the i-th function category, with a total of One value; In the i-th type of function, the function size value is The weight of the functions; In the i-th type of function, the function size value is The number of functions; It is the total number of historical data in the i-th function category.
[0054] ② The median size of the calculation function Using the median method, first sort the N (N≧10) historical scale values of the same function in ascending order, and then calculate the exponent " , calculate the median size of each function category The calculation formula is as follows:
[0055]
[0056] In the formula: —The total number of historical data entries in the i-th function category; —In the i-th function, the number of positions of the median in the sequence after sorting the historical data; —In the i-th type of function, historical data is sorted. The value corresponding to the location data; —In the COSMIC dictionary, the median size of the historical data for the i-th function is obtained using the median method.
[0057] ③Standard deviation when calculating weighted scale Standard deviation reflects the dispersion of a dataset; it is the average distance of each data point from the mean. A smaller standard deviation indicates more stable data and less error when using it. The weighted average is calculated using the weighted average method. Calculate the standard deviation The formula for calculating the standard deviation is as follows:
[0058] In the formula: —The total number of historical data entries for the i-th function in the COSMIC dictionary; —The value of the k-th function size in the i-th function category, totaling One value; —The scale value obtained by using a weighted average method for the historical data of the i-th function; —The weighted scale value of the i-th function and the standard deviation of each data point in the historical dataset from which the value was calculated.
[0059] ④ Standard deviation when calculating the median size The median size was calculated using the median method. Calculate the standard deviation The formula for calculating the standard deviation is as follows:
[0060] In the formula: —The total number of historical data entries for the i-th function in the COSMIC dictionary. ≥10; —The value of the k-th function size in the i-th function category, totaling One value; —The size value of the historical data for the i-th function, obtained using the median method; —The size of the median of the i-th function and the standard deviation of each data point in the historical dataset from which the value was calculated.
[0061] Step S305: Based on the weighted average size value of the software's functions and its corresponding standard deviation, and the median size value of the software's functions and its corresponding standard deviation, determine the size value of the functions in the size metric dictionary.
[0062] Specifically, based on the weighted average size value and its corresponding standard deviation of the software functions, and the median size value and its corresponding standard deviation of the software functions, the size value of the functions described in the size metric dictionary is determined. The standard deviations of the same function i are then compared. and The function size value in the COSMIC dictionary is calculated according to the following rules. When... At that time, the scale value of function i in the COSMIC dictionary is taken as... Otherwise take The expression is as follows:
[0063] In the formula: —The size value of the i-th function in the COSMIC dictionary; —In the COSMIC dictionary, the historical data of the i-th function is obtained by weighted average method to obtain the scale value; —In the COSMIC dictionary, the median size of the historical data for the i-th function is obtained using the median method; —The weighted scale value of the i-th function and the standard deviation of each data point in the historical dataset from which this value was calculated; —The size of the median of the i-th function and the standard deviation of each data point in the historical dataset from which the value was calculated.
[0064] Step S306: Construct a scale metric dictionary based on the scale metric dictionary directory and the scale values of software functions.
[0065] Specifically, the size metric dictionary is an abstracted list of function names. The size value of a software function is obtained by taking the weighted average size value of the software functions and its corresponding standard deviation, as well as the median size value of the software functions and its corresponding standard deviation.
[0066] The method of this application will now be described with reference to specific embodiments.
[0067] In some implementations, the scale metric dictionary can be a COSMIC dictionary. The method for forming a COSMIC dictionary includes the following steps: First, collect historical data on functional scale metrics completed using existing COSMIC methods. This historical data should include requirements analysis documents and COSMIC scale metric tables. The requirements analysis documents should reflect the function and whether it is a new or modified function, and describe its data interaction with business data or other functional users or persistent storage media. The COSMIC scale metric tables should include fields such as functional user, function, subprocess, data movement type, and data group.
[0068] The collected historical metrics data undergo a completeness check to ensure that each document includes a requirements analysis document and a COSMIC scalability metric table, eliminating incomplete data. Simultaneously, for cases where records in the COSMIC scalability metric table are empty (e.g., for function users, functions, subprocesses, data movement types, or data groups), unreliable data is eliminated at the function level. Then, a validity check is performed to determine whether the requirements analysis document clearly defines the functional changes and whether the functions in the COSMIC scalability metric table conform to COSMIC rules and are consistent with their requirements analysis document.
[0069] Based on functional attributes, trusted historical data is divided into two categories: newly added functional data and changed functional data. Newly added functional data refers to newly added functions in the system, while changed functional data refers to situations where existing functions have undergone addition, deletion, or modification of subprocesses.
[0070] Next, the function names are abstracted to form a COSMIC dictionary directory. This process includes steps such as function feature extraction, keyword extraction, verb recognition, de-business-related processing, verb optimization, and feature combination. Keywords are extracted using natural language processing techniques, ensuring that the final names are primarily verbs, accurately reflect the function's behavior, and are unrelated to specific business logic.
[0071] After abstraction, the function names are deduplicated and categorized, and a unified naming rule is established to form a standardized COSMIC dictionary directory.
[0072] Subsequently, a weighted scale is calculated for trusted historical data of the same type of function (such as "query"). Specifically, the number and proportion of different size values for this type of function are statistically analyzed and used as weights. A weighted average method is then used to derive the weighted size value for this type of function. Simultaneously, the median method is used to sort the N historical size values of the same type of function and calculate their corresponding median size value. .
[0073] Furthermore, the weighted scale is calculated separately. and median size Standard deviation and This is used to assess the dispersion of the data. Finally, the standard deviations are compared. and The size, if Less than Then take As the size value for this type of function; otherwise, take... The result is recorded as a scale value and then added to the COSMIC dictionary.
[0074] In some implementations, the rapid software scalability measurement process based on the COSMIC dictionary includes the following steps: First, determine the measurement purpose and scope, clarifying the functional boundaries and objectives of the software system to be measured; then, identify user functional requirements by analyzing the requirements document to extract all user functional requirements and converting them into a functional list. Next, perform an identification layer, identifying the technical level to which the function belongs, such as input, output, read, and write, according to existing COSMIC methods. Finally, identify the function, decomposing each functional requirement into specific sub-processes and clarifying its data interaction behavior.
[0075] After completing the function identification, each function name is abstracted, converting names related to specific business operations into generic, verb-based abstract names to ensure they accurately reflect the function's behavioral characteristics and distinguish it from other functions. The abstracted function names must conform to a unified naming convention, forming a standardized function directory.
[0076] Next, the abstracted function names are matched against the existing COSMIC dictionary directory. If a match is found, the corresponding size value is directly retrieved from the dictionary as the function's size; if no match is found, the traditional COSMIC measurement method is used to calculate the function's size, and its size value is recorded. Simultaneously, the function's measurement data is stored in a historical data warehouse for subsequent dictionary updates.
[0077] For function size values obtained through dictionary matching or traditional methods, they are recorded at the function level, and the size values of all functions are summarized to obtain the function size of the entire software system. In addition, for data measured using traditional methods, the data processing requirements in the COSMIC dictionary formation method should be referred to to check its completeness, consistency, validity and rationality, retain reliable data and store its abstracted function names and size values.
[0078] When the number of reliable measurement data for a certain type of function reaches a set threshold (it is recommended to have no less than 10), according to statistical principles, the historical data of this type of function is weighted averaged and the median is calculated, and the corresponding standard deviation is calculated. Finally, the recommended size value of this type of function is determined and added to the COSMIC dictionary, thereby continuously optimizing and expanding the dictionary content and improving the efficiency and accuracy of subsequent measurements.
[0079] Figure 4 This is a schematic diagram of a COSMIC dictionary formation process included in an embodiment of this application. Figure 4 As shown, the method includes the following: (1) Collect historical measurement data Specifically, collect historical data on feature size measurements completed using existing COSMIC methodologies. This historical data should include requirements analysis documents and COSMIC size measurement tables. Requirements analysis documents should demonstrate the feature and whether it is a new or existing feature, as well as the interaction between the feature's business data and data from other feature users or persistent storage media. COSMIC size measurement tables should contain detailed measurement information, including at least the following fields: feature user, feature, subprocess, data movement type, and data group.
[0080] (2) Data processing Data processing may include checking the integrity and validity of historical measurement data and retaining reliable data.
[0081] Completeness check: Check whether each historical measurement data includes both the requirements analysis document and the COSMIC scalability measurement table. Remove historical data that only contains the requirements analysis document or only contains the COSMIC scalability measurement table. For historical data in the COSMIC scalability measurement table where the records for function user, function, subprocess, data movement type, and data group are empty, remove them at the function level (i.e., if the subprocess, data movement type, data group, and function user data corresponding to function A are incomplete, remove function A and its corresponding data from the historical data; retain other functions in the same table with complete data).
[0082] Validity Check: The requirements analysis document should demonstrate the functionality and whether it is a new or existing feature, as well as the interaction between the functionality's business data and data from other users or persistent storage media. In the COSMIC scalability metrics, a function is considered reliable if it falls under user functional requirements (i.e., the content implemented in code development), its granularity meets the functional characteristics (see the functional identification section in the general knowledge section), and the measurement results conform to COSMIC rules and are consistent with the business data interaction in the requirements analysis document.
[0083] For example: The requirements analysis document describes the need to add a "View Personnel Information Details" function, described as follows: "When a user clicks the 'View Details' button, a pop-up window will display the person's name, gender, age, place of origin, ID, contact number, and emergency contact information. The system will also record the viewing operation log." A standard COSMIC scalability metric should include the information shown in Table 1 below: Table 1: Examples of information that should be included in a standard COSMIC scalability metric.
[0084] If the requirements analysis document clearly specifies the details of the changes, then it is considered a changed function; if the changes are not explicitly stated, then it is considered a new function.
[0085] According to the requirements analysis document, the "View Personnel Information Details" function is a new feature with four sub-processes. If the number of sub-processes is missing or the data movement type of the sub-processes does not match the above, it indicates that the measurement results do not match the business data interaction in the requirements analysis document, and the measurement data for this function is unreliable.
[0086] (3) Data classification Based on functional attributes, trusted historical data is divided into two categories at the functional granularity: new data and data change data.
[0087] New Feature Data: Based on the requirements analysis document, the data is judged at the function level. New features added to the system are new features, and the new feature data consists of function scale measurement data of new features.
[0088] Change function data: Based on the requirements analysis document, the judgment is made at the function level. When an existing function in the system is added, deleted, or changed in a subprocess, it is considered a change function. The change function data contains the function scale measurement data of the change function.
[0089] (4) Abstract function names to form the COSMIC dictionary directory. This step involves abstracting business-related function names into business-independent names that reflect the functional characteristics, thus forming the COSMIC dictionary directory. The dictionary directory consists of these abstracted function names, which must meet the following conditions: 1) Reflect the functional purpose. 2) Be distinct from other functions. 3) Usually be verbs. 4) Be unrelated to any specific business function.
[0090] (5) Weighted scale of calculation function There are N (N≧10) reliable historical data points for the same type of function (e.g., query), with M different scale values. The weighted scale for each function type is calculated based on the proportion of each of the M scale values in the N data points. .
[0091] (6) Median size of the calculation function Using the median method, first sort the N (N≧10) historical scale values of the same function in ascending order, and then calculate the exponent. Calculate the median size of each function category. .
[0092] (7) Standard deviation when calculating weighted scale Standard deviation reflects the dispersion of a dataset; it is the average distance of each data point from the mean. A smaller standard deviation indicates more stable data and less error when using it. The weighted average is calculated using the weighted average method. Calculate the standard deviation .
[0093] (8) Standard deviation when calculating the median size The median size was calculated using the median method. Calculate the standard deviation .
[0094] (9) Size value notation in the COSMIC dictionary Compare the standard deviation of the same function i and The function size value in the COSMIC dictionary is calculated according to the following rules. When... At that time, the scale value of function i in the COSMIC dictionary is taken as... Otherwise take .
[0095] Figure 5 This is a schematic diagram of a rapid software scaling measurement business process based on the COSMIC dictionary, included in an embodiment of this application. Figure 5 As shown, the method includes the following: (1) Determine the purpose and scope of measurement Identify the components of the software to be measured that require software size measurement.
[0096] (2) Identify user functional requirements Extract the functional requirements (i.e., the content to be implemented in code) of the software from the requirements document related to the software to be measured, ensuring that all relevant functions are covered.
[0097] (3) Identification layer Obtain the software hierarchy from the functional architecture design file of the software to be measured, and identify the layers that need to be measured according to the measurement requirements.
[0098] (4) Recognition function The recognition function should have the following characteristics for each function: ① It originates from at least one identifiable user functional requirement; ② Triggered by movement of input data from the user, to notify the function that it has detected the trigger event; ③ It must involve at least two data moves, typically one input and one output or write; ④ Belongs to one and only one level; ⑤ Based on the user's functional requirements, the state is considered complete when a certain time point is reached.
[0099] (5) Abstract function name Abstracting business-related function names into business-independent names that reflect functional characteristics, the abstracted function names should meet the following conditions: 1) Reflect the functional purpose. 2) Be distinct from other functions. 3) Usually be verbs. 4) Be unrelated to any specific business function. The abstract model is as follows: ① Functional Feature Extraction Input analysis: First, collect all business-related function names and their descriptions or contexts.
[0100] Keyword extraction: Use natural language processing techniques (such as TF-IDF, TextRank, etc.) to extract keywords from each function name. These keywords should reflect the core purpose of the function, or suitable keywords can be assigned through semantic analysis.
[0101] Verb recognition: Ensure that the extracted or assigned keywords contain verbs, as verbs usually best express the function or action.
[0102] ② Abstracting the name De-business-related terms: Replace business-related terms (such as business names, data names, etc.) in the extracted keywords with general terms or omit them.
[0103] Verb optimization: Ensure that the final abstract name is primarily verb-based and accurately reflects the function's behavior.
[0104] Feature combination: If a single verb is insufficient to express all the features of a function, consider combining multiple related verbs or adjectives to form a more descriptive name.
[0105] Standardized naming: The naming rules are consistent with those used when forming the dictionary.
[0106] (6) Function name matching COSMIC dictionary The abstracted function names are matched with the COSMIC dictionary directory.
[0107] If a match is successful, the function's size value is automatically recorded in the COSMIC dictionary as a quick size. If no match is found, the existing COSMIC measurement method is used to measure the function's size, and then the function's size value is recorded. At the same time, the function size measurement data is stored as historical measurement data. Once the number of reliable data for this type of function reaches a set value (it is recommended to have no less than 10), the COSMIC dictionary formation method is applied to add this type of function to the COSMIC dictionary.
[0108] (7) Recording function scale The function size, derived through dictionary matching, is recorded at the function level, with values taken from the matching numerical values in the COSMIC dictionary. The function size, measured using existing COSMIC methods, is equal to the sum of the number of data moves.
[0109] (8) Summary of Functional Scope The functional size of the software is obtained by summing up all the functional size values of the software to be measured.
[0110] (9) Complete storage function for measurement data For data measured using the existing COSMIC method, the data processing requirements in the COSMIC dictionary formation method should be followed to check the completeness, consistency, validity, and rationality of the measurement data, retain reliable data, and store the abstracted function name and function size value.
[0111] (10) The number of reliable data for the same type of function reaches the set value. When the number of reliable data points for similar functions reaches a set value, add that type of function to the COSMIC dictionary. Based on statistical principles, a set value greater than 10 is recommended.
[0112] The sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0113] In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions of different embodiments are consistent and can be referenced by each other. The technical features of different embodiments can be combined to form new embodiments according to their inherent logical relationship.
[0114] Those skilled in the art will recognize that, based on the units and algorithm steps described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0115] The apparatus provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. The description of the apparatus embodiments corresponds to the description of the method embodiments. Therefore, for content not described in detail, please refer to the method embodiments above. For the sake of brevity, some content will not be repeated.
[0116] In some implementations, such as Figure 6 As shown, a software scale measurement device 600 is also provided, comprising: The first determining module 610 is used to determine the function of the software to be measured, and to abstract the name of the function to obtain an abstract function name; The second determining module 620 is used to determine the size value of the function based on the matching of the abstract function name with the size metric dictionary; The third determining module 630 is used to determine the functional scale of the software to be measured based on the scale value of the function.
[0117] The software size measurement device 600 provided in this embodiment simplifies the complex measurement process in traditional software size measurement methods, significantly improving measurement efficiency. At the same time, it reduces reliance on the professional level and business understanding of measurement personnel, making the measurement results more objective and consistent, supported by historical data, and improving the accuracy and reliability of the measurement.
[0118] Based on the same technical concept as the foregoing embodiments, see Figure 7 This application also provides an electronic device 700, which may include: a memory 701 and a processor 702; wherein, The memory 701 is used to store computer programs and data, and can be configured to store various other data to support operation on the computing device.
[0119] The processor 702, coupled to the memory 701, is used to execute a computer program in the memory 701 for: determining the function of the software to be measured; abstracting the name of the function to obtain an abstract function name; determining the size value of the function based on the matching of the abstract function name with a size measurement dictionary; and determining the functional size of the software to be measured based on the size value of the function.
[0120] The above Figure 7 The memory 701 in the memory can be implemented by any class of volatile or non-volatile storage devices or combinations thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0121] The electronic device provided in this application simplifies the complex measurement process in traditional software scale measurement methods, significantly improving measurement efficiency. Simultaneously, it reduces reliance on the professional skills and business understanding of measurement personnel, making the measurement results more objective and consistent, supported by historical data, and enhancing measurement accuracy and reliability.
[0122] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described software scale measurement method embodiments.
[0123] This application also provides a computer program product comprising instructions which, when executed by a computer, implement the methods described in the above method embodiments by the devices or apparatus described above.
[0124] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of apparatus or units may be electrical, mechanical, or other forms.
[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0129] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for measuring software size, characterized in that, include: Determine the functions of the software to be measured, and abstract the names of the functions to obtain abstract function names; Based on the matching results between the abstract function name and the scale metric dictionary, the scale value of the function is determined; Based on the size value of the function, the functional size of the software to be measured is determined.
2. The method according to claim 1, characterized in that: The size metric dictionary includes a size metric dictionary directory and corresponding fast size values; The scale metric dictionary directory contains the abstract function names of the software, and the abstract function names in the scale metric dictionary directory are used to match the abstract function names to be metricd. The rapid scaling value is a scaling value that corresponds one-to-one with the abstract function name.
3. The method according to claim 1, characterized in that, Based on the matching results between the abstract function name and the scale metric dictionary, the scale value of the function is determined, including: If the abstract function name matches the size metric dictionary, the fast size value matched in the size metric dictionary is determined as the size value of the function. If the abstract function name fails to match the scale metric dictionary, the calculated scale value of the function is calculated, and the calculated scale value of the function is recorded as the scale value of the function.
4. The method according to claim 3, characterized in that, The method further includes: If the abstract function name fails to match the scale metric dictionary, the calculated scale value is stored. When the amount of computational scale value data corresponding to the abstract function name reaches a threshold, the abstract function name and the corresponding computational scale value are added to the scale metric dictionary, and the computational scale value is recorded as a fast scale value in the scale metric dictionary.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Constructing the scale metric dictionary includes: Collect historical measurement data, which includes requirements analysis documents and scale measurement tables, to indicate the functions and attributes of the software to be measured and the corresponding data details. The historical measurement data is subjected to integrity and validity checks, and reliable data is retained. The reliable data is divided into new function data and changed function data based on the functional attributes of the software. The function names of the software are abstracted to obtain abstract function names, which form the scale metric dictionary directory; Based on the weighted average size value of the software's functions and its corresponding standard deviation, and the median size value of the software's functions and its corresponding standard deviation, the size value of the functions in the size metric dictionary is determined. A scale metric dictionary is constructed based on the scale metric dictionary directory and the scale values of the software functions. The scale metric dictionary directory is obtained by abstracting the function names of the software.
6. The method according to claim 5, characterized in that, The weighted average size value is calculated by weighting the proportion of different size values in the reliable data. The median value is obtained by taking the value that is in the middle position after sorting the reliable data.
7. The method according to claim 5, characterized in that, The integrity check includes: Check whether historical data includes both requirements analysis documents and scale metrics. Historical data with empty key fields in the scale metric table are removed at the function level; the key fields include at least one of function user, function, subprocess, data movement type, and data group record. The validity check includes: Remove invalid historical data, and verify whether the function after removing invalid historical data belongs to the user's functional requirements, whether the granularity of the function meets the functional characteristics, whether the measurement results conform to the software measurement rules, and whether they are consistent with the business data interaction in the requirements analysis document.
8. A software size measurement device, characterized in that, include: The first determining module is used to determine the functions of the software to be measured, and to abstract the names of the functions to obtain abstract function names; The second determining module is used to determine the size value of the function based on the matching of the abstract function name with the size metric dictionary; The third determining module is used to determine the functional scale of the software to be measured based on the scale value of the function.
9. A software scale measurement device, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the steps of the method as claimed in any one of claims 1 to 7.
10. A computer program product, characterized in that, include: A computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.