Method and apparatus for detecting repeated application function modules

CN115794618BActive Publication Date: 2026-09-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211397657.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-09
Publication Date
2026-09-22
Estimated Expiration
2042-11-09

AI Technical Summary

Technical Problem

[0007]本发明的一个目的在于提供一种重复应用功能模块检测方法,以解决现有技术中存在的重复应用功能模块检测的准确性较低且速度较慢,从而不利于提高重复应用功能模块检测的效率的问题

Benefits of technology

[0101]本发明提供的重复应用功能模块检测方法和装置,通过根据目标功能模块的目标开发文档和多个参考功能模块的参考开发文档,得到所述目标功能模块与所述参考功能模块之间的开发文档相似度,能够以功能模块的实际开发文档为依据,使得到的开发文档相似度与目标功能模块和参与对比的参考功能模块之间的开发文档重合程度相符,提高了得到开发文档相似度的准确性,从而提高了整体重复应用功能模块检测的准确性;通过根据目标功能模块的目标测试案例和多个所述参考功能模块的参考测试案例,得到所述目标功能模块与所述参考功能模块之间的测试案例相似度,能够以用于测试功能模块的实际测试案例为依据,使得到的测试案例相似度与目标功能模块和参与对比的参考功能模块之间的测试案例重合程度相符,提高了得到测试案例相似度的准确性,从而提高了整体重复应用功能模块检测的准确性;通过根据目标功能模块的目标调用方法和多个所述参考功能模块的参考调用方法,得到所述目标功能模块与所述参考功能模块之间的调用方法相似度,能够以功能模块代码中实际调用的方法为依据,使得到的调用方法相似度与目标功能模块和参与对比的参考功能模块之间的调用方法重合程度(包括但不限于调用顺序、方法功能和方法布局等的整体重合程度)相符,提高了得到调用方法相似度的准确性,从而提高了整体重复应用功能模块检测的准确性;通过根据目标功能模块的目标数据字段和多个所述参考功能模块的参考数据字段,得到所述目标功能模块与所述参考功能模块之间的数据字段相似度,能够以功能模块实际涉及的数据字段为依据,使得到的数据字段相似度与目标功能模块和参与对比的参考功能模块之间的涉及的数据字段重合程度相符,提高了得到数据字段相似度的准确性,从而提高了整体重复应用功能模块检测的准确性;通过根据所述开发文档相似度、测试案例相似度、调用方法相似度和数据字段相似度,得到所述目标功能模块与对应参考功能模块之间的整体相似度,并基于整体相似度判断所述目标功能模块与对应的所述参考功能模块是否重复,若是,向工作人员进行告警,能够使检测重复功能模块的依据不仅仅限定于代码调用方法的重合程度,而是进一步充分考虑了开发文档、测试案例和涉及的数据字段也均与功能模块的整体架构、功能以及具体细节密切相关的规律,使检测重复功能模块的依据扩展到还包括开发文档、测试案例和数据字段的重合程度,使检测所依据的信息较为全面且均能够充分表征功能模块的特征,而不再较为单一,由于其检测依据较为全面细化,因此能够对不同重合情况的重复功能模块均进行较准确的检测,且适用面更宽,不仅仅适用于代码规模较小的应用功能模块,还支持代码规模较大的应用功能模块,从而,极大程度上提高了重复应用功能模块检测的准确性。而且,本发明提供的重复应用功能模块检测方法和装置,能够以算法、程序、软件、应用或系统等形式实现自动化执行,而减少了对人工的依赖程度,从而还大幅度提高了重复应用功能模块检测的速度,并进一步提高了重复应用功能模块检测的准确性。综上所述,本发明提供的重复应用功能模块检测方法和装置,能够提高重复应用功能模块检测的准确性和速度,从而提高重复应用功能模块检测的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794618B_ABST
    Figure CN115794618B_ABST
Patent Text Reader

Abstract

The application provides a repeated application function module detection method and device, and particularly relates to the field of big data.The method comprises the following steps: obtaining the corresponding development document similarity, test case similarity, calling method similarity and data field similarity according to the development document, test case, calling method and data field of a target function module and a reference function module; obtaining the overall similarity between the target function module and the reference function module according to the development document similarity, test case similarity, calling method similarity and data field similarity; judging whether the target function module and the reference function module are repeated based on the overall similarity, and if yes, alarming the staff.The application can improve the accuracy and speed of repeated application function module detection, thereby improving the efficiency of repeated application function module detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of application development technology, particularly to the field of big data, and especially to a method and apparatus for detecting repetitive application function modules. Background Technology

[0002] In the process of application development, in order to improve code reusability to facilitate the maintenance of the overall application development, or to reduce related repetitive development work to improve development efficiency, it is often necessary to detect duplicate application functional modules (including but not limited to multiple application functional modules with a high degree of overlap in overall functions, architecture and related parameters), and then carry out subsequent development and correction processing based on the detected duplicate application functional modules.

[0003] In existing technologies, the main method for detecting duplicate application functional modules is to perform syntax analysis on the code of the application functional modules to determine whether the order of method (or function) calls overlaps between different application functional modules, thereby determining whether there is duplication between different application functional modules. However, the comparison and analysis of the method call order is mainly performed by staff.

[0004] However, the above detection method relies solely on the method call order of the application function module code, which is based on relatively limited information. Therefore, it can only identify the corresponding application function module as a duplicate module when the specific statements of the application function module code have a high degree of overlap. It is not easy to identify application function modules with high overall functional and architectural overlap but low overlap of specific statements in the corresponding code as duplicate modules. Furthermore, its applicability is narrow, only applicable to application function modules with small code size. As a result, the accuracy of duplicate application function module detection is low.

[0005] In addition, the above-mentioned detection methods rely on manual labor, which takes a long time and results in a slow overall detection speed. Furthermore, the accuracy of the comparative analysis depends on the experience and ability of the staff, leading to unstable detection accuracy and further reducing the accuracy of repeated functional module detection.

[0006] In summary, existing technologies suffer from low accuracy and slow speed in detecting repetitive application function modules, which hinders the improvement of efficiency in detecting such modules. Summary of the Invention

[0007] One object of the present invention is to provide a method for detecting repetitive application function modules, thereby solving the problems of low accuracy and slow speed in the detection of repetitive application function modules in the prior art, which is detrimental to improving the efficiency of repetitive application function module detection. Another object of the present invention is to provide a device for detecting repetitive application function modules. A further object of the present invention is to provide a computer device. A still other object of the present invention is to provide a readable medium.

[0008] To achieve the above objectives, one aspect of the present invention discloses a method for detecting repeatedly used functional modules, the method comprising:

[0009] Based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, the similarity of the development documents between the target functional module and the reference functional modules is obtained.

[0010] Based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, the test case similarity between the target functional module and the reference functional modules is obtained;

[0011] Based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, the similarity of the calling methods between the target functional module and the reference functional modules is obtained;

[0012] Based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules, the data field similarity between the target functional module and the reference functional modules is obtained;

[0013] Based on the similarity of development documents, test cases, calling methods, and data fields, the overall similarity between the target functional module and the corresponding reference functional module is obtained. Based on the overall similarity, it is determined whether the target functional module and the corresponding reference functional module are duplicated. If so, an alarm is issued to the staff.

[0014] Optionally, it may further include:

[0015] Before determining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, the functional module that was previously identified as duplicated with the target functional module is selected from multiple historical reference functional modules as the reference functional module.

[0016] Optionally, obtaining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules includes:

[0017] Based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document, the vocabulary intersection and vocabulary complement are obtained;

[0018] Based on the number of words in the complement set, the document similarity correction coefficient is obtained.

[0019] Based on the number of intersecting words in the word intersection and the number of target words in the target word set, an initial document similarity is obtained, and based on the initial document similarity and the document similarity correction coefficient, the corresponding development document similarity is obtained.

[0020] Optionally, obtaining the lexical intersection and lexical complement based on the target lexical set corresponding to the target development document and the reference lexical set corresponding to the reference development document includes:

[0021] Based on the target vocabulary set and the reference vocabulary set, multiple similar vocabulary subsets are obtained, wherein the vocabulary in the similar vocabulary subsets are different from each other and are synonyms or near-synonyms.

[0022] Select a first representative word from each of the similar word subsets, and take multiple overlapping words that are included in both the target word set and the reference word set as multiple second representative words;

[0023] Based on multiple first representative words and second representative words, the word intersection is obtained, and based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words, the word complement is obtained.

[0024] Optionally, it may further include:

[0025] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is consistent with the target development document at the time of the last detection.

[0026] If so, the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the development document similarity between the target functional module and the corresponding reference functional module.

[0027] Optionally, it may further include:

[0028] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is in the unwritten stage, the writing stage, or the completed writing stage.

[0029] If the document is in the unwritten stage, use 0 as the similarity score for the corresponding development document;

[0030] If it is in the writing stage, determine whether the target development document was in the writing stage during the last detection. If not, obtain the corresponding development document similarity based on the preset document similarity prediction value.

[0031] If the project is in the final writing stage, the similarity between the development documents of the target functional module and the reference development documents of multiple reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules.

[0032] Optionally, it may further include:

[0033] Before obtaining the corresponding document similarity based on the preset document similarity prediction value,

[0034] The number of historical development documents selected is obtained based on the preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules.

[0035] Based on the number of historical development document similarities selected, the smallest number of historical development document similarities among multiple historical reference functional modules is selected as the development document similarity to be analyzed.

[0036] The highest similarity score of the document to be analyzed is used as the predicted document similarity value.

[0037] Optionally, obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules includes:

[0038] Based on each target test case of the target functional module, multiple target test case parameters corresponding to the target test case are obtained; and based on multiple reference test cases of the reference functional module, multiple reference test case parameters corresponding to the reference test case are obtained.

[0039] Based on the reference case parameters and the target case parameters, the proportion of overlapping case parameters that are included in both the reference case parameters and the target case parameters is determined, wherein the proportion of overlapping case parameters is obtained based on the number of overlapping case parameters and the number of target case parameters or the number of reference case parameters.

[0040] The target test cases whose overlap ratio is greater than or equal to a preset overlap ratio threshold are taken as the corresponding case intersection elements to obtain the test case intersection, and the other target test cases other than the case intersection elements are taken as the corresponding case complement elements to obtain the test case complement.

[0041] Based on the number of complement cases in the test case complement set, the case similarity correction coefficient is obtained;

[0042] An initial case similarity is obtained based on the number of intersection cases of the test cases and the number of target cases of the target test case. The corresponding test case similarity is then obtained based on the initial case similarity and the case similarity correction coefficient.

[0043] Optionally, it may further include:

[0044] Before obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, it is determined whether the target test case is consistent with the target test case in the previous detection.

[0045] If so, the test case similarity between the target functional module and the corresponding reference functional module determined in the previous test shall be used as the test case similarity between the target functional module and the corresponding reference functional module.

[0046] Optionally, it may further include:

[0047] Before determining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules, it is determined whether the target test case is in the unwritten stage, the writing stage, or the completed writing stage.

[0048] If the test case is in the unwritten stage, 0 will be used as the similarity score.

[0049] If it is in the writing stage, determine whether the target test case was in the writing stage during the last detection. If not, obtain the corresponding test case similarity based on the preset case similarity prediction value.

[0050] If the project is in the completion stage, the test case similarity between the target functional module and the reference functional modules is obtained based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

[0051] Optionally, it may further include:

[0052] Before obtaining the corresponding test case similarity based on the preset case similarity prediction value,

[0053] The number of historical test case similarities is obtained based on the preset case similarity selection ratio and the number of historical test case similarities between multiple historical reference functional modules.

[0054] Based on the number of historical test case similarities selected, the smallest number of historical test case similarities among multiple historical reference functional modules is selected as the test case similarity to be analyzed.

[0055] The highest similarity among the test cases to be analyzed is used as the predicted similarity value.

[0056] Optionally, obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules includes:

[0057] Based on each target invocation method of the target functional module, the target name information corresponding to the target invocation method is obtained, and based on multiple reference invocation methods of the reference functional module, the reference name information corresponding to the reference invocation method is obtained. The target name information includes the method name, class name, and input parameter name corresponding to the target invocation method, and the reference name information includes the method name, class name, and input parameter name corresponding to the reference invocation method.

[0058] The target calling methods corresponding to the target name information included in the reference name information are taken as the corresponding method intersection elements to obtain the calling method intersection, and the other target calling methods other than the method intersection elements are taken as the corresponding method complement elements to obtain the calling method complement.

[0059] Based on the number of complement methods in the complement set of the called methods, the method similarity correction coefficient is obtained;

[0060] An initial method similarity is obtained based on the number of intersection methods of the intersection of the calling methods and the number of target methods of the target calling method. The corresponding calling method similarity is then obtained based on the initial method similarity and the method similarity correction coefficient.

[0061] Optionally, it may further include:

[0062] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is consistent with the target calling method in the previous detection.

[0063] If so, the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the similarity of the calling methods between the target functional module and the corresponding reference functional module.

[0064] Optionally, it may further include:

[0065] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is in the unwritten stage, the writing stage, or the completed writing stage.

[0066] If the code is not yet written, use 0 as the similarity score of the corresponding calling method.

[0067] If it is in the writing stage, determine whether the target calling method was in the writing stage during the last detection. If not, obtain the corresponding calling method similarity based on the preset method similarity prediction value.

[0068] If the project is in the completion stage, the similarity of the calling methods between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules.

[0069] Optionally, it may further include:

[0070] Before obtaining the corresponding method similarity based on the preset method similarity prediction value...

[0071] The number of historical call method similarities is obtained based on the preset method similarity selection ratio and the number of historical call method similarities among multiple historical reference functional modules;

