Disclosure of Invention
The embodiment of the invention provides a software cost estimation method and device, which are used for solving the problem of lower efficiency of manually splitting and calculating the content of a demand instruction in the related technology.
In order to solve the technical problems, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for estimating a cost of software, including:
acquiring a demand instruction;
determining the respective titles in the requirement specification and the description content of each title;
determining at least one functional keyword in the descriptive content of each title;
determining the type of each function keyword based on each function keyword and the title to which each function keyword belongs;
and calculating the cost estimation of the software item corresponding to the requirement specification based on the type of each function keyword and the total number of the function keywords in the requirement specification.
Further, the step of determining at least one functional keyword in the explanatory content of each title includes:
performing sentence dividing operation on the description content of each title to obtain at least one description sentence, wherein each description sentence is positioned between two segmentation marks, and the segmentation marks comprise punctuation marks and separators;
and respectively carrying out semantic analysis on each description sentence to obtain at least one functional keyword in the description content of each title.
Further, the step of performing semantic analysis on each sentence includes:
identifying the sentence pattern type of each description sentence;
determining verbs in the explanatory sentences, and determining dominant objects in each explanatory sentence based on the verbs and the sentence pattern types;
and determining the functional keywords of each explanatory sentence according to the verb and the dominated object.
Further, the step of determining the type of each function keyword based on each function keyword and the title to which each function keyword belongs includes:
carrying out semantic analysis on each title to obtain meaning information of each title;
and determining the type of the target function keyword based on the target function keyword and target meaning information, wherein the target function keyword is any one function keyword in the requirement specification, and the target meaning information is the meaning information of the title to which the target meaning information belongs.
The step of determining each title in the requirement specification and the description content of each title comprises the following steps:
acquiring characteristic information of each line of characters in the requirement specification;
determining each title in the requirement specification based on characteristic information of each row of characters, wherein the characteristic information comprises at least one of characters in a font, a color, a size, a thickness, an underline, a slope and an arrangement format of the characters;
and taking the description content between two adjacent titles as description content information of a target title, wherein the target title is the title in front of the layout sequence of the requirement specification in the two adjacent titles.
In a second aspect, an embodiment of the present invention further provides a software cost estimation apparatus, including:
the acquisition module is used for acquiring the requirement specification;
the first determining module is used for determining each title in the requirement specification and the description content of each title;
a second determining module for determining at least one functional keyword in the explanatory content of each title;
a third determining module, configured to determine a type of each function keyword based on each function keyword and a title to which each function keyword belongs;
and the calculation module is used for calculating the cost estimation of the software item corresponding to the requirement specification based on the type of each function keyword and the total number of the function keywords in the requirement specification.
Further, the second determining module includes:
the sentence dividing module is used for dividing the description content of each title to obtain at least one description sentence, wherein each description sentence is positioned between two segmentation marks, and each segmentation mark comprises punctuation marks and separators;
and the first analysis submodule is used for respectively carrying out semantic analysis on each description sentence to obtain at least one functional keyword in the description content of each title.
Further, the first analysis sub-module includes:
the identifying unit is used for identifying the sentence pattern type of each description sentence;
a first determining unit configured to determine verbs in explanatory sentences, and determine a subject in each explanatory sentence based on the verbs shown and the sentence pattern type;
and the second determining unit is used for determining the functional keyword of each explanatory sentence according to the verb and the dominated object.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program implementing the steps of the software cost estimation method as described above when executed by the processor.
In a fourth aspect, an embodiment of the present invention further provides an electronic device, which is characterized by comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program implementing the steps of the software cost estimation method as described above when being executed by the processor.
In the embodiment of the invention, the requirement specification is acquired; determining the respective titles in the requirement specification and the description content of each title; determining at least one functional keyword in the descriptive content of each title; determining the type of each function keyword based on each function keyword and the title to which each function keyword belongs; and calculating the cost estimation of the software item corresponding to the requirement specification based on the type of each functional keyword in the requirement specification. Therefore, the computer can measure the scale of the software by aiming at the content in the demand instruction through the intelligent semantic analysis technology and rapidly output the cost estimation, thereby improving the calculation efficiency of the software cost estimation.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a software cost estimation method according to an embodiment of the present invention, where the method includes:
step 101: and obtaining a demand instruction.
In the embodiment of the invention, the requirement specification is an electronic file with identifiable characters. The manner of obtaining the requirement specification may be to receive a requirement specification which is uploaded by a user and can be identified by words, or may be to receive an unrecognizable electronic file (for example, a picture) uploaded by the user, and then convert the electronic file into the requirement specification which can be identified by words by using a scanning tool and a word recognition tool, which is not limited herein.
Step 102: and determining each title in the requirement specification and the description content of each title.
In the embodiment of the invention, the text features of the titles and the explanatory contents can be different, so that the titles and the explanatory contents in the requirement specification can be distinguished, wherein the titles can be further classified into different grades of titles, and the text features of the different grades of titles can be further different, so that the different grades of titles can be further distinguished.
The different character features are used as characteristics, and a plurality of test requirement specifications are trained by combining a classification algorithm, so that a model for classifying characters in the requirement specifications into titles and description contents through the different character features is obtained. When a new demand specification is acquired later, the model can be directly used for determining each title and description content in the demand specification.
If two determined titles are found to be in 2 adjacent rows in the requirement specification, the two titles can be combined to become one title.
In an alternative embodiment,step 102 may include:
acquiring characteristic information of each line of characters in the requirement specification;
determining each title in the requirement specification based on characteristic information of each row of characters, wherein the characteristic information comprises at least one of characters in a font, a color, a size, a thickness, an underline, a slope and an arrangement format of the characters;
and taking the description content between two adjacent titles as description content information of a target title, wherein the target title is the title in front of the layout sequence of the requirement specification in the two adjacent titles.
Since the title and the description are displayed in separate lines, the text type is determined by using the text located in the same line as a determination object in this embodiment, for example: the words in the same row are titles, or the words in the same row are descriptive of the content.
Specifically, after the feature information of each line of characters is obtained, whether each line of characters is a title or an explanatory content can be determined according to a mapping relation between a preset character type and the feature information.
The above-mentioned arrangement format of the characters may be at least one of left alignment, center alignment, right alignment and both ends alignment of the characters. The characteristic information of the characters is used as the basis for distinguishing different types of characters, so that the titles and the description contents in the requirement specification can be distinguished.
In addition, each explanatory is immediately adjacent to the title to which it belongs, and the usual text habit is that the explanatory is located after the title to which it belongs, so that the explanatory in the adjacent two titles can be regarded as the explanatory in the preceding title.
Step 103: at least one functional keyword in the descriptive content of each title is determined.
The function keywords refer to description information which is proposed in the requirement specification and hoped to correspond to the manufactured software with corresponding functions, the more the function keywords indicate that the software has more functions, the more the workload required by the manufactured software is, the more the time cost and the labor cost are, and the higher the cost estimation of the software is.
In an alternative embodiment, step 103 may include:
performing sentence dividing operation on the description content of each title to obtain at least one description sentence, wherein each description sentence is positioned between two segmentation marks, and the segmentation marks comprise punctuation marks and separators;
and respectively carrying out semantic analysis on each description sentence to obtain at least one functional keyword in the description content of each title.
In this embodiment, sentences located between two segmentation markers in each explanatory content are split into one explanatory sentence individually.
By means of semantic analysis on at least one explanatory sentence one by one or simultaneous semantic analysis of a plurality of explanatory sentences in parallel, whether functional keywords exist in each explanatory sentence or not can be determined, and if the functional keywords exist, the functional keywords are a plurality of functional keywords and specific contents of the functional keywords. Wherein, the explanation content of each title comprises at least one functional keyword.
The semantic analysis mentioned in the embodiments of the present invention may be an intelligent semantic perception algorithm, which includes content classification, clustering, topic analysis, semantic analysis, entity recognition, heuristic search engines, recommendation engines, abstract engines, etc.
Because the expression modes of the language are various, and the ambiguity easily occurs when one sentence is complete and longer, various understandings occur. Therefore, in the embodiment, the description contents are all split into the short sentences, so that the probability of error occurrence of the analysis of the longer characters at one time by the semantic analysis can be avoided, and the accuracy of the semantic analysis can be improved.
Further, the step of performing semantic analysis on each sentence may include:
identifying the sentence pattern type of each description sentence;
determining verbs in the explanatory sentences, and determining dominant objects in each explanatory sentence based on the verbs and the sentence types;
and determining the functional keywords of each explanatory sentence according to the verb and the dominated object.
Since a functional keyword is a description of a functional behavior implementation, it necessarily includes a verb, and a subject acted upon by the verb, and may or may not include a subject of the verb.
In this embodiment, when performing semantic analysis on explanatory sentences, firstly, the sentence pattern type of each explanatory sentence is analyzed; verbs in the explanatory sentence are then determined, for example: calling, screening and the like, and determining a dominated object in the explanatory sentence by combining the sentence pattern type after determining the verb in the explanatory sentence, wherein the dominated object is a noun; finally, the functional keywords of the explanatory sentence are determined by the verb and the subject.
For example: the description sentence is 'can maintain the organization architecture of a company', the sentence pattern type is the sentence pattern type of a verb at the back, after the verb 'maintenance' is determined, the overruled object 'organization architecture' is determined before the verb, and the function keyword 'maintenance organization architecture' of the description sentence is determined by combining the verb and the overruled object.
It should be noted that, in the case where the explanatory sentence includes verbs, the number of verbs may be more than one, for example: the explanatory sentence is an organization structure capable of maintaining and graphically showing companies, the sentence type is a sentence type in front of a verb, after the verb is determined, the overruled object organization structure is determined after the verb is determined, and functional keywords of the explanatory sentence are determined to be the maintenance organization structure and the exhibition organization structure by combining the verb and the overruled object.
In addition, there may be a plurality of cases where the number of verbs is one and the number of subject to be controlled is more than one, and the number of verbs is more than one and the number of subject to be controlled is the same as the number of verbs. The principle is the same as or similar to that described above, and the description of this embodiment is omitted.
When the sentence pattern type of the explanatory sentence in which the explanatory sentence is long includes both the verb and the verb, the function keyword is determined by referring to the verb-after method.
In the present embodiment, the method of determining the subject to be subjected to the treatment by the sentence pattern type and the verb, and obtaining the function keyword by the combination of the verb and the subject to be subjected to the treatment is to determine the function keyword based on the expression of the explanatory sentence itself, so that the accuracy of determining the function keyword in the explanatory sentence can be improved.
Step 104: and determining the type of each function keyword based on each function keyword and the title to which each function keyword belongs.
In the embodiment of the present invention, the types of the functional keywords include 5, which are External Input (EI), external output (EI), external Query (EQ), internal logic file (Internal Logic File, abbreviated ILF) and external interface file (External Interface File, abbreviated ELF) respectively.
The same functional keyword may appear in the explanatory content of a plurality of titles in the demand specifications, and the types of the same functional keyword under the plurality of titles are not the same. Taking the function keyword "modification post" as an example for explanation, the type of the function keyword "modification post" is an Internal Logic File (ILF) only when the explanation content of the father association title (for example, "personnel post management") entitled to the function keyword is included, and when the function keyword "modification post" appears in the explanation content of other titles (for example: development architecture), the function keyword "modification post" is actually only a call for interfacing the function in the father association title, and is an External Input (EI) at this time, because the workload of the two is different, and therefore, distinction is required by different types.
Other types are also differentiated based on the differences in the manner and workload described above to determine different types, which is advantageous for accuracy of software cost estimation.
In an alternative embodiment, step 104 may include:
carrying out semantic analysis on each title to obtain meaning information of each title;
and determining the type of the target function keyword based on the target function keyword and target meaning information, wherein the target function keyword is any one function keyword in the requirement specification, and the target meaning information is the meaning information of the title to which the target meaning information belongs.
In this embodiment, the mapping relationship between each functional keyword and its parent associated text is further included, where the mapping relationship may further include synonyms and paraphrasing of the title, and synonyms and paraphrasing of the functional keyword, for example: the personnel management is the father association of the new post, and after synonyms and near-meaning words of the functional keywords are added, the personnel management can also be the father association of the functional keywords such as the creation post, the new post and the like.
Therefore, by carrying out semantic analysis on each title, the meaning information of the title to which each functional keyword belongs can be combined to determine when each functional keyword is classified subsequently, so that the accuracy of classifying each functional keyword is improved, and the accuracy of estimating the cost of software is further facilitated.
Step 105: and calculating the cost estimation of the software item corresponding to the requirement specification based on the type of each function keyword and the total number of the function keywords in the requirement specification.
As described above, different types of function keywords correspond to different workloads, and thus, by configuring a larger weight value for a type with a larger workload and configuring a smaller weight value for a type with a smaller workload, the number of function points of a software item corresponding to a demand specification can be calculated. Specifically, assuming that the total number of function keywords in the requirement specification is 12, wherein 3 ILFs, 1 ELF, 4 EIs, 1 EO, and 3 EQ, wherein the weight value of ILFs is 10, the weight value of EIFs is 7, the weight value of EIs is 4, the weight value of EO is 5, and the weight value of EQ is 4, the number of function points s=3×10+1×7+4×4+1×5+3×4=70 of the software items corresponding to the requirement specification.
And calculating the cost estimation of the software project through the function points of the software project corresponding to the requirement specification.
Specifically, the software development cost sdc= (s×pdr) ×swf×rdf×f+dnc; s is the number of function points of the software project; PDR is the productivity; SWF is a software factor adjustment factor; RDF is a development factor adjustment factor; f is the personnel cost rate; DNC is a direct non-human cost. The 5 parameters except the S are irrelevant to the requirement specification, are factors determined according to factors such as actual conditions of different areas and different companies, and can be combined with the cost of the software research and development calculated by the function points of the software project after the parameters are determined.
Taking the above example as an example, assume pdr=1, swf=1, rdf=1, dnc= 0,F =1000 yuan/day, then sdc= (s×pdr) ×swf×rdf×f+dnc= (3) can be calculated x10+1×7+4×4+1×5+3×4) × 1×1×1×1000+0=70000 elements.
It should be noted that the foregoing is merely illustrative of the cost estimation of the software item for one case, and should not be limited thereto. It should be understood that any scheme for calculating the number of function points of a software item based on the above manner and calculating the cost estimate of the software item in combination with the number of function points falls within the scope of protection required by the embodiments of the present invention.
Referring to fig. 2, fig. 2 is a block diagram of a software cost estimation device according to an embodiment of the present invention, and as shown in fig. 2, a softwarecost estimation device 200 includes:
an obtainingmodule 210, configured to obtain a requirement specification;
a first determiningmodule 220, configured to determine each title in the requirement specification and the description content of each title;
a second determiningmodule 230 for determining at least one functional keyword in the descriptive content of each title;
a third determiningmodule 240, configured to determine a type of each function keyword based on each function keyword and a title to which each function keyword belongs;
a calculatingmodule 250, configured to calculate a cost estimate of a software item corresponding to the requirement specification based on the type of each function keyword and the total number of function keywords in the requirement specification.
Optionally, the second determiningmodule 230 includes:
the sentence dividing module is used for dividing the description content of each title to obtain at least one description sentence, wherein each description sentence is positioned between two segmentation marks, and each segmentation mark comprises punctuation marks and separators;
and the first analysis submodule is used for respectively carrying out semantic analysis on each description sentence to obtain at least one functional keyword in the description content of each title.
Optionally, the first analysis sub-module includes:
the identifying unit is used for identifying the sentence pattern type of each description sentence;
a first determining unit configured to determine verbs in explanatory sentences, and determine a subject in each explanatory sentence based on the verbs shown and the sentence pattern type;
and the second determining unit is used for determining the functional keyword of each explanatory sentence according to the verb and the dominated object.
The softwarecost estimation device 200 according to the embodiment of the present invention can implement each process implemented in the method embodiment of fig. 1, and in order to avoid repetition, a description thereof will be omitted.
The softwarecost estimation device 200 of the embodiment of the invention can improve the calculation efficiency of the software cost estimation.
The embodiment of the invention also provides an electronic device, which comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes each process of the software cost estimation method in the embodiment shown in fig. 1 when being executed by the processor, and can achieve the same technical effect, and the repetition is avoided, so that the description is omitted.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the respective processes of the software cost estimation method embodiment described above, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.