CN117033235A - Method, device, equipment and storage medium for testing relevance of software program - Google Patents

Method, device, equipment and storage medium for testing relevance of software program Download PDF

Info

Publication number
CN117033235A
CN117033235A CN202311080574.XA CN202311080574A CN117033235A CN 117033235 A CN117033235 A CN 117033235A CN 202311080574 A CN202311080574 A CN 202311080574A CN 117033235 A CN117033235 A CN 117033235A
Authority
CN
China
Prior art keywords
software
calling
tested
function
relevance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311080574.XA
Other languages
Chinese (zh)
Inventor
陈庆峰
虞旭波
冯涛
周晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Tongshang Bank Co ltd
Original Assignee
Ningbo Tongshang Bank Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Tongshang Bank Co ltd filed Critical Ningbo Tongshang Bank Co ltd
Priority to CN202311080574.XA priority Critical patent/CN117033235A/en
Publication of CN117033235A publication Critical patent/CN117033235A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method, a device, equipment and a storage medium for testing relevance of software programs, wherein the method comprises the following steps: acquiring a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality of; extracting information from file information in a source file of the software service to be detected to obtain method function association information associated with the software service to be detected, and generating a reference method node call link of the software service to be detected according to the method function association information; according to the reference method node call links of the software services to be tested, generating target method node call links among the software services to be tested; the target method node calls a first method call relation between the function methods in the link; and determining the relevance among the function methods according to the calling relation of the first method so as to evaluate and test the relevance of the software program of the software system to be evaluated. According to the technical scheme, accuracy and test efficiency of the relevance test of the software program are improved.

Description