[0072] Based on the number of historical call method similarities selected, the smallest number of historical call method similarities among multiple historical call method similarities between multiple historical reference functional modules is selected as the call method similarity to be analyzed.

[0073] The highest similarity between the methods to be analyzed is used as the predicted similarity value.

[0074] Optionally, obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules includes:

[0075] Based on the target field set corresponding to the target data field and the reference field set corresponding to the reference data field, the field intersection and field complement are obtained;

[0076] Based on the number of complement fields in the complement set, the field similarity correction coefficient is obtained;

[0077] An initial field similarity is obtained based on the number of intersection fields of the field intersection and the number of target fields of the target field set. The corresponding data field similarity is then obtained based on the initial field similarity and the field similarity correction coefficient.

[0078] Optionally, it may further include:

[0079] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of multiple reference functional modules, it is determined whether the target data field is consistent with the target data field in the previous detection.

[0080] If so, the data field similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the data field similarity between the target functional module and the corresponding reference functional module.

[0081] Optionally, it may further include:

[0082] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules, it is determined whether the target data field is in the unconfigured stage, the configuration stage, or the configuration completed stage.

[0083] If it is in the unconfigured stage, 0 will be used as the similarity of the corresponding data field;

[0084] If it is in the configuration phase, determine whether the target data field was in the configuration phase during the last detection. If not, obtain the corresponding data field similarity based on the preset field similarity prediction value.

[0085] If the project is in the completion stage, the similarity of data fields between the target functional module and the reference functional modules is obtained based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules.

[0086] Optionally, it may further include:

[0087] Before obtaining the corresponding data field similarity based on the preset field similarity prediction value,

[0088] The number of historical data field similarities is obtained based on the preset field similarity selection ratio and the number of historical data field similarities between multiple historical reference functional modules.

[0089] Based on the number of historical data field similarities selected, the lowest number of historical data field similarities among multiple historical data field similarities between multiple historical reference functional modules is selected as the similarity of the data field to be analyzed.

[0090] The highest similarity among the fields of the data to be analyzed is used as the predicted field similarity value.

[0091] Optionally, determining whether the target functional module and the corresponding reference functional module are duplicated based on overall similarity includes:

[0092] Determine whether the overall similarity is greater than a preset similarity threshold. If so, issue an alarm to the staff.

[0093] To achieve the above objectives, another aspect of the present invention discloses a device for detecting repeatedly used functional modules, the device comprising:

[0094] The development document similarity determination module is used to obtain the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules.

[0095] The test case similarity determination module is used to obtain the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

[0096] The method call similarity determination module determines the method call similarity between the target functional module and the reference functional modules based on the target method call of the target functional module and the reference method call of the multiple reference functional modules.

[0097] The data field similarity determination module obtains the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of multiple reference functional modules.

[0098] The detection and alarm module is used to obtain the overall similarity between the target functional module and the corresponding reference functional module based on the similarity of the development documents, test cases, calling methods, and data fields, and to determine whether the target functional module and the corresponding reference functional module are duplicated based on the overall similarity. If so, an alarm is issued to the staff.

[0099] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described above.

[0100] The present invention also discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.

[0101] The present invention provides a method and apparatus for detecting duplicate functional modules. By using the target development document of a target functional module and reference development documents of multiple reference functional modules, it obtains the development document similarity between the target functional module and the reference functional modules. This method uses the actual development documents of the functional modules as a basis, ensuring that the obtained development document similarity matches the degree of overlap between the development documents of the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained development document similarity and consequently improving the overall accuracy of detecting duplicate functional modules. Furthermore, by using the target test cases of the target functional module and reference test cases of multiple reference functional modules, it obtains the test case similarity between the target functional module and the reference functional modules. This method uses the actual test cases used to test the functional modules as a basis, ensuring that the obtained test case similarity matches the degree of overlap between the test cases of the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained test case similarity and consequently improving the overall accuracy of detecting duplicate functional modules. By using the target calling method of the functional module and the reference calling methods of multiple reference functional modules, the similarity of calling methods between the target functional module and the reference functional modules is obtained. This method, based on the actual methods called in the functional module code, ensures that the obtained calling method similarity matches the degree of overlap (including but not limited to the overall overlap in calling order, method function, and method layout) between the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained calling method similarity and consequently improving the overall accuracy of detecting duplicate functional modules. Furthermore, by using the target data fields of the target functional module and the reference data fields of multiple reference functional modules, the similarity of data fields between the target functional module and the reference functional modules is obtained. This method, based on the actual data fields involved in the functional modules, ensures that the obtained data field similarity matches the degree of overlap in the data fields involved in the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained data field similarity and consequently improving the overall accuracy of detecting duplicate functional modules.By calculating the similarity of development documents, test cases, calling methods, and data fields, the overall similarity between the target functional module and the corresponding reference functional module is obtained. Based on the overall similarity, it is determined whether the target functional module and the corresponding reference functional module are duplicates. If so, an alert is issued to the staff. This allows the basis for detecting duplicate functional modules to go beyond the degree of overlap in code calling methods. It further fully considers the fact that development documents, test cases, and related data fields are all closely related to the overall architecture, function, and specific details of the functional module. This expands the basis for detecting duplicate functional modules to include the degree of overlap in development documents, test cases, and data fields. The information used for detection is more comprehensive and can fully characterize the features of the functional module, rather than being too singular. Because its detection basis is more comprehensive and detailed, it can accurately detect duplicate functional modules with different overlap situations. It also has a wider range of applications, not only applicable to application functional modules with small code size but also supporting application functional modules with large code size. Therefore, it greatly improves the accuracy of detecting duplicate application functional modules. Furthermore, the method and apparatus for detecting repetitive application functional modules provided by this invention can achieve automated execution in the form of algorithms, programs, software, applications, or systems, thereby reducing reliance on manual labor and significantly improving the speed and accuracy of repetitive application functional module detection. In summary, the method and apparatus for detecting repetitive application functional modules provided by this invention can improve the accuracy and speed of repetitive application functional module detection, thus improving the efficiency of repetitive application functional module detection. Attached Figure Description

[0102] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0103] Figure 1 A flowchart illustrating a method for detecting repeatedly used functional modules according to an embodiment of the present invention is shown.

[0104] Figure 2 A schematic diagram illustrating an optional step in obtaining the similarity of development documents according to an embodiment of the present invention is shown;

[0105] Figure 3 A schematic diagram illustrating an optional step in obtaining test case similarity according to an embodiment of the present invention is shown.

[0106] Figure 4A schematic diagram illustrating an optional step in obtaining the similarity of the calling methods according to an embodiment of the present invention is shown;

[0107] Figure 5 A schematic diagram illustrating an optional step in obtaining data field similarity according to an embodiment of the present invention is shown;

[0108] Figure 6 A schematic diagram of a reusable function module detection device according to an embodiment of the present invention is shown;

[0109] Figure 7 A schematic diagram of a computer device suitable for implementing embodiments of the present invention is shown. Detailed Implementation

[0110] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0111] The terms "first," "second," etc., used in this document are not intended to specifically refer to order or sequence, nor are they intended to limit the invention. They are merely used to distinguish elements or operations described using the same technical terms.

[0112] The terms “include,” “including,” “have,” “contain,” etc., used in this article are all open-ended terms, meaning that they include but are not limited to.

[0113] The term "and / or" as used herein includes any or all of the things mentioned.

[0114] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this invention all comply with the relevant provisions of national laws and regulations.

[0115] It should be noted that the method and apparatus for detecting repetitive application functional modules disclosed in this application can be used in the field of application development technology, or in any field other than the field of application development technology. The application field of the method and apparatus for detecting repetitive application functional modules disclosed in this application is not limited.

[0116] This invention discloses a method for detecting the repeated application of functional modules, such as... Figure 1 As shown, the method specifically includes the following steps:

[0117] S101: Based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, obtain the development document similarity between the target functional module and the reference functional modules.

[0118] S102: Based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules, obtain the test case similarity between the target functional module and the reference functional modules.

[0119] S103: Based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, obtain the calling method similarity between the target functional module and the reference functional modules.

[0120] S104: Based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules, obtain the data field similarity between the target functional module and the reference functional modules.

[0121] S105: Based on the similarity of the development documents, test cases, calling methods, and data fields, obtain the overall similarity between the target functional module and the corresponding reference functional module, and determine whether the target functional module and the corresponding reference functional module are duplicated based on the overall similarity. If so, issue an alarm to the staff.

[0122] For example, the application function module can be understood as, but is not limited to, a functional component or program corresponding to the application's function. It can also be commonly understood as a "sub-application" corresponding to a function within an application, and is a component module of the application. It should be noted that the specific nature and meaning of the application function module can be determined by those skilled in the art based on the actual situation. The above description is merely illustrative and does not constitute a limitation.

[0123] For example, the data fields may be, but are not limited to, data fields involved in the code of the corresponding functional module or data fields involved in the database tables on which the corresponding functional module depends. It should be noted that the specific nature of the data fields can be determined by those skilled in the art based on the actual situation, and the above description is only an example and does not constitute a limitation.

[0124] For example, the method for detecting repetitive application function modules in this embodiment of the invention can be executed periodically or irregularly at preset triggering time intervals during the overall development process, but is not limited to this. The triggering time interval can be determined by those skilled in the art based on actual conditions, and this embodiment of the invention does not impose any limitations on it. For example, the triggering time interval can be, but is not limited to, 5 minutes, 10 minutes, 20 minutes, 30 minutes, 1 hour, 12 hours, or 24 hours, etc., preferably 10 minutes. It should be noted that the triggering form of the method for detecting repetitive application function modules can be determined by those skilled in the art based on actual conditions; the above description is merely an example and does not constitute a limitation.

[0125] For example, the overall similarity between the target functional module and the corresponding reference functional module, obtained based on the similarity of the development documents, test cases, calling methods, and data fields, can be expressed as, but is not limited to, the following formula:

[0126] f = aw uv +bx uv +cy uv +dz uv

[0127] Where f represents the overall similarity, a represents the preset development document similarity weight coefficient, and w uv The value of x represents the similarity of the development documents, b represents the preset test case similarity weight coefficient, and x represents the similarity of the development documents. uv The test case similarity is represented by c, where c represents the preset similarity weighting coefficient of the calling method, and y represents the similarity of the test cases. uv The similarity of the calling methods is represented by d, where d represents the preset data field similarity weight coefficient, and z represents the similarity of the calling methods. uv The similarity of the data fields is represented by the coefficients. The similarity weights for the development documentation, test cases, calling methods, and data fields can be determined by those skilled in the art based on actual circumstances. This embodiment of the invention does not impose any limitations on this. For example, the similarity weight for the development documentation can be, but is not limited to, 1 or 1.5; the similarity weight for the test cases can be, but is not limited to, 1 or 3; the similarity weight for the calling methods can be, but is not limited to, 1 or 2; and the similarity weight for the data fields can be, but is not limited to, 1 or 3.

[0128] It should be noted that the specific implementation method for obtaining the overall similarity between the target functional module and the corresponding reference functional module based on the similarity of the development documents, test cases, calling methods, and data fields can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0129] For example, alerting staff may include, but is not limited to, sending or displaying alert messages such as "Duplicate functional modules exist; please correct them promptly," along with information about the target functional module (e.g., the name, ID, or path of the target functional module) and information about the corresponding reference functional module (e.g., the name, ID, or path of the corresponding reference functional module). This allows staff to clearly identify which functional modules are duplicated, facilitating further repair and ensuring the smooth progress of application development. It should be noted that the specific implementation of alerting staff can be determined by those skilled in the art based on actual circumstances; the above description is merely illustrative and does not constitute a limitation.

[0130] For example, between a target functional module and a reference functional module, there are corresponding similarities in development documentation, test cases, calling methods, data fields, and overall similarity.

[0131] For example, the detection of a target functional module can be performed, but is not limited to, during development or after development. The development status and specific content of the target functional module may differ depending on the type of detection. It should be noted that the timing and frequency of target functional module detection can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation.

[0132] The present invention provides a method and apparatus for detecting duplicate functional modules. By using the target development document of a target functional module and reference development documents of multiple reference functional modules, it obtains the development document similarity between the target functional module and the reference functional modules. This method uses the actual development documents of the functional modules as a basis, ensuring that the obtained development document similarity matches the degree of overlap between the development documents of the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained development document similarity and consequently improving the overall accuracy of detecting duplicate functional modules. Furthermore, by using the target test cases of the target functional module and reference test cases of multiple reference functional modules, it obtains the test case similarity between the target functional module and the reference functional modules. This method uses the actual test cases used to test the functional modules as a basis, ensuring that the obtained test case similarity matches the degree of overlap between the test cases of the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained test case similarity and consequently improving the overall accuracy of detecting duplicate functional modules. By using the target calling method of the functional module and the reference calling methods of multiple reference functional modules, the similarity of calling methods between the target functional module and the reference functional modules is obtained. This method, based on the actual methods called in the functional module code, ensures that the obtained calling method similarity matches the degree of overlap (including but not limited to the overall overlap in calling order, method function, and method layout) between the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained calling method similarity and consequently improving the overall accuracy of detecting duplicate functional modules. Furthermore, by using the target data fields of the target functional module and the reference data fields of multiple reference functional modules, the similarity of data fields between the target functional module and the reference functional modules is obtained. This method, based on the actual data fields involved in the functional modules, ensures that the obtained data field similarity matches the degree of overlap in the data fields involved in the target functional module and the reference functional modules being compared, thus improving the accuracy of the obtained data field similarity and consequently improving the overall accuracy of detecting duplicate functional modules.By calculating the similarity of development documents, test cases, calling methods, and data fields, the overall similarity between the target functional module and the corresponding reference functional module is obtained. Based on the overall similarity, it is determined whether the target functional module and the corresponding reference functional module are duplicates. If so, an alert is issued to the staff. This allows the basis for detecting duplicate functional modules to go beyond the degree of overlap in code calling methods. It further fully considers the fact that development documents, test cases, and related data fields are all closely related to the overall architecture, function, and specific details of the functional module. This expands the basis for detecting duplicate functional modules to include the degree of overlap in development documents, test cases, and data fields. The information used for detection is more comprehensive and can fully characterize the features of the functional module, rather than being too singular. Because its detection basis is more comprehensive and detailed, it can accurately detect duplicate functional modules with different overlap situations. It also has a wider range of applications, not only applicable to application functional modules with small code size but also supporting application functional modules with large code size. Therefore, it greatly improves the accuracy of detecting duplicate application functional modules. Furthermore, the method and apparatus for detecting repetitive application functional modules provided by this invention can achieve automated execution in the form of algorithms, programs, software, applications, or systems, thereby reducing reliance on manual labor and significantly improving the speed and accuracy of repetitive application functional module detection. In summary, the method and apparatus for detecting repetitive application functional modules provided by this invention can improve the accuracy and speed of repetitive application functional module detection, thus improving the efficiency of repetitive application functional module detection.

[0133] In an optional implementation, it further includes:

[0134] Before determining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, the functional module that was previously identified as duplicated with the target functional module is selected from multiple historical reference functional modules as the reference functional module.

[0135] For example, the historical functional modules include, but are not limited to, functional modules that have been developed in the past. It should be noted that the specific nature and scope of the historical functional modules can be determined by those skilled in the art based on the actual situation, and the above description is only an example and does not constitute a limitation.

[0136] For example, selecting a function module that is identical to the target function module in the previous detection from multiple historical reference function modules as the reference function module can be exemplified by the following:

[0137] For target functional module A, it was determined during the previous test that it was duplicated with historical functional modules B and C. Multiple historical reference functional modules include historical functional modules B, C, D, E, and F. Therefore, the currently selected reference functional modules include historical functional modules B and C, but not historical functional modules D, E, and F.

[0138] It should be noted that the specific implementation method for selecting a function module that is duplicated with the target function module from multiple historical reference function modules as the reference function module can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0139] Functional modules that were identified as not overlapping with the target functional module in the previous test do not need to be included in the comparison in this test (because if the previous test determined that the functional module was not overlapping with the target functional module, then the target functional module after development modification or without change is also unlikely to overlap with the functional module in this test, so there is little comparative significance). However, functional modules that were identified as overlapping with the target functional module in the previous test need to be included in the comparison to determine whether the target functional module after development modification or without change still overlaps with the functional modules that overlapped in the previous test. Therefore, the above steps ensure that the target functional module is only compared with functional modules that are meaningful for comparison in the current test, thereby reducing the extra time spent on meaningless comparisons and improving the overall speed of detecting overlapping functional modules.

[0140] In one alternative implementation, such as Figure 2 As shown, the step of obtaining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules includes the following steps:

[0141] S201: Based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document, obtain the vocabulary intersection and vocabulary complement.

[0142] S202: Based on the number of words in the complement set of the vocabulary set, obtain the document similarity correction coefficient.

[0143] S203: Based on the number of intersecting words in the word intersection and the number of target words in the target word set, an initial document similarity is obtained, and based on the initial document similarity and the document similarity correction coefficient, the corresponding development document similarity is obtained.

[0144] For example, a target functional module corresponds to a target development document, a reference functional module corresponds to a reference development document, a target development document corresponds to a target vocabulary set, a reference development document corresponds to a reference vocabulary set, and a reference development document and a target development document correspond to a complement vocabulary count, an intersection vocabulary count, a vocabulary intersection, a vocabulary complement, a document similarity correction coefficient, and an initial document similarity coefficient.

[0145] For example, the target vocabulary set can be, but is not limited to, a set of words from the target development document obtained by extracting them using relevant thesaurus (e.g., a thesaurus mainly containing keywords related to application development) and natural language analysis algorithms; correspondingly, the reference vocabulary set can be, but is not limited to, a set of words from the reference development document obtained by extracting them using relevant thesaurus (e.g., a thesaurus mainly containing keywords related to application development) and natural language analysis algorithms. It should be noted that the specific source methods for the target vocabulary set and the reference vocabulary set can be determined by those skilled in the art based on the actual situation; the above description is merely an example and does not constitute a limitation.

[0146] For example, step S202 can be expressed as, but is not limited to, the following formula:

[0147]

[0148] Wherein, |N1(v)-N1(u)| represents the number of words in the complement set, N1(v) represents the reference word set corresponding to the reference functional module v, and N1(u) represents the target word set corresponding to the target functional module u.

[0149] It should be noted that the specific implementation of step S202 can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0150] For example, step S203 can be expressed as, but is not limited to, the following formula:

[0151]

[0152] Among them, w uv The similarity of development documents between the reference functional module v and the target functional module u is represented by |N1(u)∩N1(v)|, where |N1(u)∩N1(v)| represents the number of words in the intersection, and |N1(u)| represents the number of words in the target vocabulary. This indicates the initial document similarity. This represents the document similarity correction coefficient.

[0153] It should be noted that the specific implementation of step S203 can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation. The design of the document similarity correction coefficient fully considers the close relationship between the similarity of the development document and the overall differences between the target development document and the reference development document. It also considers the principle that when the overall differences between the target development document and the reference development document reach a certain level, the rate at which the similarity of the development document decreases as the overall differences between the target development document and the reference development document increase slows down (corresponding to the square root). This ensures that the document similarity correction coefficient accurately reflects the impact of the overall differences between the target development document and the reference development document on the similarity of the development document. Furthermore, the "+1" design is to prevent the document similarity correction coefficient from unexpectedly being 0, which could lead to errors in determining the similarity of the development document (0 as a divisor would result in infinity). Without using a document similarity correction factor, the document similarity score only reflects the proportion of overlapping content in the target document. When the reference document contains more content than the target document, situations may arise where the similarity score is 1, but the reference and target documents are not completely identical (e.g., the reference document includes content from the target document, but they cannot be considered completely similar). This reduces the accuracy of the obtained document similarity score. Therefore, setting and using a document similarity correction factor can significantly improve the accuracy of the obtained document similarity score.

[0154] By following the steps above, the granularity of determining the similarity of development documents can be refined to specific words that can characterize the features and content of the documents. It also fully combines the relevant laws of similarity measurement and the fact that the similarity of development documents is closely related to the overall differences between the target development document and the reference development document. This makes the obtained similarity of development documents more consistent with the actual degree of document duplication, improves the accuracy of obtaining the similarity of development documents, and thus improves the accuracy of detecting the overall duplicate application function modules.

[0155] In an optional implementation, obtaining the lexical intersection and lexical complement based on the target lexical set corresponding to the target development document and the reference lexical set corresponding to the reference development document includes:

[0156] Based on the target vocabulary set and the reference vocabulary set, multiple similar vocabulary subsets are obtained, wherein the vocabulary in the similar vocabulary subsets are different from each other and are synonyms or near-synonyms.

[0157] Select a first representative word from each of the similar word subsets, and take multiple overlapping words that are included in both the target word set and the reference word set as multiple second representative words;

[0158] Based on multiple first representative words and second representative words, the word intersection is obtained, and based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words, the word complement is obtained.

[0159] For example, obtaining multiple subsets of similar words based on the target vocabulary set and the reference vocabulary set can be, but is not limited to, aggregating synonyms or near-synonyms from the target vocabulary set and the reference vocabulary set respectively to obtain multiple subsets of similar words. Specific examples are as follows:

[0160] Given a target vocabulary set of {overlay, send, password, deploy} and a reference vocabulary set of {accumulate, transmit, key, publish, delete, threshold}, then multiple similar vocabulary subsets include {overlay, accumulate}, {send, transmit}, {password, key}, and {deploy, publish}. Here, overlay and accumulation are synonyms, send and transmit are near-synonyms, password and key are near-synonyms, and deployment and publish are near-synonyms. The determination of near-synonyms and near-synonyms can be achieved using relevant thesaurus and dictionaries.

[0161] It should be noted that the specific implementation of obtaining multiple similar word subsets based on the target word set and the reference word set can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0162] For example, obtaining the word intersection based on multiple first representative words and second representative words can be, but is not limited to, aggregating multiple first representative words and second representative words to obtain the word intersection. It should be noted that the specific implementation of obtaining the word intersection based on multiple first representative words and second representative words can be determined by those skilled in the art according to the actual situation; the above description is merely an example and does not constitute a limitation.

[0163] For example, obtaining the word complement based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words can be, but is not limited to, aggregating other target words to obtain the word complement. It should be noted that the specific implementation of obtaining the word complement based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words can be determined by those skilled in the art based on actual circumstances. The above description is merely an example and does not constitute a limitation.

[0164] By following the steps above, when finding the intersection and complement of relevant vocabulary sets, the influence of identical overlapping words, synonyms, and near-synonyms in different sets can be fully considered. This aligns with the relevant rules for vocabulary set processing, ensuring that the vocabulary intersection fully includes identical overlapping words from different sets, as well as words that are not identical but have similar or identical meanings. This improves the accuracy of obtaining the vocabulary intersection, and consequently, the accuracy of obtaining the vocabulary complement. Consequently, the similarity of the subsequently obtained development documents can not only reflect the degree of repetition in the literal form of the development documents, but also the degree of repetition in functionality and logic, further improving the accuracy of obtaining the development document similarity, and thus further improving the accuracy of detecting duplicate application functional modules overall.

[0165] In an optional implementation, it further includes:

[0166] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is consistent with the target development document at the time of the last detection.

[0167] If so, the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the development document similarity between the target functional module and the corresponding reference functional module.

[0168] For example, determining whether the target development document is consistent with the target development document in the previous test can be, but is not limited to, determining whether the current target development document has undergone content changes compared to the target development document in the previous test. If so, the development document similarity between the target functional module determined in the previous test and the corresponding reference functional module is used as the development document similarity between the target functional module and the corresponding reference functional module. It should be noted that the specific implementation method for determining whether the target development document is consistent with the target development document in the previous test can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0169] For example, the method of using the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection as the development document similarity between the target functional module and the corresponding reference functional module can be exemplified by the following:

[0170] If the document similarity between a target functional module A and a reference functional module B was 0.65 in the previous test, then the document similarity between the target functional module A and the reference functional module B is also 0.65 in the current test.

[0171] It should be noted that the specific implementation method of using the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection as the development document similarity between the target functional module and the corresponding reference functional module can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0172] By following the steps above, if the target development document has not changed since the last detection, there is no need to perform an unnecessary development document similarity determination process for the target development document. Instead, the previously determined development document similarity can be directly used. Therefore, it can reduce the waste of time, increase the speed of obtaining development document similarity, and thus improve the overall speed of detecting duplicate application function modules.

[0173] In an optional implementation, it further includes:

[0174] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is in the unwritten stage, the writing stage, or the completed writing stage.

[0175] If the document is in the unwritten stage, use 0 as the similarity score for the corresponding development document;

[0176] If it is in the writing stage, determine whether the target development document was in the writing stage during the last detection. If not, obtain the corresponding development document similarity based on the preset document similarity prediction value.

[0177] If the project is in the final writing stage, the similarity between the development documents of the target functional module and the reference development documents of multiple reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules.

[0178] For example, determining whether the target development document is in the unwritten, writing, or completed writing stage can be, but is not limited to, determining whether the document stage marker corresponding to the target development document (one document stage marker per target functional module) is in the unwritten, writing, or completed writing stage. If it is in the unwritten stage, 0 is used as the corresponding development document similarity. If it is in the writing stage, it is determined whether the target development document was in the writing stage during the last detection; if not, the corresponding development document similarity is obtained based on a preset document similarity prediction value. If it is in the completed writing stage, the development document similarity between the target functional module and the reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules. The document stage marker can be entered or input by staff based on the actual document writing situation, or it can be automatically generated based on the corresponding document stage option filled in by the staff or the background logic corresponding to the triggered document stage confirmation button. It should be noted that the specific implementation method for determining whether the target development document is in the unwritten stage, the writing stage, or the completed writing stage can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0179] For example, the principle of determining whether the target development document was in the writing stage during the last detection can be found in the description of the steps for determining whether the target development document was in the unwritten stage, the writing stage, or the completed writing stage in the embodiments of the present invention, which will not be repeated here.

[0180] For example, obtaining the corresponding development document similarity based on the preset document similarity prediction value can be, but is not limited to, directly using the document similarity prediction value as the corresponding development document similarity, or multiplying the document similarity prediction value by a preset prediction correction weight (this embodiment of the invention is not limited, and can be determined by those skilled in the art according to actual conditions, such as 0.95 or 1.05, etc.) to obtain the development document similarity. It should be noted that the specific implementation method for obtaining the corresponding development document similarity based on the preset document similarity prediction value can be determined by those skilled in the art according to actual conditions; the above description is merely an example and does not constitute a limitation.