Method, device, equipment and storage medium for testing relevance of software program
Technical Field
The present invention relates to the field of computer program analysis technologies, and in particular, to a method, an apparatus, a device, and a storage medium for testing relevance of a software program.
Background
The relevance of the software program exists among various modules of the software, so that when software maintenance is carried out, error modules are modified, new modules are added and useless modules are deleted, unsuitable errors or potential errors are generated in the changing process, and the key problem of the software test and maintenance is how to accurately evaluate the influence brought by the software maintenance activity.
However, at present, software program relevance analysis and testing are often performed by a manual method, and a great deal of time and manpower are consumed for manually writing and executing test cases. Furthermore, manual analysis is limited to personal experience and knowledge levels and is prone to omission or error resulting in inadequate or inaccurate correlation analysis.
Disclosure of Invention
The invention provides a method, a device, equipment and a medium for testing the relevance of a software program, which are used for improving the accuracy and the test efficiency of the relevance test of the software program.
According to an aspect of the present invention, there is provided a software program relevance testing method, the method comprising:
acquiring a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality of;
extracting information from file information in a source file of the software service to be detected to obtain method function association information associated with the software service to be detected, and generating a reference method node call link of the software service to be detected according to the method function association information;
generating a target method node calling link between the software services to be tested according to the reference method node calling link of the software services to be tested; the target method node call link comprises a second method call relation between function methods;
and determining the relevance among the function methods according to the second method call relation so as to evaluate and test the software program relevance of the software system to be evaluated.
According to another aspect of the present invention, there is provided a software program relevance test apparatus including:
the software service acquisition module is used for acquiring the software service to be tested in the software system to be evaluated; the number of the software services to be tested is a plurality of;
the calling link generation module is used for extracting information from file information in a source file of the software service to be tested to obtain method function association information associated with the software service to be tested, and generating a reference method node calling link of the software service to be tested according to the method function association information;
the target link generation module is used for generating target method node calling links among the software services to be tested according to the reference method node calling links of the software services to be tested; the target method node call link comprises a second method call relation between function methods;
and the relevance testing module is used for determining relevance among the function methods according to the second method call relation so as to evaluate and test the relevance of the software program of the software system to be evaluated.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform any one of the software program relevance test methods described in the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute any one of the software program relevance test methods according to the embodiments of the present invention.
According to the technical scheme, a reference method node calling link between function methods is generated through method function association information, and a target method node calling link between software services to be tested is generated according to the reference method node calling link; and calling the calling relation among the function methods in the link through the target method node, and determining the relevance among the function methods. The method comprises the steps of firstly determining the calling relation of each function method of one software service in the software services to be tested, then determining the calling relation among the software services in the software services to be tested, and determining the relevance among the function methods according to the calling relation. According to the technical scheme, human resource intervention is reduced, automatic testing of software program relevance is completed, and testing accuracy and testing efficiency are improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a software program relevance test method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a software program relevance test method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a software program relevance test device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a software program relevance test method according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a software program relevance testing method according to an embodiment of the present invention, where the method may be applied to automatically identifying and analyzing relevance between software programs and maintaining the software programs, and the method may be performed by a software program relevance testing apparatus, and the software program relevance testing apparatus may be implemented in the form of hardware and/or software, and the software program relevance testing apparatus may be configured in an electronic device, for example, in a server.
As shown in fig. 1, the software program relevance testing method specifically includes the following steps:
s110, acquiring a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality.
The software system to be evaluated can be a software system with relevance test requirements, and optionally, the software system can be composed of at least one of a plurality of services, modules, components, functional methods and the like. It should be noted that a software program may be composed of a plurality of services, and a service may be specifically referred to as a micro-service, that is, a software program may be composed of a plurality of micro-services. The software service to be tested may refer to a functional service of the software to be subjected to the relevance test. The software service to be tested is obtained from the software system to be evaluated, and a plurality of software services to be tested can exist in the software system to be tested, and each software service to be tested has relevance, and particularly can have a function or method calling relation.
S120, extracting information from file information in a source file of the software service to be tested to obtain method function association information associated with the software service to be tested, and generating a reference method node call link of the software service to be tested according to the method function association information.
The source file refers to a code file written in a program language, and the source file may include at least one of a header file, a dependency library, other components, and the like. The method function association information may be service information for performing association test in the software service to be tested, for example, call node information and call relation information, where the call node information may include at least one of a service, a method parameter, a method annotation, and the like, and the call relation information may include at least one of a method function, a source code line number, an influence factor, and the like.
The reference method node call link is used for representing the association relation between nodes of the software method function to be tested, for example, the association relation can be a call relation between nodes and a called relation, and the reference method node call link comprises a call relation between nodes. The node may be a function method node, a method function may represent a node, and the call relationship between the nodes may be a call relationship between the method functions.
Illustratively, compiling and analyzing the source file in the software service to be tested through a code analysis tool, extracting file information in the source file, and obtaining method function association information associated with the software service to be tested. And generating a reference method node call link through the method function association information.
In an alternative embodiment, extracting information from file information in a source file of a software service to be tested to obtain method function association information associated with the software service to be tested, and generating a reference method node call link of the software service to be tested according to the method function association information, including: acquiring an intermediate file of a source file of a software service to be tested; generating a second method call relation between the objective function methods associated with the software service to be tested according to the abstract syntax tree in the intermediate file; and generating a reference method node call link of the software service to be tested according to the second method call relation.
The intermediate file refers to an intermediate code file generated when compiling the source file. The grammar abstract tree refers to system data of an intermediate file, and represents an abstract grammar structure of source codes through a tree diagram. The objective function method refers to an associated function method to be subjected to the relevance test. The second method call relationship refers to a call relationship or a called relationship between target method functions in the software service to be tested, namely a call and called relationship between nodes.
Illustratively, the source file may be compiled by a compiler to obtain an intermediate file; and carrying out batch analysis on the abstract syntax tree in the intermediate file to obtain a second method call relation between the target function methods associated with the software service to be tested, and generating a complete call link taking the function method as a node according to the second method call relation and combining the nodes of the method functions.
Optionally, the generation mode of the reference method node call link may be: extracting method function information associated with an objective function method from the intermediate file; generating method call information according to the method call relation and the method function information; and generating a reference method node call link of the software service to be tested by adopting the method function information, the method call information and the method call relation.
The method function information refers to node information distributed on the function method, and can comprise at least one of function method names, service names, function method parameters, function method notes and the like.
Illustratively, method function information associated with the target function method is extracted from the intermediate file, and method call information, e.g., a first method function call second method function in the method function information, is generated from the method call relationship and the method function information. The method function information, the method call information and the method call relation form a reference method node call link of the software service to be tested together.
It should be noted that, the method for generating the call information may be: determining the method name of a calling method and the method name of a called method according to the method calling relation; determining a code position of program codes for calling the method in the source file; determining an influence factor between a calling method and a called method; and generating the method calling information according to the method name of the calling method, the method name of the called method, the code position and the influence factor.
The code location refers to the number of lines of code in the source file where the program code of the calling method is located, for example, the 100 th-200 th line of the source file where the program code of the calling method is located, and the code location of the calling method is located in the 100 th-200 th line of the source file. The impact factor is used to characterize the degree of association between the calling method and the called method. The method comprises the steps of presetting a first method function, a second method function and other method functions except the first method function and the second method function in software services to be tested, wherein an influence factor can be determined by the ratio of the times of calling the second method function by the first method function to the times of calling the other method functions by the first method function.
Illustratively, according to the calling relation, determining the names of calling methods at two ends of the calling relation, namely the names of the methods of the calling methods and the names of the methods of the called methods; determining a code position of program codes for calling the method in the source file; determining an influence factor between a calling method and a called method; and generating the method calling information according to the method name of the calling method, the method name of the called method, the code position and the influence factor.
In an alternative embodiment, the manner of determining the impact factor between the calling method and the called method may be: determining a first calling number of times that the calling method calls other methods; the other calling methods are function methods except the calling method and the called method in the target function method; determining a second calling number of times that the calling method calls the called method; and determining an influence factor between the calling method and the called method according to the first calling times and the second calling times.
By way of example, determining the first number of times the calling method calls other methods, determining the second number of times the calling method calls the called method, and determining an influence factor between the calling method and the called method according to the ratio of the first number of times to the second number of times. Specifically, the objective function method includes a first method function, a second method function and other method functions except the first method function and the second method function, the first calling number of times of the first method function for calling the other method functions is 20 times, the second calling number of times of the first method function for calling the second method function is 5 times, and the influence factor can be 5/20 and is 0.25.
S130, generating a target method node calling link between the software services to be tested according to the reference method node calling link of the software services to be tested; the target method node calls a first method call relationship between the link including the function methods.
The target method node call link refers to a call link between the software service to be tested and other software services, and the other software services can be software services except the software service to be tested in the software system to be evaluated. The first method call relationship refers to call relationship among function methods in the service software to be tested.
Illustratively, the reference method node call links of all software services in the software system to be tested are tracked, call information of the method functions in the software to be tested is recorded, trace ID (Trace Identity, globally unique identifier in the distributed system) information of the reference method node call links can be recorded through an MDC (Mapped Diagnostic Context) mechanism, and complete link recording of cross-software service call is completed. It is understood that a reference method node link may be represented by an ID.
And S140, determining the relevance among the function methods according to the calling relation of the first method so as to evaluate and test the relevance of the software program of the software system to be evaluated.
Wherein, the relevance refers to the relevance degree among the method functions.
Illustratively, according to the calling relation of the first method, the relevance among the functions of the methods in the software service to be tested is obtained, and the calling relation, the calling times and the influence factors among the function methods are obtained through the relevance among the function methods, so that the relevance of the software program of the software system to be evaluated is evaluated and tested.
According to the technical scheme, a reference method node calling link between function methods is generated through method function association information, and a target method node calling link between software services to be tested is generated according to the reference method node calling link; and calling the calling relation among the function methods in the link through the target method node, and determining the relevance among the function methods. The method comprises the steps of firstly determining the calling relation of each function method of one software service in the software services to be tested, then determining the calling relation among the software services in the software services to be tested, and determining the relevance among the function methods according to the calling relation. According to the technical scheme, intervention of human resources is reduced, automatic analysis and testing of software program relevance are completed, and analysis testing accuracy and analysis testing efficiency are improved.
Example two
FIG. 2 is a flowchart of a software program relevance test method according to a second embodiment of the present invention, where the embodiment is further refined based on the foregoing embodiments, and specifically includes the steps of "determining relevance between function methods according to a first method call relationship" being refined to generate node relation graph structure data according to the first method call relationship; and determining the relevance among the function methods according to the node relation graph structure data, and further determining the relevance among the function methods through the graph structure data so as to perfect a relevance determining mechanism. In this embodiment, the steps are not described in detail, and reference may be made to other embodiments.
As shown in fig. 2, the method includes:
s210, acquiring a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality.
S220, extracting information from file information in a source file of the software service to be tested to obtain method function association information associated with the software service to be tested, and generating a reference method node call link of the software service to be tested according to the method function association information.
S230, generating a target method node calling link between the software services to be tested according to the reference method node calling link of the software services to be tested; the target method node calls a first method call relationship between the link including the function methods.
S240, invoking the relation according to the first method to generate node relation diagram structure data.
The node relation graph structure data refers to structural diagram data formed by graph nodes and node relations, and can represent calling relations among all method functions. The node relation diagram structure data consists of points and edges, wherein the point attribute is each node, and the edge attribute is the calling direction among the function methods.
Illustratively, the node relation graph structure data is generated according to the method function information, the method call information and the method call relation in the first call relation. The method functions are used as nodes of the node relation diagram structural data, the method calling information is used as node information, and the method calling relation is used as the node relation diagram structural data to connect the edges of two nodes.
It should be noted that the node relation graph structure data may be a knowledge graph. Specifically, the relevance test can be performed on the software program service by writing test cases. When executing the test cases, the user can perform case execution operation through the knowledge graph construction layer, and meanwhile, the user depends on the test tools, the test scripts and the test drivers to execute the test cases.
S250, determining the relevance among the function methods according to the node relation diagram structure data.
Illustratively, according to the node relation diagram structure data, the calling relation between each node and other nodes is obtained, and the relevance between the function methods is obtained by judging the relevance score between each node. Specifically, the higher the relevance score between the nodes, the stronger the relevance between the function methods.
Optionally, determining the relevance between the function methods according to the node relation graph structure data includes: and determining the relevance among the function methods based on the graph neural network GNN model according to the node relation graph structure data.
Among them, GNN (Graph Neural Networks, graph neural network) is a machine learning algorithm for processing graph structure data.
The graph neural network model analyzes the node relation graph structure data, performs feature learning on nodes and edges in the node relation graph structure data, maps the features of the nodes and the edges into a low-dimensional vector space, and deduces the relevance among the function methods based on the features of the nodes and the edges learned by the graph neural network. Specifically, the neural network may measure the relevance between the nodes by using evaluation indexes such as cosine similarity or dot product, so as to determine the relevance between the function methods. The interval range of the cosine similarity is [ -1,1], if the cosine similarity is [0,1], the correlation is represented between the function methods, and if the cosine similarity is [ -1,0], the correlation is represented between the function methods.
Alternatively, GNN may be used in combination with other algorithms such as rule-based methods, statistical analysis methods, to determine the relevance between functional methods.
It should be noted that, the process of intelligent decision analysis by using the technical means in this embodiment can be understood as an intelligent customer service system in a specific field, which constructs a large number of questions, answers, knowledge and solutions by combining the knowledge base of the knowledge graph construction layer and the GNN model of the model algorithm layer, and is used for answering the questions of the user, thereby providing assistance and solutions. User input may be understood and processed through natural language processing techniques and various user interfaces and channels may be provided to facilitate user interaction, which may be a chat window, voice assistant, mobile application, or web plug-in. At the same time, it can adjust the model and knowledge base by collecting user feedback information.
According to the technical scheme provided by the embodiment of the invention, the relevance among the nodes is determined through the node relation diagram structural data and the graph neural network. The graph neural network improves the comprehensiveness and accuracy of relevance analysis of each function method by carrying out feature learning on each node and each side of the node relation graph structural data.
Example III
Fig. 3 is a schematic structural diagram of a software program association test device according to a third embodiment of the present invention, where the present embodiment is applicable to situations where associations between software programs are automatically identified and analyzed and maintenance is performed on the software programs, the software program association test device may be implemented in the form of hardware and/or software, and the software program association test device may be configured in an electronic device, for example, a server.
As shown in fig. 3, the apparatus includes a software service acquisition module 310, a reference link generation module 320, a target link generation module 330, and a relevance test module 340. Wherein,
a software service acquisition module 310, configured to acquire a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality of;
the reference link generation module 320 is configured to extract information from file information in a source file of a software service to be tested, obtain method function association information associated with the software service to be tested, and generate a reference method node call link of the software service to be tested according to the method function association information;
the target link generation module 330 is configured to generate a target method node call link between each software service to be tested according to the reference method node call link of the software service to be tested; the target method node calls a first method call relation between the function methods in the link;
and the relevance testing module 340 is configured to determine relevance between the function methods according to the first method call relationship, so as to evaluate and test relevance of software programs of the software system to be evaluated.
According to the technical scheme, a reference method node calling link between function methods is generated through method function association information, and a target method node calling link between software services to be tested is generated according to the reference method node calling link; and calling the calling relation among the function methods in the link through the target method node, and determining the relevance among the function methods. The method comprises the steps of firstly determining the calling relation of each function method of one software service in the software services to be tested, then determining the calling relation among the software services in the software services to be tested, and determining the relevance among the function methods according to the calling relation. According to the technical scheme, human resource intervention is reduced, automatic testing of software program relevance is completed, and testing accuracy and testing efficiency are improved.
Optionally, the reference link generating module 320 includes:
the intermediate file acquisition sub-module is used for acquiring an intermediate file of a source file of the software service to be tested;
the first call generation sub-module is used for generating a first method call relation between objective function methods associated with the software service to be tested according to the abstract syntax tree in the intermediate file;
and the reference call generation sub-module is used for generating a reference method node call link of the software service to be tested according to the first method call relation.
Optionally, the reference call generation submodule includes:
a function information acquisition unit for extracting method function information associated with the objective function method from the intermediate file;
the call information generating unit is used for generating method call information according to the method call relation and the method function information;
and the reference link generation unit is used for generating a reference method node call link of the software service to be tested by adopting the method function information, the method call information and the method call relation.
Optionally, the call information generating unit includes:
a method name subunit, configured to determine, according to the method calling relationship, a method name of a calling method and a method name of a called method;
a code subunit for determining a code position of a program code of the calling method in the source file;
an influence factor subunit, configured to determine an influence factor between the calling method and the called method;
and the calling information subunit is used for generating the method calling information according to the method name of the calling method, the method name of the called method, the code position and the influence factor.
Optionally, the influencing factor subunit is specifically configured to:
determining a first calling number of times that the calling method calls other methods; the other calling methods are function methods except the calling method and the called method in the target function method;
determining a second calling number of times that the calling method calls the called method;
and determining an influence factor between the calling method and the called method according to the first calling times and the second calling times.
Optionally, the relevance test module 340 includes:
the node diagram generating sub-module is used for generating node relation diagram structural data according to the second method calling relation;
and the relevance determining submodule is used for determining relevance among the function methods according to the node relation diagram structural data.
Optionally, the relevance determining submodule is specifically configured to:
and determining the relevance among the function methods based on the graph neural network GNN model according to the node relation graph structure data.
The software program relevance testing device provided by the embodiment of the invention can execute the software program relevance testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the software program relevance testing methods.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device implementing a software program relevance test method according to a fourth embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM12 and the RAM13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a software program relevance test method.
In some embodiments, the software program relevance test method may be implemented as a computer program, which is tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM12 and/or the communication unit 19. When the computer program is loaded into RAM13 and executed by processor 11, one or more steps of the software program relevance test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the software program relevance test method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for testing the relevance of a software program, comprising:
acquiring a software service to be tested in a software system to be evaluated; the number of the software services to be tested is a plurality of;
extracting information from file information in a source file of the software service to be detected to obtain method function association information associated with the software service to be detected, and generating a reference method node call link of the software service to be detected according to the method function association information;
generating a target method node calling link between the software services to be tested according to the reference method node calling link of the software services to be tested; the target method node call link comprises a first method call relation between function methods;
and determining the relevance among the function methods according to the first method call relation so as to evaluate and test the software program relevance of the software system to be evaluated.
2. The method according to claim 1, wherein the extracting the file information in the source file of the software service to be tested to obtain the method function association information associated with the software service to be tested, and generating the reference method node call link of the software service to be tested according to the method function association information, includes:
acquiring an intermediate file of a source file of the software service to be tested;
generating a second method call relation between the objective function methods associated with the software service to be tested according to the abstract syntax tree in the intermediate file;
and generating a reference method node call link of the software service to be tested according to the second method call relation.
3. The method according to claim 2, wherein generating the reference method node call link of the software service under test according to the first method call relationship comprises:
extracting method function information associated with the objective function method from the intermediate file;
generating method call information according to the method call relation and the method function information;
and generating a reference method node call link of the software service to be tested by adopting the method function information, the method call information and the method call relation.
4. A method according to claim 3, wherein said generating method call information from said method call relationship and said method function information comprises:
determining the method name of the calling method and the method name of the called method according to the method calling relation;
determining a code location of program code of the calling method in the source file;
determining an influence factor between the calling method and the called method;
and generating method calling information according to the method name of the calling method, the method name of the called method, the code position and the influence factor.
5. The method of claim 4, wherein the determining an impact factor between the calling method and the called method comprises:
determining a first calling number of times that the calling method calls other methods; the other calling methods are function methods except the calling method and the called method in the target function method;
determining a second calling number of times that the calling method calls the called method;
and determining an influence factor between the calling method and the called method according to the first calling times and the second calling times.
6. The method of claim 1, wherein determining the association between the function methods according to the first method call relationship comprises:
generating node relation diagram structure data according to the first method call relation;
and determining the relevance among the function methods according to the node relation diagram structure data.
7. The method of claim 6, wherein said determining the relevance between the functional methods from the node relationship graph structure data comprises:
and determining the relevance among the function methods based on a graph neural network GNN model according to the node relation graph structure data.
8. A software program relevance test apparatus, comprising:
the software service acquisition module is used for acquiring the software service to be tested in the software system to be evaluated; the number of the software services to be tested is a plurality of;
the calling link generation module is used for extracting information from file information in a source file of the software service to be tested to obtain method function association information associated with the software service to be tested, and generating a reference method node calling link of the software service to be tested according to the method function association information;
the target link generation module is used for generating target method node calling links among the software services to be tested according to the reference method node calling links of the software services to be tested; the target method node call link comprises a first method call relation between function methods;
and the relevance testing module is used for determining relevance among the function methods according to the first method calling relation so as to evaluate and test the relevance of the software program of the software system to be evaluated.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the software program relevance test method of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the software program relevance test method according to any one of claims 1-7 when executed.
CN202311080574.XA 2023-08-24 2023-08-24 Method, device, equipment and storage medium for testing relevance of software program Pending CN117033235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311080574.XA CN117033235A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for testing relevance of software program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311080574.XA CN117033235A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for testing relevance of software program