[0181] By following the steps above, the relationship between the development document's corresponding task stage and its similarity can be fully considered. This allows for a more appropriate method to determine the similarity of development documents when they correspond to different task stages, improving the speed and accuracy of similarity determination and consequently increasing the speed and accuracy of detecting duplicate application functional modules. Specifically, by using 0 as the similarity score for a development document in the "unwritten" stage, the rule that an unwritten development document has no content and cannot be duplicated with other reference documents is fully considered. This avoids wasting time recalculating the similarity score and directly uses 0 as the similarity score, which conforms to relevant rules (high accuracy) and improves the speed of determining similarity. If the target development document is in the writing stage, it is determined whether it was in the writing stage at the time of the last detection. If not, the corresponding development document similarity is obtained based on a preset document similarity prediction value. This approach, considering that the development document may not have been fully written at the time of the last detection, allows for prediction of its subsequent similarity trend. Using the document similarity prediction value as the current development document similarity meets the relevant requirements, ensuring that the overall similarity determination includes the prediction of the target development document's subsequent repetition trend, thus playing a certain preventive role and improving the accuracy of the overall similarity determination. If the target development document is in the completed writing stage, the similarity between the target functional module and the reference functional modules is obtained based on the target development document and multiple reference functional modules. This approach allows for the determination of development document similarity in a normal manner when the target document is already completed, improving the accuracy of determining development document similarity.

[0182] In an optional implementation, it further includes:

[0183] Before obtaining the corresponding document similarity based on the preset document similarity prediction value,

[0184] The number of historical development documents selected is obtained based on the preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules.

[0185] Based on the number of historical development document similarities selected, the smallest number of historical development document similarities among multiple historical reference functional modules is selected as the development document similarity to be analyzed.

[0186] The highest similarity score of the document to be analyzed is used as the predicted document similarity value.

[0187] For example, the document similarity selection ratio can be determined by those skilled in the art based on actual circumstances, and the embodiments of the present invention do not impose any limitations on this. For instance, the document similarity selection ratio can be, but is not limited to, 90%, 85%, or 80%, etc., preferably 90%.

[0188] For example, the number of similarities between historical development documents of the multiple historical reference functional modules can be, but is not limited to, the number of similarities between pairwise historical development documents of the multiple historical reference functional modules, as shown in the following examples:

[0189] The historical reference function modules include Module A, Module B, Module C, and Module D. There is a historical development document similarity between Module A and Module B, Module A and Module C, Module A and Module D, Module B and Module C, Module B and Module D, and Module C and Module D. Therefore, the total number of historical development document similarities among these multiple historical reference function modules is 6.

[0190] It should be noted that the specific source and nature of the number of similarities between historical development documents of multiple historical reference functional modules can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0191] For example, the method of obtaining the number of historical development document similarities based on a preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules can be, but is not limited to, multiplying the number of historical development document similarities by the document similarity selection ratio and then rounding down to obtain the number of historical development document similarities. It should be noted that the specific implementation of obtaining the number of historical development document similarities based on the preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules can be determined by those skilled in the art according to the actual situation. The above description is merely an example and does not constitute a limitation.

[0192] For example, the step of selecting the smallest similarity among multiple historical development documents from multiple historical reference functional modules based on the number of historical development document similarities can be, but is not limited to, selecting the historical development document similarity with the smallest number of historical development document similarities from multiple historical reference functional modules as the development document similarity to be analyzed. Specific examples include the following:

[0193] There are 10 historical development documents with similarity scores of 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, and 0.8. The number of historical development documents with similarity scores is 6. Therefore, the 6 documents with the lowest similarity scores among the above 10 historical development documents are selected as the development documents to be analyzed. The development documents to be analyzed have similarity scores of 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55.

[0194] It should be noted that the specific implementation method for selecting the minimum number of historical development document similarities from multiple historical development document similarities among multiple historical reference functional modules as the development document similarity to be analyzed can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0195] For example, the step of using the highest similarity of the document to be analyzed as the predicted document similarity value can be exemplified by the following:

[0196] The document similarity scores to be analyzed include 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55. The highest document similarity score is 0.55, so the predicted document similarity score is determined to be 0.55.

[0197] It should be noted that the specific implementation method for using the maximum similarity of the document to be analyzed as the predicted document similarity value can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0198] The document similarity prediction value can be in the range of [0, 1], but is not limited to.

[0199] By following the steps above, the predicted document similarity value can be made to match the upper limit of the overall situation in the historical development document similarity data. This allows the predicted document similarity value to not only conform to the overall document similarity situation but also to have a certain preventive effect (which can be simply understood as predicting the similarity of development documents with the worst-case scenario in mind, so as to detect the trend of duplicate target functional modules earlier in the development process and correct it in time). This improves the accuracy of subsequent determination of development document similarity and thus improves the accuracy of overall duplicate application functional module detection.

[0200] In one alternative implementation, such as Figure 3 The step of obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules includes the following steps:

[0201] S301: Based on each target test case of the target functional module, obtain multiple target test case parameters corresponding to the target test case, and based on multiple reference test cases of the reference functional module, obtain multiple reference test case parameters corresponding to the reference test case.

[0202] S302: Based on the reference case parameters and the target case parameters, determine the proportion of overlapping case parameters that are included in both the reference case parameters and the target case parameters, wherein the proportion of overlapping case parameters is obtained based on the number of overlapping case parameters and the number of target case parameters or the number of reference case parameters.

[0203] S303: The target test cases whose overlapping case parameter ratio is greater than or equal to the preset overlapping ratio threshold are taken as the corresponding case intersection elements to obtain the test case intersection, and the other target test cases other than the case intersection elements are taken as the corresponding case complement elements to obtain the test case complement.

[0204] S304: Based on the number of complement cases in the complement set of the test cases, obtain the case similarity correction coefficient.

[0205] S305: Based on the number of intersection cases of the test case intersection and the number of target cases of the target test case, an initial case similarity is obtained, and based on the initial case similarity and the case similarity correction coefficient, the corresponding test case similarity is obtained.

[0206] For example, the test case may also be referred to as a test case.

[0207] For example, a target functional module corresponds to one or more target test cases, a reference functional module corresponds to one or more reference test cases, a target test case corresponds to multiple target test case parameters, a reference test case corresponds to multiple reference test case parameters, a target test case corresponds to a number of target test case parameters, a reference test case corresponds to a number of reference test case parameters, and a reference test case and a target test case correspond to a ratio of overlapping test case parameters and a number of overlapping test case parameters.

[0208] For example, a target functional module and a reference functional module correspond to a test case intersection, a test case complement, a number of intersection cases, and a number of complement cases.

[0209] For example, step S301 may include, but is not limited to, parsing the target test case to obtain multiple target test case parameters, and parsing the reference test case to obtain multiple reference test case parameters. The test case parameters may be, but are not limited to, input and / or output parameters of the test case. It should be noted that the specific implementation of step S301 and the specific nature of the test case parameters can be determined by those skilled in the art based on actual circumstances. The above description is merely an example and does not constitute a limitation.

[0210] For example, the overlapping case parameter ratio can be obtained by dividing the number of overlapping case parameters by the number of target case parameters or the number of reference case parameters. Preferably, it is obtained by dividing the number of overlapping case parameters by the smaller of the number of target case parameters and the number of reference case parameters. It should be noted that the specific method for determining the overlapping case parameter ratio can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0211] For example, the overlap ratio threshold can be determined by those skilled in the art based on actual circumstances, and the embodiments of the present invention do not impose any limitations on it. For instance, the overlap ratio threshold can be, but is not limited to, 75%, 80%, 85%, or 90%.

[0212] For example, when comparing target test cases and reference test cases, each target test case and each reference test case are compared separately, for example:

[0213] A target functional module corresponds to target test case A, target test case B, and target test case C, while a reference functional module corresponds to reference test case D, reference test case E, and reference test case F. The target test cases A and reference test case D, E, F, B and reference test case D, E, F, C and reference test case C, and C and reference test case E, and C and reference test case F are compared respectively, resulting in a total of 9 overlapping case parameter ratios (each target test case corresponds to 3 overlapping case parameter ratios).

[0214] It should be noted that the specific comparison and correspondence of test cases can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0215] For example, step S303 can be, but is not limited to, taking the target test cases whose overlapping case parameter ratio has a ratio greater than or equal to a preset overlapping ratio threshold as the corresponding case intersection elements, and aggregating the case intersection elements to obtain the test case intersection; taking the other target test cases besides the case intersection elements as the corresponding case complement elements, and aggregating the case complement elements to obtain the test case complement. Examples of the target test cases whose overlapping case parameter ratio has a ratio greater than or equal to a preset overlapping ratio threshold include:

[0216] A target test case A corresponds to three overlapping case parameter ratios: overlapping case parameter ratio A, overlapping case parameter ratio B, and overlapping case parameter ratio C. Among these, overlapping case parameter ratio A is greater than the overlap ratio threshold, while overlapping case parameter ratios B and C are both less than the overlap ratio threshold. Therefore, the target test case A is a target test case in which one of the corresponding overlapping case parameter ratios (overlapping case parameter ratio A, overlapping case parameter ratio B, and overlapping case parameter ratio C) has an overlapping case parameter ratio (overlapping case parameter ratio A) greater than or equal to the preset overlap ratio threshold, thus satisfying the condition of case intersection elements.

[0217] It should be noted that the specific implementation method of step S303 and the specific properties of the intersection elements of the cases can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0218] For example, step S304 can be expressed as, but is not limited to, the following formula:

[0219]

[0220] Wherein, |N2(v)-N2(u)| represents the number of complement cases, N2(v) represents the set of reference test cases corresponding to reference functional module v, and N2(u) represents the set of target test cases corresponding to the target functional module u.

[0221] It should be noted that the specific implementation of step S304 can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0222] For example, step S305 can be expressed as, but is not limited to, the following formula:

[0223]

[0224] Where, x uvLet |N2(u)∩N2(v)| represent the test case similarity between the reference functional module v and the target functional module u, |N2(u)∩N2(v)| represent the number of intersection cases, and |N2(u)| represent the number of target cases. This indicates the similarity of the initial cases. This represents the similarity correction coefficient for the stated cases.

[0225] It should be noted that the specific implementation of step S305 can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation. The design of the case similarity correction coefficient fully considers the close relationship between test case similarity and the overall difference between the target test case and the reference test case. It also considers the fact that when the overall difference between the target test case and the reference test case becomes large enough, the rate at which the test case similarity decreases as the overall difference between the target test case and the reference test case increases (corresponding to the square root). This ensures that the case similarity correction coefficient accurately reflects the impact of the overall difference between the target test case and the reference test case on the test case similarity. Furthermore, the "+1" design is to prevent the case similarity correction coefficient from unexpectedly being 0, which could lead to errors in determining the test case similarity (0 as a divisor would result in infinity). Without using a test case similarity correction factor, the test case similarity score only reflects the proportion of overlapping test cases out of the total target test cases. When the number of reference test cases exceeds the number of target test cases, situations may arise where the test case similarity score is 1, but the reference test cases and target test cases are not completely identical overall (e.g., reference test cases include target test cases, but they cannot be considered completely similar in the overall test case set). This reduces the accuracy of the obtained test case similarity score. Therefore, setting and using a test case similarity correction factor can significantly improve the accuracy of the obtained test case similarity score.

[0226] By following the steps above, the granularity of determining test case similarity can be refined to specific test case parameters that reflect the characteristics and content of the test cases. It also fully combines the relevant laws for measuring similarity and the fact that test case similarity is closely related to the overall differences between the target test cases of the target functional module and the reference test cases of the reference functional module. This makes the obtained test case similarity more consistent with the actual degree of repetition of the test cases, improves the accuracy of the obtained test case similarity, and thus improves the accuracy of the overall detection of repeated application functional modules.

[0227] In an optional implementation, it further includes:

[0228] Before obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, it is determined whether the target test case is consistent with the target test case in the previous detection.

[0229] If so, the test case similarity between the target functional module and the corresponding reference functional module determined in the previous test shall be used as the test case similarity between the target functional module and the corresponding reference functional module.

[0230] For example, determining whether the target test case is consistent with the target test case in the previous test can be, but is not limited to, determining whether there is no increase, decrease, or modification of test cases compared to the target test cases corresponding to the target functional module in the previous test. If so, the test case similarity between the target functional module determined in the previous test and the corresponding reference functional module is used as the test case similarity between the target functional module and the corresponding reference functional module. It should be noted that the specific implementation of determining whether the target test case is consistent with the target test case in the previous test can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0231] For example, the method of using the test case similarity between the target functional module determined in the previous detection and the corresponding reference functional module as the test case similarity between the target functional module and the corresponding reference functional module can be exemplified by the following:

[0232] If the similarity of test cases between a target functional module A and a reference functional module B was 0.65 in the previous test, then the similarity of test cases between the target functional module A and the reference functional module B will be 0.65 in the current test.

[0233] It should be noted that the specific implementation method of using the test case similarity between the target functional module determined in the previous test and the corresponding reference functional module as the test case similarity between the target functional module and the corresponding reference functional module can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0234] By following the steps above, if the target test cases remain unchanged from the previous test, there is no need to perform an unnecessary test case similarity determination process for the target test cases. Instead, the previously determined test case similarity can be directly used. Therefore, it can reduce the waste of time, increase the speed of obtaining test case similarity, and thus improve the overall speed of detecting repetitive application function modules.

[0235] In an optional implementation, it further includes:

[0236] Before determining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules, it is determined whether the target test case is in the unwritten stage, the writing stage, or the completed writing stage.

[0237] If the test case is in the unwritten stage, 0 will be used as the similarity score.

[0238] If it is in the writing stage, determine whether the target test case was in the writing stage during the last detection. If not, obtain the corresponding test case similarity based on the preset case similarity prediction value.

[0239] If the project is in the completion stage, the test case similarity between the target functional module and the reference functional modules is obtained based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

[0240] For example, determining whether the target test case is in the unwritten, writing, or completed writing stage can be, but is not limited to, determining whether the test case stage marker corresponding to the target test case (one target functional module corresponds to one test case stage marker) is in the unwritten, writing, or completed writing stage marker. If it is in the unwritten stage, 0 is used as the corresponding test case similarity. If it is in the writing stage, it is determined whether the target test case was in the writing stage during the last detection; if not, the corresponding test case similarity is obtained based on a preset case similarity prediction value. If it is in the completed writing stage, the test case similarity between the target functional module and the reference functional modules is obtained based on the target test case of the target functional module and the reference test cases of multiple reference functional modules. The test case stage marker can be entered or input by staff according to the actual situation of test case writing, or it can be automatically generated based on the corresponding test case stage option filled in by the staff or the background logic corresponding to the triggered test case stage confirmation button. It should be noted that the specific implementation method for determining whether the target test case is in the unwritten stage, the writing stage, or the completed writing stage can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0241] For example, the principle of determining whether the target test case was in the writing stage during the last detection can be found in the description of the steps for determining whether the target test case was in the non-writing stage, the writing stage, or the writing stage in the embodiments of the present invention, which will not be repeated here.

[0242] For example, obtaining the corresponding test case similarity based on the preset case similarity prediction value can be, but is not limited to, directly using the case similarity prediction value as the corresponding test case similarity, or multiplying the case similarity prediction value by a preset prediction correction weight (this embodiment of the invention is not limited, and can be determined by those skilled in the art according to actual conditions, such as 0.95 or 1.05, etc.) to obtain the test case similarity. It should be noted that the specific implementation method for obtaining the corresponding test case similarity based on the preset case similarity prediction value can be determined by those skilled in the art according to actual conditions; the above description is merely an example and does not constitute a limitation.

[0243] By following the steps above, the relationship between the task stage corresponding to the test case and the test case similarity can be fully considered. This allows for a more appropriate method to determine the test case similarity when the test case corresponds to different task stages, improving the speed or accuracy of test case similarity determination and thus increasing the overall speed or accuracy of detecting duplicate application function modules. Specifically, by using 0 as the test case similarity if the test case is in the unwritten stage, the rule that if a test case is unwritten, it has no content and cannot be repeated with other reference test cases can be fully considered. This avoids wasting time calculating the test case similarity again; instead, 0 is directly used as the test case similarity, which conforms to relevant rules (high accuracy) and improves the speed of determining test case similarity. If the target test case is in the development stage, the system determines whether it was in the development stage during the last test. If not, it obtains the corresponding test case similarity based on a preset case similarity prediction value. This approach, considering that the development of the test case may not be extensive at the time of the last test, allows for prediction of its future similarity trend. Using the case similarity prediction value as the current test case similarity meets the relevant requirements, ensuring that the overall similarity determination includes predictions of the target test case's future repetition trend, thus playing a preventative role and improving the accuracy of the overall similarity determination. If the target test case is in the completed development stage, the system obtains the test case similarity between the target functional module and the reference functional modules based on the target test case and multiple reference functional modules. This approach allows for the determination of test case similarity in a normal manner when the target test case is already completed, improving the accuracy of test case similarity determination.

[0244] In an optional implementation, it further includes:

[0245] Before obtaining the corresponding test case similarity based on the preset case similarity prediction value,

[0246] The number of historical test case similarities is obtained based on the preset case similarity selection ratio and the number of historical test case similarities between multiple historical reference functional modules.

[0247] Based on the number of historical test case similarities selected, the smallest number of historical test case similarities among multiple historical reference functional modules is selected as the test case similarity to be analyzed.

[0248] The highest similarity among the test cases to be analyzed is used as the predicted similarity value.

[0249] For example, the case similarity selection ratio can be determined by those skilled in the art based on actual circumstances, and the embodiments of the present invention do not impose any limitations on this. For instance, the case similarity selection ratio can be, but is not limited to, 90%, 85%, or 80%, etc., preferably 90%.

[0250] For example, the number of historical test case similarities among the multiple historical reference function modules can be, but is not limited to, the number of pairwise historical test case similarities among the multiple historical reference function modules, as shown in the following examples:

[0251] The historical reference function modules include Module A, Module B, Module C, and Module D. There is one historical test case similarity between Module A and Module B, one between Module A and Module C, one between Module A and Module D, one between Module B and Module C, one between Module B and Module D, and one between Module C and Module D. Therefore, the total number of historical test case similarities among these multiple historical reference function modules is 6.

[0252] It should be noted that the specific source and nature of the number of similarities of historical test cases among multiple historical reference functional modules can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0253] For example, the step of selecting the smallest number of historical test case similarities from multiple historical test case similarities among multiple historical reference functional modules as the test case similarity to be analyzed can be, but is not limited to, selecting the historical test case similarity with the smallest number of historical test case similarities from multiple historical test case similarities among multiple historical reference functional modules as the test case similarity to be analyzed. Specific examples are as follows:

[0254] There are 10 historical test cases with similarity scores of 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, and 0.8. The number of historical test case similarities selected is 6. Then, the 6 with the lowest similarity scores among the above 10 historical test cases are selected as the test case similarity scores to be analyzed. The test case similarity scores to be analyzed include 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55.

[0255] It should be noted that the specific implementation method for selecting the minimum similarity among multiple historical test cases from multiple historical reference functional modules based on the number of historical test case similarities can be determined by those skilled in the art according to the actual situation. The above description is only an example and does not constitute a limitation.

[0256] For example, the step of using the highest similarity of the test cases to be analyzed as the predicted similarity value can be exemplified by the following:

[0257] The similarity scores of the test cases to be analyzed include 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55. The highest similarity score of the test cases to be analyzed is 0.55, so the predicted similarity value of the case is determined to be 0.55.

[0258] It should be noted that the specific implementation method for using the maximum similarity of the test cases to be analyzed as the predicted similarity value can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0259] The range of the case similarity prediction value can be, but is not limited to, [0, 1].

[0260] By following the steps above, the predicted case similarity value can be made to match the upper limit of the overall situation in the historical test case similarity. This allows the predicted case similarity value to not only conform to the overall case similarity situation, but also to have a certain preventive effect (which can be simply understood as predicting the similarity of test cases with the worst-case scenario in mind, so as to detect the trend of duplicate target functional modules earlier in the development process and correct it in time). This improves the accuracy of subsequent determination of test case similarity, thereby improving the accuracy of overall duplicate application functional module detection.

[0261] In one alternative implementation, such as Figure 4 As shown, the step of obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules includes the following steps:

[0262] S401: Based on each target invocation method of the target functional module, obtain the target name information corresponding to the target invocation method, and based on the multiple reference invocation methods of the reference functional module, obtain the reference name information corresponding to the reference invocation method, wherein the target name information includes the method name, class name and input parameter name corresponding to the target invocation method, and the reference name information includes the method name, class name and input parameter name corresponding to the reference invocation method.

[0263] S402: The target calling method corresponding to the target name information included in the reference name information is taken as the corresponding method intersection element to obtain the calling method intersection, and other target calling methods other than the method intersection element are taken as the corresponding method complement elements to obtain the calling method complement.

[0264] S403: Based on the number of complement methods in the complement set of the called method, obtain the method similarity correction coefficient.

[0265] S404: Based on the number of intersection methods of the intersection of the calling methods and the number of target methods of the target calling method, an initial method similarity is obtained, and based on the initial method similarity and the method similarity correction coefficient, the corresponding calling method similarity is obtained.

[0266] For example, the calling method can also be a function call.

[0267] For example, a target functional module corresponds to one or more target calling methods, a reference functional module corresponds to one or more reference calling methods, a target calling method corresponds to a target name information, and a reference calling method corresponds to a reference name information.

[0268] For example, the target invocation method may be, but is not limited to, invoking the relevant method in the code of the target functional module; correspondingly, the reference invocation method may be, but is not limited to, invoking the relevant method in the code of the reference functional module. It should be noted that the specific nature of the target invocation method and the reference invocation method can be determined by those skilled in the art based on the actual situation; the above description is merely illustrative and does not constitute a limitation.

[0269] Preferably, the target invocation method can be determined by querying and extracting the methods involved in the invocation in the code of the target functional module using relevant method libraries (e.g., a method library that mainly includes key methods related to application development, excluding overly common methods, such as the constructor, get method, and put / add method of HashMap and ArrayList, etc.); correspondingly, the reference invocation method can be obtained by querying and extracting the methods involved in the invocation in the code of the reference functional module using relevant method libraries (e.g., a method library that mainly includes key methods related to application development, excluding overly common methods, such as the constructor, get method, and put / add method of HashMap and ArrayList, etc.).

[0270] For example, step S401 may include, but is not limited to, parsing the target calling method to obtain the target name information corresponding to the target calling method, and parsing the reference calling method to obtain the reference name information corresponding to the reference calling method. Specifically, the target name information may be, but is not limited to, name information formed by concatenating the method name, class name, and input parameter name corresponding to the target calling method; similarly, the reference name information may be, but is not limited to, name information formed by concatenating the method name, class name, and input parameter name corresponding to the reference calling method. It should be noted that the specific implementation of step S401 and the specific nature of the name information can be determined by those skilled in the art based on actual circumstances. The above description is merely an example and does not constitute a limitation.

[0271] For example, the target name information included in the reference name information can be exemplified by the following:

[0272] If a target functional module has target name information A, target name information B, and target name information C, and a corresponding reference functional module has reference name information B, reference name information C, and reference name information D, then the target name information included in the reference name information is target name information B and target name information C.

[0273] It should be noted that the specific nature of the target name information included in the reference name information can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0274] For example, step S402 may, but is not limited to, using the target calling methods corresponding to the target name information included in the reference name information as corresponding method intersection elements, and aggregating the method intersection elements to obtain a calling method intersection; and using other target calling methods besides the method intersection elements as corresponding method complement elements, and aggregating the method complement elements to obtain a calling method complement. It should be noted that the specific implementation of step S402 can be determined by those skilled in the art based on actual circumstances; the above description is merely an example and does not constitute a limitation.

[0275] Preferably, for each target calling method, based on the method name of the target calling method and the method name of the reference calling methods, it can be determined whether there are any reference calling methods among multiple reference calling methods that have the same or similar functions as the target calling method. If so, the target calling method is determined as a method intersection element, and the intersection of calling methods is obtained based on multiple method intersection elements. Specifically, the method names of the target calling method and the reference calling methods can be used, but are not limited to, to query and compare within the corresponding method library (which defines which methods (method names) are functionally consistent or similar; for example, the method library defines the toString method of a Java primitive class and the Valueof method of the String class as functionally consistent) to determine whether the target calling method and the reference calling methods are functionally consistent or similar, thereby determining whether there are any reference calling methods among multiple reference calling methods that have the same or similar functions as the target calling method. This allows the methods in the calling method intersection to more accurately be functionally duplicated methods, ensuring that the subsequently determined calling method similarity matches the degree of overlap in the overall architecture and overall functionality of the calling methods between the target functional module and the reference functional modules, thus improving the accuracy of detecting overall duplicate application functional modules.

[0276] For example, step S403 can be expressed as, but is not limited to, the following formula:

[0277]

[0278] Wherein, |N3(v)-N3(u)| represents the number of complement methods, N3(v) represents the set of reference call methods corresponding to the reference functional module v, and N3(u) represents the set of target call methods corresponding to the target functional module u.

[0279] It should be noted that the specific implementation of step S403 can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0280] For example, step S404 can be expressed as, but is not limited to, the following formula:

[0281]

[0282] Among them, y uv Let |N3(u)∩N3(v)| represent the similarity of the calling methods between the reference functional module v and the target functional module u, |N3(u)∩N3(v)| represent the number of intersection methods, and |N3(u)| represent the number of target methods. This indicates the similarity of the initial methods. This represents the similarity correction coefficient of the method.

[0283] It should be noted that the specific implementation of step S405 can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation. The design of the method similarity correction coefficient fully considers the close relationship between the similarity of the calling method and the overall difference between the target calling method and the reference calling method. It also considers the fact that when the overall difference between the target calling method and the reference calling method is large enough, the rate at which the similarity of the calling method decreases as the overall difference between the target calling method and the reference calling method increases (corresponding to the square root). This ensures that the method similarity correction coefficient accurately reflects the impact of the overall difference between the target calling method and the reference calling method on the similarity of the calling method. Furthermore, the "+1" design is to prevent the method similarity correction coefficient from unexpectedly being 0, which could lead to errors in determining the similarity of the calling method (0 as a divisor would result in infinity). Without a method similarity correction factor, the method call similarity only reflects the proportion of overlapping method calls out of the total target method call. When the number of reference method calls exceeds the number of target method calls, situations may arise where the method call similarity is 1, but the reference and target method calls are not entirely identical overall (e.g., the reference method calls include the target method, but they cannot be considered completely similar in terms of overall method call similarity). This reduces the accuracy of the obtained method call similarity. Therefore, setting and using a method similarity correction factor can significantly improve the accuracy of the obtained method call similarity.

[0284] Through the above steps, the granularity of determining the similarity of called methods can be refined to the specific method name information that can characterize the features and content of the called methods. Since the method name information includes the corresponding method name, class name, and input parameter name, it has a stronger identification effect on the called methods and can more specifically reflect the characteristics of the called methods. It also fully combines the relevant laws of similarity measurement and the law that the similarity of called methods is closely related to the overall difference between the target called method of the target functional module and the reference called method of the reference functional module. This makes the obtained similarity of called methods more consistent with the actual degree of repetition of called methods, improves the accuracy of the obtained similarity of called methods, and thus improves the accuracy of the overall detection of repeated application functional modules.

[0285] In an optional implementation, it further includes:

[0286] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is consistent with the target calling method in the previous detection.

[0287] If so, the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the similarity of the calling methods between the target functional module and the corresponding reference functional module.

[0288] For example, determining whether the target invocation method is consistent with the target invocation method in the previous detection can be, but is not limited to, determining whether there is no increase, decrease, or modification of invocation methods among the multiple target invocation methods corresponding to the current target functional module compared to the multiple target invocation methods corresponding to the target functional module in the previous detection. If so, the similarity of invocation methods between the target functional module determined in the previous detection and the corresponding reference functional module is taken as the similarity of invocation methods between the target functional module and the corresponding reference functional module. It should be noted that the specific implementation of determining whether the target invocation method is consistent with the target invocation method in the previous detection can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0289] For example, the method of using the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection as the similarity of the calling methods between the target functional module and the corresponding reference functional module can be exemplified by the following example:

[0290] If the similarity of the calling methods of a target functional module A and a reference functional module B was determined to be 0.65 in the previous detection, then in the current detection, the similarity of the calling methods of the target functional module A and the reference functional module B is determined to be 0.65.

[0291] It should be noted that the specific implementation of using the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection as the similarity of the calling methods between the target functional module and the corresponding reference functional module can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0292] By following the steps above, if the target calling method remains unchanged from the previous detection, it is not necessary to perform an unnecessary calling method similarity determination process for the target calling method. Instead, the previously determined calling method similarity can be directly used. Therefore, it can reduce the waste of time, increase the speed of obtaining calling method similarity, and thus improve the overall speed of detecting duplicate application function modules.

[0293] In an optional implementation, it further includes:

[0294] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is in the unwritten stage, the writing stage, or the completed writing stage.

[0295] If the code is not yet written, use 0 as the similarity score of the corresponding calling method.

[0296] If it is in the writing stage, determine whether the target calling method was in the writing stage during the last detection. If not, obtain the corresponding calling method similarity based on the preset method similarity prediction value.

[0297] If the project is in the completion stage, the similarity of the calling methods between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules.

[0298] For example, determining whether the target calling method is in the unwritten, writing, or completed writing stage can be, but is not limited to, determining whether the calling method stage marker (one calling method stage marker per target functional module) is an unwritten, writing, or completed writing stage marker. If it is an unwritten stage marker, 0 is used as the corresponding calling method similarity. If it is a writing stage marker, it is determined whether the target calling method was in the writing stage during the last detection; if not, the corresponding calling method similarity is obtained based on a preset case similarity prediction value. If it is a completed writing stage marker, the calling method similarity between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of multiple reference functional modules. The calling method stage marker can be entered or input by staff based on the actual writing status of the calling method, or it can be automatically generated based on the corresponding calling method stage option filled in by the staff or the background logic corresponding to the triggered corresponding calling method stage confirmation button. It should be noted that the specific implementation method for determining whether the target calling method is in the unwritten stage, the writing stage, or the completed writing stage can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0299] For example, the principle of determining whether the target calling method was in the writing stage during the last detection can be found in the description of the steps for determining whether the target calling method was in the unwritten stage, the writing stage, or the completed writing stage in the embodiments of the present invention, which will not be repeated here.

[0300] For example, obtaining the corresponding method invocation similarity based on a preset method similarity prediction value can be, but is not limited to, directly using the method similarity prediction value as the corresponding method invocation similarity, or multiplying the method similarity prediction value by a preset prediction correction weight (this embodiment of the invention does not impose limitations and can be determined by those skilled in the art based on actual circumstances, such as 0.95 or 1.05) to obtain the method invocation similarity. It should be noted that the specific implementation of obtaining the corresponding method invocation similarity based on the preset method similarity prediction value can be determined by those skilled in the art based on actual circumstances; the above description is merely an example and does not constitute a limitation.

[0301] By following the steps above, the relationship between the job stage corresponding to the called method and the similarity of the called method can be fully considered. This allows for a more appropriate method to determine the similarity of called methods when they correspond to different job stages, improving the speed and accuracy of similarity determination and thus enhancing the overall speed and accuracy of detecting duplicate application function modules. Specifically, by using 0 as the similarity score for the called method if it is in the unwritten stage, the rule that if the called method is unwritten, it has no content and cannot be duplicated with other reference called methods can be fully considered. This avoids wasting time calculating the similarity score again; instead, 0 is directly used as the similarity score, which conforms to relevant rules (high accuracy) and improves the speed of determining the similarity of called methods. If the target method is in the writing stage, it determines whether the target calling method was in the writing stage during the last detection. If not, based on a preset method similarity prediction value, the corresponding calling method similarity is obtained. This approach, considering that the writing of the calling method may not be extensive at the time of the last detection, allows for prediction of its subsequent similarity trend. Using the method similarity prediction value as the current calling method similarity meets the relevant requirements, ensuring that the overall similarity determination includes the prediction of the target calling method's subsequent repetition trend, thus playing a certain preventative role and improving the accuracy of the overall similarity. If the target method is in the completed writing stage, the calling method similarity between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of multiple reference functional modules. This approach allows for the determination of the calling method similarity in a normal manner when the target calling method is already completed, improving the accuracy of the calling method similarity determination.

[0302] In an optional implementation, it further includes:

[0303] Before obtaining the corresponding method similarity based on the preset method similarity prediction value...

[0304] The number of historical call method similarities is obtained based on the preset method similarity selection ratio and the number of historical call method similarities among multiple historical reference functional modules;

[0305] Based on the number of historical call method similarities selected, the smallest number of historical call method similarities among multiple historical call method similarities between multiple historical reference functional modules is selected as the call method similarity to be analyzed.

[0306] The highest similarity between the methods to be analyzed is used as the predicted similarity value.

[0307] For example, the method similarity selection ratio can be determined by those skilled in the art based on actual circumstances, and the embodiments of the present invention do not impose any limitations on this. For instance, the method similarity selection ratio can be, but is not limited to, 90%, 85%, or 80%, etc., preferably 90%.

[0308] For example, the number of similarities in historical call methods among the multiple historical reference function modules can be, but is not limited to, the number of similarities in historical call methods between each pair of multiple historical reference function modules, as shown in the following examples:

[0309] The historical reference function modules include Module A, Module B, Module C, and Module D. There is a historical call method similarity between Module A and Module B, Module A and Module C, Module A and Module D, Module B and Module C, Module B and Module D, and Module C and Module D. Therefore, the total number of historical call method similarities among these multiple historical reference function modules is 6.

[0310] It should be noted that the specific source and nature of the number of historical call method similarities among multiple historical reference function modules can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation.

[0311] For example, the step of selecting the smallest number of historical call method similarities from multiple historical call method similarities among multiple historical reference functional modules as the call method similarity to be analyzed can be, but is not limited to, selecting the historical call method similarity with the smallest number of historical call method similarities from multiple historical call method similarities among multiple historical reference functional modules as the call method similarity to be analyzed. Specific examples include the following:

[0312] There are 10 historical call method similarities of 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, and 0.8. The number of historical call method similarities selected is 6. Then, the 6 with the smallest similarities among the above 10 historical call method similarities are selected as the call method similarities to be analyzed. The call method similarities to be analyzed include 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55.

[0313] It should be noted that the specific implementation method for selecting the minimum number of historical call method similarities from multiple historical call method similarities among multiple historical reference functional modules as the call method similarity to be analyzed can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0314] For example, the step of using the highest similarity of the method to be analyzed as the predicted method similarity value can be exemplified by the following:

[0315] The similarity scores of the methods to be analyzed include 0.3, 0.35, 0.4, 0.45, 0.5, and 0.55. The highest similarity score of the methods to be analyzed is 0.55, so the predicted similarity value of the method is determined to be 0.55.

[0316] It should be noted that the specific implementation of using the maximum similarity of the method to be analyzed as the predicted similarity value can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0317] The range of the method similarity prediction value can be, but is not limited to, [0, 1].

[0318] By following the steps above, the predicted method similarity value can be made to match the upper limit of the overall situation in the historical method similarity data. This allows the predicted method similarity value to not only conform to the overall method similarity situation but also to have a certain preventive effect (which can be simply understood as predicting the similarity of the method calls based on the worst-case scenario, thus making it easier to detect the trend of duplicate target functional modules earlier during development and correct it in time). This improves the accuracy of subsequent determination of the similarity of the method calls, thereby improving the accuracy of the detection of duplicate application functional modules.

[0319] In one alternative implementation, such as Figure 5 As shown, the step of obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules includes the following steps:

[0320] S501: Based on the target field set corresponding to the target data field and the reference field set corresponding to the reference data field, obtain the field intersection and field complement.

[0321] S502: Based on the number of complement fields in the complement set of the field, obtain the field similarity correction coefficient.

[0322] S503: Based on the number of intersection fields of the field intersection and the number of target fields of the target field set, an initial field similarity is obtained, and based on the initial field similarity and the field similarity correction coefficient, the corresponding data field similarity is obtained.

[0323] For example, a target functional module corresponds to a target field set, a reference functional module corresponds to a reference field set, and a target functional module and a reference functional module correspond to a field intersection, a field complement, a number of complement fields, a number of intersection fields, and an initial field similarity.

[0324] For example, the target field set can be, but is not limited to, a set of corresponding data fields recorded in a data standard library obtained by querying and extracting multiple data fields involved in relevant files and code of the target reference functional module using a relevant data standard library (e.g., a data standard library that mainly includes data fields related to application development). The reference field set is similar. It should be noted that the specific source methods of the target field set and the reference field set can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0325] For example, the specific principle of step S501 can be found in the description of the steps in this embodiment of the invention for obtaining the vocabulary intersection and vocabulary complement based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document, which will not be repeated here. Since the specific functions, definitions, and meanings of fields are recorded in the relevant data standard library, and which fields are synonyms or near-synonyms (which may be identical or similar in function, definition, or meaning) are detailed in the data standard library, it is also possible to determine the corresponding subset of near-synonyms.

[0326] For example, step S502 can be expressed as, but is not limited to, the following formula:

[0327]

[0328] Wherein, |N4(v)-N4(u)| represents the number of complement fields, N4(v) represents the reference field set corresponding to the reference functional module v, and N4(u) represents the target field set corresponding to the target functional module u.

[0329] It should be noted that the specific implementation of step S502 can be determined by those skilled in the art based on the actual situation. The above description is only an example and does not constitute a limitation.

[0330] For example, step S503 can be expressed as, but is not limited to, the following formula:

[0331]

[0332] Among them, z uv This represents the data field similarity between the reference functional module v and the target functional module u, where |N4(u)∩N4(v)| represents the number of intersection fields, and |N4(u)| represents the number of target fields. This indicates the initial field similarity. This represents the field similarity correction coefficient.

[0333] It should be noted that the specific implementation of step S503 can be determined by those skilled in the art based on the actual situation. The above description is merely an example and does not constitute a limitation. The design of the field similarity correction coefficient fully considers the close relationship between data field similarity and the overall difference between the target data field and the reference data field. It also considers the principle that when the overall difference between the target data field and the reference data field becomes large enough, the rate at which the data field similarity decreases as the overall difference between the target data field and the reference data field increases (corresponding to the square root). This ensures that the field similarity correction coefficient accurately reflects the impact of the overall difference between the target data field and the reference data field on the data field similarity. Furthermore, the "+1" design is to prevent the field similarity correction coefficient from unexpectedly being 0, which could lead to errors in determining the data field similarity (0 as a divisor would result in infinity). Without using a field similarity correction coefficient, the data field similarity score only reflects the proportion of overlapping data fields out of the total target data fields. When the number of reference data fields exceeds the number of target data fields, situations may arise where the data field similarity score is 1, but the reference data fields and target data fields are not completely identical overall (e.g., the reference data fields include the target data fields, but they cannot be considered completely similar in terms of overall data fields). This reduces the accuracy of the obtained data field similarity score. Therefore, setting and using a field similarity correction coefficient can significantly improve the accuracy of the obtained data field similarity score.

[0334] By following the steps above, the similarity of data fields can be accurately determined based on the specific overlap of relevant fields and actual principles. Furthermore, the significant impact of field deviations on similarity is considered and corrected accordingly, thereby further improving the accuracy of determining the similarity of data fields.

[0335] In an optional implementation, it further includes:

[0336] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of multiple reference functional modules, it is determined whether the target data field is consistent with the target data field in the previous detection.

[0337] If so, the data field similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the data field similarity between the target functional module and the corresponding reference functional module.

[0338] For example, the specific principle of determining whether the target data field is consistent with the target data field in the previous detection can be found in the description of the step of determining whether the target calling method is consistent with the target calling method in the previous detection in the embodiments of the present invention, which will not be repeated here.

[0339] For example, the specific principle of using the data field similarity between the target functional module and the corresponding reference functional module determined in the previous detection as the data field similarity between the target functional module and the corresponding reference functional module can be referred to in the description of the step of using the calling method similarity between the target functional module and the corresponding reference functional module determined in the previous detection as the calling method similarity between the target functional module and the corresponding reference functional module in the embodiments of the present invention, which will not be repeated here.

[0340] By following the steps above, if the target data field remains unchanged compared to the previous detection, there is no need to perform an unnecessary data field similarity determination process for the target data field. Instead, the previously determined data field similarity can be directly used. Therefore, it can reduce the waste of time, increase the speed of obtaining data field similarity, and thus improve the overall speed of detection of the repeated application function module.

[0341] In an optional implementation, it further includes:

[0342] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules, it is determined whether the target data field is in the unconfigured stage, the configuration stage, or the configuration completed stage.

[0343] If it is in the unconfigured stage, 0 will be used as the similarity of the corresponding data field;

[0344] If it is in the configuration phase, determine whether the target data field was in the configuration phase during the last detection. If not, obtain the corresponding data field similarity based on the preset field similarity prediction value.

[0345] If the project is in the completion stage, the similarity of data fields between the target functional module and the reference functional modules is obtained based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules.

[0346] For example, the specific principle of determining whether the target data field is in the unconfigured stage, the configuration stage, or the configuration completed stage can be found in the description of the steps for determining whether the target calling method is in the unwritten stage, the writing stage, or the writing completed stage in the embodiments of the present invention, which will not be repeated here.

[0347] For example, obtaining the corresponding data field similarity based on the preset field similarity prediction value can be, but is not limited to, directly using the field similarity prediction value as the corresponding data field similarity, or multiplying the field similarity prediction value by a preset prediction correction weight (this embodiment of the invention is not limited, and can be determined by those skilled in the art according to the actual situation, such as 0.95 or 1.05, etc.) to obtain the data field similarity. It should be noted that the specific implementation method for obtaining the corresponding data field similarity based on the preset field similarity prediction value can be determined by those skilled in the art according to the actual situation. The above description is only an example and does not constitute a limitation.

[0348] By taking the above steps, we can fully consider the relationship between the work stage corresponding to the data field and the similarity of the data field. This allows us to determine the similarity of the data field in a more appropriate way when the data field corresponds to different work stages, thereby improving the speed or accuracy of determining the similarity of the data field and thus improving the speed or accuracy of detecting the overall repetitive application function module.

[0349] In an optional implementation, it further includes:

[0350] Before obtaining the corresponding data field similarity based on the preset field similarity prediction value,

[0351] The number of historical data field similarities is obtained based on the preset field similarity selection ratio and the number of historical data field similarities between multiple historical reference functional modules.

[0352] Based on the number of historical data field similarities selected, the lowest number of historical data field similarities among multiple historical data field similarities between multiple historical reference functional modules is selected as the similarity of the data field to be analyzed.

[0353] The highest similarity among the fields of the data to be analyzed is used as the predicted field similarity value.

[0354] For example, the field similarity selection ratio can be determined by those skilled in the art based on actual circumstances, and this embodiment of the invention does not impose any limitations on it. For instance, the field similarity selection ratio can be, but is not limited to, 90%, 85%, or 80%, etc., preferably 90%.

[0355] For example, the nature of the quantity of similarity of historical data fields among the plurality of historical reference function modules can be referred to the description of the quantity of similarity of historical call methods among the plurality of historical reference function modules in the embodiments of the present invention, and will not be repeated here.

[0356] For example, the specific principle of selecting the minimum similarity of multiple historical data fields from multiple historical reference functional modules as the similarity of the data fields to be analyzed based on the number of historical data field similarities selected can be found in the description of the steps in the embodiments of the present invention for selecting the minimum similarity of multiple historical call methods from multiple historical call method similarities from multiple historical reference functional modules as the similarity of the call methods to be analyzed, which will not be repeated here.

[0357] For example, the specific principle of using the largest similarity of the data field to be analyzed as the predicted value of the field similarity can be found in the description of the step of using the largest similarity of the calling method to be analyzed as the predicted value of the method similarity in the embodiments of the present invention, which will not be repeated here.

[0358] The range of the predicted field similarity value can be, but is not limited to, [0, 1].

[0359] By following the steps above, the predicted field similarity value can be made to match the upper limit of the overall situation in the historical data field similarity. This allows the predicted field similarity value to not only conform to the overall field similarity situation, but also to have a certain preventive effect (which can be simply understood as predicting the data field similarity with the worst-case scenario, so as to detect the trend of duplicate target functional modules earlier in the development process and correct it in time). This improves the accuracy of subsequent determination of data field similarity, thereby improving the accuracy of overall duplicate application functional module detection.

[0360] In an optional implementation, determining whether the target functional module and the corresponding reference functional module are duplicated based on overall similarity includes:

[0361] Determine whether the overall similarity is greater than a preset similarity threshold. If so, issue an alarm to the staff.

[0362] For example, the similarity threshold can be determined by those skilled in the art based on actual circumstances, and the embodiments of the present invention do not impose any limitations on it. For example, the similarity threshold can be, but is not limited to, 7.6, 8.55, 3.2, or 3.6.

[0363] Preferably, the similarity threshold can be obtained by, but is not limited to, the following methods:

[0364] Multiple sample modules were selected from the historical functional modules, and the pairs of sample modules that were repeated in these sample modules were identified manually.

[0365] The principle of steps S101 to S105 is used to determine the sample similarity corresponding to each sample module group (a sample module group includes two sample modules that are repeated with each other) (one sample module group corresponds to one sample similarity), and the average, median or minimum value of multiple sample similarities is used as the similarity threshold.

[0366] By using the above steps, we can further use the similarity threshold of the boundary between overlapping and non-overlapping modules as the criterion for judgment. This helps to more clearly and explicitly determine whether the target functional module is duplicated with the corresponding reference functional module, thereby improving the overall accuracy of duplicate application functional module detection.

[0367] Based on the same principle, this invention discloses a device 600 for detecting repeatedly used functional modules, such as... Figure 6 As shown, the reusable application function module detection device 600 includes:

[0368] The development document similarity determination module 601 is used to obtain the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules.

[0369] The test case similarity determination module 602 is used to obtain the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

[0370] The method similarity determination module 603 determines the method similarity between the target functional module and the reference functional modules based on the target method of the target functional module and the reference method of the multiple reference functional modules.

[0371] The data field similarity determination module 604 obtains the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules.

[0372] The detection and alarm module 605 is used to obtain the overall similarity between the target functional module and the corresponding reference functional module based on the similarity of the development documents, test cases, calling methods, and data fields, and to determine whether the target functional module and the corresponding reference functional module are duplicated based on the overall similarity. If so, an alarm is issued to the staff.

[0373] In an optional implementation, a reference function module selection module is further included, for:

[0374] Before determining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, the functional module that was previously identified as duplicated with the target functional module is selected from multiple historical reference functional modules as the reference functional module.

[0375] In an optional implementation, the development document similarity determination module 601 is used to:

[0376] Based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document, the vocabulary intersection and vocabulary complement are obtained;

[0377] Based on the number of words in the complement set, the document similarity correction coefficient is obtained.

[0378] Based on the number of intersecting words in the word intersection and the number of target words in the target word set, an initial document similarity is obtained, and based on the initial document similarity and the document similarity correction coefficient, the corresponding development document similarity is obtained.

[0379] In an optional implementation, the development document similarity determination module 601 is used to:

[0380] Based on the target vocabulary set and the reference vocabulary set, multiple similar vocabulary subsets are obtained, wherein the vocabulary in the similar vocabulary subsets are different from each other and are synonyms or near-synonyms.

[0381] Select a first representative word from each of the similar word subsets, and take multiple overlapping words that are included in both the target word set and the reference word set as multiple second representative words;

[0382] Based on multiple first representative words and second representative words, the word intersection is obtained, and based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words, the word complement is obtained.

[0383] In an optional implementation, a first alternative development document similarity determination module is further included, for:

[0384] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is consistent with the target development document at the time of the last detection.

[0385] If so, the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the development document similarity between the target functional module and the corresponding reference functional module.

[0386] In an optional implementation, a second alternative development document similarity determination module is further included, for:

[0387] Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is in the unwritten stage, the writing stage, or the completed writing stage.

[0388] If the document is in the unwritten stage, use 0 as the similarity score for the corresponding development document;

[0389] If it is in the writing stage, determine whether the target development document was in the writing stage during the last detection. If not, obtain the corresponding development document similarity based on the preset document similarity prediction value.

[0390] If the project is in the final writing stage, the similarity between the development documents of the target functional module and the reference development documents of multiple reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules.

[0391] In an optional implementation, a document similarity prediction value determination module is further included, for:

[0392] Before obtaining the corresponding document similarity based on the preset document similarity prediction value,

[0393] The number of historical development documents selected is obtained based on the preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules.

[0394] Based on the number of historical development document similarities selected, the smallest number of historical development document similarities among multiple historical reference functional modules is selected as the development document similarity to be analyzed.

[0395] The highest similarity score of the document to be analyzed is used as the predicted document similarity value.

[0396] In an optional implementation, the test case similarity determination module 602 is used to:

[0397] Based on each target test case of the target functional module, multiple target test case parameters corresponding to the target test case are obtained; and based on multiple reference test cases of the reference functional module, multiple reference test case parameters corresponding to the reference test case are obtained.

[0398] Based on the reference case parameters and the target case parameters, the proportion of overlapping case parameters that are included in both the reference case parameters and the target case parameters is determined, wherein the proportion of overlapping case parameters is obtained based on the number of overlapping case parameters and the number of target case parameters or the number of reference case parameters.

[0399] The target test cases whose overlap ratio is greater than or equal to a preset overlap ratio threshold are taken as the corresponding case intersection elements to obtain the test case intersection, and the other target test cases other than the case intersection elements are taken as the corresponding case complement elements to obtain the test case complement.

[0400] Based on the number of complement cases in the test case complement set, the case similarity correction coefficient is obtained;

[0401] An initial case similarity is obtained based on the number of intersection cases of the test cases and the number of target cases of the target test case. The corresponding test case similarity is then obtained based on the initial case similarity and the case similarity correction coefficient.

[0402] In an optional implementation, it further includes a first alternative test case similarity determination module, used for:

[0403] Before obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, it is determined whether the target test case is consistent with the target test case in the previous detection.

[0404] If so, the test case similarity between the target functional module and the corresponding reference functional module determined in the previous test shall be used as the test case similarity between the target functional module and the corresponding reference functional module.

[0405] In an optional implementation, a second alternative test case similarity determination module is further included, for:

[0406] Before determining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules, it is determined whether the target test case is in the unwritten stage, the writing stage, or the completed writing stage.

[0407] If the test case is in the unwritten stage, 0 will be used as the similarity score.

[0408] If it is in the writing stage, determine whether the target test case was in the writing stage during the last detection. If not, obtain the corresponding test case similarity based on the preset case similarity prediction value.

[0409] If the project is in the completion stage, the test case similarity between the target functional module and the reference functional modules is obtained based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

[0410] In an optional implementation, a case similarity prediction value determination module is further included, for:

[0411] Before obtaining the corresponding test case similarity based on the preset case similarity prediction value,

[0412] The number of historical test case similarities is obtained based on the preset case similarity selection ratio and the number of historical test case similarities between multiple historical reference functional modules.

[0413] Based on the number of historical test case similarities selected, the smallest number of historical test case similarities among multiple historical reference functional modules is selected as the test case similarity to be analyzed.

[0414] The highest similarity among the test cases to be analyzed is used as the predicted similarity value.

[0415] In an optional implementation, the method similarity determination module 603 is used to:

[0416] Based on each target invocation method of the target functional module, the target name information corresponding to the target invocation method is obtained, and based on multiple reference invocation methods of the reference functional module, the reference name information corresponding to the reference invocation method is obtained. The target name information includes the method name, class name, and input parameter name corresponding to the target invocation method, and the reference name information includes the method name, class name, and input parameter name corresponding to the reference invocation method.

[0417] The target calling methods corresponding to the target name information included in the reference name information are taken as the corresponding method intersection elements to obtain the calling method intersection, and the other target calling methods other than the method intersection elements are taken as the corresponding method complement elements to obtain the calling method complement.

[0418] Based on the number of complement methods in the complement set of the called methods, the method similarity correction coefficient is obtained;

[0419] An initial method similarity is obtained based on the number of intersection methods of the intersection of the calling methods and the number of target methods of the target calling method. The corresponding calling method similarity is then obtained based on the initial method similarity and the method similarity correction coefficient.

[0420] In an optional implementation, it further includes a first alternative invocation method similarity determination module, used for:

[0421] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is consistent with the target calling method in the previous detection.

[0422] If so, the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the similarity of the calling methods between the target functional module and the corresponding reference functional module.

[0423] In an optional implementation, a second alternative invocation method similarity determination module is further included, for:

[0424] Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is in the unwritten stage, the writing stage, or the completed writing stage.

[0425] If the code is not yet written, use 0 as the similarity score of the corresponding calling method.

[0426] If it is in the writing stage, determine whether the target calling method was in the writing stage during the last detection. If not, obtain the corresponding calling method similarity based on the preset method similarity prediction value.

[0427] If the project is in the completion stage, the similarity of the calling methods between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules.

[0428] In an optional implementation, a method similarity prediction value determination module is further included, for:

[0429] Before obtaining the corresponding method similarity based on the preset method similarity prediction value...

[0430] The number of historical call method similarities is obtained based on the preset method similarity selection ratio and the number of historical call method similarities among multiple historical reference functional modules;

[0431] Based on the number of historical call method similarities selected, the smallest number of historical call method similarities among multiple historical call method similarities between multiple historical reference functional modules is selected as the call method similarity to be analyzed.

[0432] The highest similarity between the methods to be analyzed is used as the predicted similarity value.

[0433] In an optional implementation, the data field similarity determination module 604 is used to:

[0434] Based on the target field set corresponding to the target data field and the reference field set corresponding to the reference data field, the field intersection and field complement are obtained;

[0435] Based on the number of complement fields in the complement set, the field similarity correction coefficient is obtained;

[0436] An initial field similarity is obtained based on the number of intersection fields of the field intersection and the number of target fields of the target field set. The corresponding data field similarity is then obtained based on the initial field similarity and the field similarity correction coefficient.

[0437] In an optional implementation, it further includes a first candidate data field similarity determination module, used for:

[0438] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of multiple reference functional modules, it is determined whether the target data field is consistent with the target data field in the previous detection.

[0439] If so, the data field similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the data field similarity between the target functional module and the corresponding reference functional module.

[0440] In an optional implementation, a second alternative data field similarity determination module is further included, for:

[0441] Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules, it is determined whether the target data field is in the unconfigured stage, the configuration stage, or the configuration completed stage.

[0442] If it is in the unconfigured stage, 0 will be used as the similarity of the corresponding data field;

[0443] If it is in the configuration phase, determine whether the target data field was in the configuration phase during the last detection. If not, obtain the corresponding data field similarity based on the preset field similarity prediction value.

[0444] If the project is in the completion stage, the similarity of data fields between the target functional module and the reference functional modules is obtained based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules.

[0445] In an optional implementation, a field similarity prediction value determination module is further included, for:

[0446] Before obtaining the corresponding data field similarity based on the preset field similarity prediction value,

[0447] The number of historical data field similarities is obtained based on the preset field similarity selection ratio and the number of historical data field similarities between multiple historical reference functional modules.

[0448] Based on the number of historical data field similarities selected, the lowest number of historical data field similarities among multiple historical data field similarities between multiple historical reference functional modules is selected as the similarity of the data field to be analyzed.

[0449] The highest similarity among the fields of the data to be analyzed is used as the predicted field similarity value.

[0450] In an optional implementation, the detection alarm module 605 is used to:

[0451] Determine whether the overall similarity is greater than a preset similarity threshold. If so, issue an alarm to the staff.

[0452] Since the principle of the repeated application function module detection device 600 in solving the problem is similar to the above method, the implementation of this repeated application function module detection device 600 can refer to the implementation of the above method, and will not be repeated here.

[0453] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, specifically, a computer device can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0454] In a typical example, a computer device specifically includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method described above.

[0455] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer device 700 suitable for implementing the embodiments of this application.

[0456] like Figure 7As shown, the computer device 700 includes a central processing unit (CPU) 701, which can perform various appropriate tasks and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0457] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal feedback (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed in the storage section 708 as needed.

[0458] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711.

[0459] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0460] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0461] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0462] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0463] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0464] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0465] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0466] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0467] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0468] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for detecting the repeated application of functional modules, characterized in that, include: Select the function module that is duplicated with the target function module from multiple historical reference function modules as the reference function module; Determine whether the target development document is in the unwritten stage, the writing stage, or the completed stage; If the document is in the unwritten stage, use 0 as the similarity score for the corresponding development document; If it is in the writing stage, determine whether the target development document was in the writing stage during the last detection. If not, obtain the corresponding development document similarity based on the preset document similarity prediction value. If the project is in the completion stage, the similarity between the development documents of the target functional module and the reference development documents of multiple reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules. Based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, the test case similarity between the target functional module and the reference functional modules is obtained; Based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, the similarity of the calling methods between the target functional module and the reference functional modules is obtained; Based on the target data fields of the target functional module and the reference data fields of multiple reference functional modules, the data field similarity between the target functional module and the reference functional modules is obtained; wherein, the target data fields include data fields involved in the code of the target functional module or data fields involved in the database data tables on which the target functional module depends, and the reference data fields include data fields involved in the code of the reference functional modules or data fields involved in the database data tables on which the reference functional modules depend; Based on the similarity of development documents, test cases, calling methods, and data fields, the overall similarity between the target functional module and the corresponding reference functional module is obtained. Based on the overall similarity, it is determined whether the target functional module and the corresponding reference functional module are duplicated. If so, an alarm is issued to the staff.

2. The method according to claim 1, characterized in that, The step of obtaining the development document similarity between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules includes: Based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document, the vocabulary intersection and vocabulary complement are obtained; Based on the number of words in the complement set, the document similarity correction coefficient is obtained. Based on the number of intersecting words in the word intersection and the number of target words in the target word set, an initial document similarity is obtained, and based on the initial document similarity and the document similarity correction coefficient, the corresponding development document similarity is obtained.

3. The method according to claim 2, characterized in that, The step of obtaining the vocabulary intersection and vocabulary complement based on the target vocabulary set corresponding to the target development document and the reference vocabulary set corresponding to the reference development document includes: Based on the target vocabulary set and the reference vocabulary set, multiple similar vocabulary subsets are obtained, wherein the vocabulary in the similar vocabulary subsets are different from each other and are synonyms or near-synonyms. Select a first representative word from each of the similar word subsets, and take multiple overlapping words that are included in both the target word set and the reference word set as multiple second representative words; Based on multiple first representative words and second representative words, the word intersection is obtained, and based on other target words in the target word set besides those included in multiple similar word subsets and multiple second representative words, the word complement is obtained.

4. The method according to claim 1, characterized in that, Further includes: Before determining the similarity of development documents between the target functional module and the reference functional modules based on the target development document of the target functional module and the reference development documents of multiple reference functional modules, it is determined whether the target development document is consistent with the target development document at the time of the last detection. If so, the development document similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the development document similarity between the target functional module and the corresponding reference functional module.

5. The method according to claim 1, characterized in that, Further includes: Before obtaining the corresponding document similarity based on the preset document similarity prediction value, The number of historical development documents selected is obtained based on the preset document similarity selection ratio and the number of similarities between historical development documents of multiple historical reference functional modules. Based on the number of historical development document similarities selected, the lowest number of historical development document similarities among multiple historical reference functional modules is selected as the development document similarity to be analyzed. The highest similarity score of the document to be analyzed is used as the predicted document similarity value.

6. The method according to claim 1, characterized in that, The step of obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules includes: Based on each target test case of the target functional module, multiple target test case parameters corresponding to the target test case are obtained, and based on multiple reference test cases of the reference functional module, multiple reference test case parameters corresponding to the reference test case are obtained; Based on the reference case parameters and the target case parameters, the proportion of overlapping case parameters that are included in both the reference case parameters and the target case parameters is determined, wherein the proportion of overlapping case parameters is obtained based on the number of overlapping case parameters and the number of target case parameters or the number of reference case parameters. The target test cases whose overlap ratio is greater than or equal to a preset overlap ratio threshold are taken as the corresponding case intersection elements to obtain the test case intersection, and the other target test cases other than the case intersection elements are taken as the corresponding case complement elements to obtain the test case complement. Based on the number of complement cases in the test case complement set, the case similarity correction coefficient is obtained; An initial case similarity is obtained based on the number of intersection cases of the test cases and the number of target cases of the target test case. The corresponding test case similarity is then obtained based on the initial case similarity and the case similarity correction coefficient.

7. The method according to claim 1, characterized in that, Further includes: Before obtaining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of multiple reference functional modules, it is determined whether the target test case is consistent with the target test case in the previous detection. If so, the test case similarity between the target functional module and the corresponding reference functional module determined in the previous test shall be used as the test case similarity between the target functional module and the corresponding reference functional module.

8. The method according to claim 1, characterized in that, Further includes: Before determining the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules, it is determined whether the target test case is in the unwritten stage, the writing stage, or the completed writing stage. If the test case is in the unwritten stage, 0 will be used as the similarity score. If it is in the writing stage, determine whether the target test case was in the writing stage during the last detection. If not, obtain the corresponding test case similarity based on the preset case similarity prediction value. If the project is in the completion stage, the test case similarity between the target functional module and the reference functional modules is obtained based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules.

9. The method according to claim 8, characterized in that, Further includes: Before obtaining the corresponding test case similarity based on the preset case similarity prediction value, The number of historical test case similarities is obtained based on the preset case similarity selection ratio and the number of historical test case similarities between multiple historical reference functional modules. Based on the number of historical test case similarities selected, the smallest number of historical test case similarities among multiple historical reference functional modules is selected as the test case similarity to be analyzed. The highest similarity among the test cases to be analyzed is used as the predicted similarity value.

10. The method according to claim 1, characterized in that, The step of obtaining the similarity of calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules includes: Based on each target invocation method of the target functional module, the target name information corresponding to the target invocation method is obtained, and based on multiple reference invocation methods of the reference functional module, the reference name information corresponding to the reference invocation method is obtained. The target name information includes the method name, class name, and input parameter name corresponding to the target invocation method, and the reference name information includes the method name, class name, and input parameter name corresponding to the reference invocation method. The target calling methods corresponding to the target name information included in the reference name information are taken as the corresponding method intersection elements to obtain the calling method intersection, and the other target calling methods other than the method intersection elements are taken as the corresponding method complement elements to obtain the calling method complement. Based on the number of complement methods in the complement set of the called methods, the method similarity correction coefficient is obtained; An initial method similarity is obtained based on the number of intersection methods of the intersection of the calling methods and the number of target methods of the target calling method. The corresponding calling method similarity is then obtained based on the initial method similarity and the method similarity correction coefficient.

11. The method according to claim 1, characterized in that, Further includes: Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is consistent with the target calling method in the previous detection. If so, the similarity of the calling methods between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the similarity of the calling methods between the target functional module and the corresponding reference functional module.

12. The method according to claim 1, characterized in that, Further includes: Before obtaining the similarity of the calling methods between the target functional module and the reference functional modules based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules, it is determined whether the target calling method is in the unwritten stage, the writing stage, or the completed writing stage. If the code is not yet written, use 0 as the similarity score of the corresponding calling method. If it is in the writing stage, determine whether the target calling method was in the writing stage during the last detection. If not, obtain the corresponding calling method similarity based on the preset method similarity prediction value. If the project is in the completion stage, the similarity of the calling methods between the target functional module and the reference functional modules is obtained based on the target calling method of the target functional module and the reference calling methods of the multiple reference functional modules.

13. The method according to claim 12, characterized in that, Further includes: Before obtaining the corresponding method similarity based on the preset method similarity prediction value... The number of historical call method similarities is obtained based on the preset method similarity selection ratio and the number of historical call method similarities among multiple historical reference functional modules; Based on the number of historical call method similarities selected, the smallest number of historical call method similarities among multiple historical call method similarities between multiple historical reference functional modules is selected as the call method similarity to be analyzed. The highest similarity between the methods to be analyzed is used as the predicted similarity value.

14. The method according to claim 1, characterized in that, The step of obtaining the data field similarity between the target functional module and the reference functional modules based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules includes: Based on the target field set corresponding to the target data field and the reference field set corresponding to the reference data field, the field intersection and field complement are obtained; Based on the number of complement fields in the complement set, the field similarity correction coefficient is obtained; An initial field similarity is obtained based on the number of intersection fields of the field intersection and the number of target fields of the target field set. The corresponding data field similarity is then obtained based on the initial field similarity and the field similarity correction coefficient.

15. The method according to claim 1, characterized in that, Further includes: Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of multiple reference functional modules, it is determined whether the target data field is consistent with the target data field in the previous detection. If so, the data field similarity between the target functional module and the corresponding reference functional module determined in the previous detection shall be used as the data field similarity between the target functional module and the corresponding reference functional module.

16. The method according to claim 1, characterized in that, Further includes: Before obtaining the data field similarity between the target functional module and the reference functional modules based on the target data field of the target functional module and the reference data fields of the multiple reference functional modules, it is determined whether the target data field is in the unconfigured stage, the configuration stage, or the configuration completed stage. If it is in the unconfigured stage, 0 will be used as the similarity of the corresponding data field; If it is in the configuration phase, determine whether the target data field was in the configuration phase during the last detection. If not, obtain the corresponding data field similarity based on the preset field similarity prediction value. If the project is in the completion stage, the similarity of data fields between the target functional module and the reference functional modules is obtained based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules.

17. The method according to claim 16, characterized in that, Further includes: Before obtaining the corresponding data field similarity based on the preset field similarity prediction value, The number of historical data field similarities is obtained based on the preset field similarity selection ratio and the number of historical data field similarities between multiple historical reference functional modules. Based on the number of historical data field similarities selected, the lowest number of historical data field similarities among multiple historical data field similarities between multiple historical reference functional modules is selected as the similarity of the data field to be analyzed. The highest similarity among the fields of the data to be analyzed is used as the predicted field similarity value.

18. The method according to claim 1, characterized in that, The step of determining whether the target functional module and the corresponding reference functional module are duplicates based on overall similarity includes: Determine whether the overall similarity is greater than a preset similarity threshold. If so, issue an alarm to the staff.

19. A device for detecting reusable functional modules, characterized in that, include: The reference function module selection module is used to select, from multiple historical reference function modules, the function module that is duplicated with the target function module as the reference function module in the previous detection; The document similarity determination module is used to determine whether the target document is in the unwritten stage, the writing stage, or the completed stage. If the document is in the unwritten stage, use 0 as the similarity score for the corresponding development document; If it is in the writing stage, determine whether the target development document was in the writing stage during the last detection. If not, obtain the corresponding development document similarity based on the preset document similarity prediction value. If the project is in the completion stage, the similarity between the development documents of the target functional module and the reference development documents of multiple reference functional modules is obtained based on the target development document of the target functional module and the reference development documents of multiple reference functional modules. The test case similarity determination module is used to obtain the test case similarity between the target functional module and the reference functional modules based on the target test cases of the target functional module and the reference test cases of the multiple reference functional modules. The method call similarity determination module determines the method call similarity between the target functional module and the reference functional modules based on the target method call of the target functional module and the reference method call of the multiple reference functional modules. The data field similarity determination module determines the data field similarity between the target functional module and the reference functional modules based on the target data fields of the target functional module and the reference data fields of the multiple reference functional modules. The target data fields include data fields involved in the code of the target functional module or data fields involved in the database tables on which the target functional module depends. The reference data fields include data fields involved in the code of the reference functional modules or data fields involved in the database tables on which the reference functional modules depend. The detection and alarm module is used to obtain the overall similarity between the target functional module and the corresponding reference functional module based on the similarity of the development documents, test cases, calling methods, and data fields, and to determine whether the target functional module and the corresponding reference functional module are duplicated based on the overall similarity. If so, an alarm is issued to the staff.

20. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-18.

21. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-18.

Citation Information

Patent Citations

  • Test program plagiarism detection method based on test code fragment similarity

    CN110543331A

  • Method and device for determining project function similarity

    CN110888920A

  • Method and device for detecting application programming interface

    CN111459789A

  • Text similarity determination method and device

    CN113312475A