Publications (1)

Publication Number Publication Date
CN117033235A true CN117033235A (en) 2023-11-10

Family

ID=88633622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311080574.XA Pending CN117033235A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for testing relevance of software program

Country Status (1)

Country Link
CN (1) CN117033235A (en)

Similar Documents

Publication Publication Date Title
CN113836925B (en) Training method and device for pre-training language model, electronic equipment and storage medium
CN111045902A (en) Pressure testing method and device for server
CN117076719A (en) Database joint query method, device and equipment based on large language model
CN117593115A (en) Feature value determining method, device, equipment and medium of credit risk assessment model
CN116975081A (en) Log diagnosis set updating method, device, equipment and storage medium
CN112434953A (en) Customer service personnel assessment method and device based on computer data processing
CN115687406B (en) Sampling method, device, equipment and storage medium for call chain data
CN117033235A (en) Method, device, equipment and storage medium for testing relevance of software program
CN111949776B (en) User tag evaluation method and device and electronic equipment
CN115344495A (en) Data analysis method and device for batch task test, computer equipment and medium
CN115186738A (en) Model training method, device and storage medium
CN113360672A (en) Methods, apparatus, devices, media and products for generating a knowledge graph
CN115273854B (en) Service quality determining method and device, electronic equipment and storage medium
CN113344405B (en) Method, device, equipment, medium and product for generating information based on knowledge graph
CN117271373B (en) Automatic construction method and device for test cases, electronic equipment and storage medium
CN113190779B (en) Webpage evaluation method and device
CN117010947B (en) NPS investigation method, device, equipment and storage medium based on business activity
CN109614328B (en) Method and apparatus for processing test data
CN115131709B (en) Video category prediction method, training method and device for video category prediction model
CN113391989B (en) Program evaluation method, device, equipment, medium and program product
CN116594827A (en) Automatic test method and device for hardware equipment, workbench, equipment and medium
CN117827637A (en) Automatic test method and device and electronic equipment
CN115543822A (en) Method, device, equipment and medium for identifying influence range of interface change
CN117891640A (en) Micro-service fault diagnosis method and device based on large language model and electronic equipment
CN116823159A (en) Workload estimation method, device and program product for financial project

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination