CN114817007A - Information processing method and device, electronic equipment and computer readable storage medium - Google Patents

Information processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114817007A
CN114817007A CN202210370987.0A CN202210370987A CN114817007A CN 114817007 A CN114817007 A CN 114817007A CN 202210370987 A CN202210370987 A CN 202210370987A CN 114817007 A CN114817007 A CN 114817007A
Authority
CN
China
Prior art keywords
information
called program
constant
program
data source
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
CN202210370987.0A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210370987.0A priority Critical patent/CN114817007A/en
Publication of CN114817007A publication Critical patent/CN114817007A/en
Pending legal-status Critical Current

Links

Images

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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides an information processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the field of computer technologies and financial fields. The information processing method includes: in response to receiving a test request, determining the called program associated with the test request and the initial position information of the called program corresponding to the called program according to the test request, wherein the test request comprises the initial position information and the source code information of the program to be tested; determining constant information and data source information of the called program according to the called program and initial position information of the called program corresponding to the called program; and generating target test information according to the initial position information, the source code information, the initial position information, the constant information and the data source information of the program to be tested.

Description

Information processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technology and the field of finance, and more particularly, to an information processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of computer technology, the iteration speed of software products is faster and faster. To better reduce the testing cost of software products, more and more system testers will write automated test cases for long-term functions.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: the cost for manually analyzing the codes by the testers is too high, and the compiling efficiency of the automatic test case cannot be guaranteed.
Disclosure of Invention
In view of the above, the present disclosure provides an information processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present disclosure, there is provided an information processing method including:
in response to receiving a test request, according to the test request, determining a called program associated with the test request and initial position information of the called program corresponding to the called program, wherein the test request comprises the initial position information and source code information of a program to be tested;
determining constant information and data source information of the called program according to the called program and initial position information of the called program corresponding to the called program; and
and generating target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the constant information and the data source information.
According to an embodiment of the present disclosure, the determining, according to the called program and the start position information of the called program corresponding to the called program, the constant information and the data source information of the called program includes:
determining the constant name information and the data source name information according to the called program and the initial position information of the called program; and
and determining the constant information and the data source information according to the constant name information and the data source name information.
According to an embodiment of the present disclosure, the determining the constant name information and the data source name information according to the called program and the start position information of the called program includes:
determining the constant name information when detecting that the called program comprises a constant; and
and processing the called program to obtain the name information of the data source under the condition that the called program is detected to comprise preset keywords.
According to an embodiment of the present disclosure, the determining the constant information and the data source information according to the constant name information and the data source name information includes:
determining the constant information according to the constant name information, wherein the constant information includes a constant value corresponding to the constant name information; and
and determining the data source information according to the data source name information, wherein the data source information comprises at least one of address information, port number information, identifier information, user name information and password information corresponding to the data source name information.
According to an embodiment of the present disclosure, the generating target test information according to the start position information of the program to be tested, the source code information, the start position information of the called program, the constant information, and the data source information includes:
processing the constant information and the data source information to obtain processed constant information and data source information; and
and determining the target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the processed constant information and the data source information.
According to an embodiment of the present disclosure, the determining, in response to receiving a test request and according to the test request, start position information of a called program associated with the test request and a called program corresponding to the called program includes:
disassembling the source code information to obtain processed source code information; and
and determining the initial position information of the called program and the called program associated with the source code information according to the initial position information of the program to be tested and the processed source code information.
According to another aspect of the present disclosure, there is provided an information processing apparatus including:
the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for responding to a received test request, and determining the called program associated with the test request and the initial position information of the called program corresponding to the called program according to the test request, wherein the test request comprises the initial position information and the source code information of the program to be tested;
a second determining module, configured to determine, according to the called program and start position information of the called program corresponding to the called program, constant information and data source information of the called program; and
and the generating module is used for generating target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the constant information and the data source information.
According to another aspect of the present disclosure, there is provided an electronic device including:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the method as described above.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, in the case of receiving a test request, according to a called program associated with the test request and start position information of the called program, constant information and data source information of the called program are determined, and target test information is generated. By the technical means, the target test information can be automatically generated according to the initial position information and the source code information of the program to be tested, which are provided by the tester, so that the technical problems that the cost for manually analyzing the codes by the tester in the related technology is too high and the compiling efficiency of an automatic test case cannot be guaranteed are at least partially solved, the manual participation is reduced, the time for generating the target test information is saved, and the efficiency and the accuracy of information processing are further improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically shows a system architecture to which an information processing method according to an embodiment of the present disclosure can be applied;
FIG. 2 schematically shows a flow chart of an information processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flowchart of a method of determining a called program and start position information of the called program according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a method of determining constant name information and data source name information according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow chart of a method of determining constant information and data source information according to an embodiment of the present disclosure;
fig. 6 schematically shows an example schematic diagram of an information processing method according to an embodiment of the present disclosure;
fig. 7 schematically shows a block diagram of an information processing apparatus according to an embodiment of the present disclosure; and
fig. 8 schematically shows a block diagram of an electronic device adapted to implement an information processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
With the development of computer technology, the iteration speed of software products is faster and faster. To better reduce the testing cost of software products, more and more system testers will write automated test cases for long-term functions and execute these cases regularly to ensure that new functions do not affect the current software version's unmodified inventory functions.
For old codes with stock functions, the functions have great obstruction to the automation of the writing of testers on the premise of lacking soft requirement documents. Taking the acquisition of database information as an example, at present, a tester needs to directly acquire a developed source code, perform program code analysis for a stock function, and find a corresponding database configuration, so as to perform operations such as automatic case compiling, test data preparation and recovery, assertion compiling, and the like.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: the cost for manually analyzing the codes by the testers is too high, and the compiling efficiency of the automatic test case cannot be guaranteed.
In order to at least partially solve the technical problems in the related art, the present disclosure provides an information processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the computer technology field and the financial field. The information processing method includes: in response to receiving a test request, determining the called program associated with the test request and the initial position information of the called program corresponding to the called program according to the test request, wherein the test request comprises the initial position information and the source code information of the program to be tested; determining constant information and data source information of the called program according to the called program and initial position information of the called program corresponding to the called program; and generating target test information according to the initial position information, the source code information, the initial position information, the constant information and the data source information of the program to be tested.
It should be noted that the information processing method and apparatus provided by the embodiments of the present disclosure may be applied to the field of computer technology and the field of finance, for example, to network maintenance of various banking outlets. The information processing method and device provided by the embodiment of the disclosure can also be used in any fields except the technical field of computers and the financial field, for example, the application to software testing. The application fields of the information processing method and the information processing device provided by the embodiment of the disclosure are not limited.
Fig. 1 schematically shows a system architecture to which an information processing method according to an embodiment of the present disclosure can be applied. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the information processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the information processing apparatus provided by the embodiment of the present disclosure may be generally provided in the server 105. The information processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the information processing apparatus provided in the embodiment of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the information processing method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the information processing apparatus provided in the embodiment of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the constant information and the data source information may be originally stored in any one of the terminal devices 101, 102, or 103 (e.g., the terminal device 101, but not limited thereto), or stored on an external storage device and may be imported into the terminal device 101. Then, the terminal device 101 may locally execute the information processing method provided by the embodiment of the present disclosure, or send the constant information and the data source information to another terminal device, a server, or a server cluster, and execute the information processing method provided by the embodiment of the present disclosure by another terminal device, a server, or a server cluster that receives the constant information and the data source information.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of an information processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the information processing method includes operations S210 to S230.
In operation S210, in response to receiving a test request, start position information of a called program associated with the test request and a called program corresponding to the called program is determined according to the test request, wherein the test request includes the start position information and source code information of a program to be tested.
In operation S220, constant information and data source information of the called program are determined according to the called program and the start position information of the called program corresponding to the called program.
In operation S230, target test information is generated according to the start position information of the program to be tested, the source code information, the start position information of the called program, the constant information, and the data source information.
According to the embodiment of the disclosure, the test request may include a request message sent by the tester to the server through the client. The test request may include a request method, a URL (Uniform Resource Locator), a protocol version, a request header, request data, and the like.
According to the embodiment of the disclosure, for example, a tester may input start position information and source code information of a program to be tested at a client, and initiate a test request for the program to be tested to a server.
According to embodiments of the present disclosure, source code information may be used to characterize program code of a program under test. The start position information of the program to be tested can be used for characterizing the program entry position of the program to be tested, namely the position where the program to be tested starts to execute. The start position information of the called program can be used for characterizing the program entry position of the called program, namely the position of the called program starting to execute.
According to embodiments of the present disclosure, the constant information may include information that is not modified by the program when the program is running. The data source information can provide the position of data needed by the program, and can ensure the specification and protocol of interaction between the program and the data.
According to embodiments of the present disclosure, the target test information may be used to test a program to be tested to verify whether the program to be tested meets specified requirements or to determine differences between expected and actual results.
According to the embodiment of the disclosure, in the case of receiving a test request, according to a called program associated with the test request and start position information of the called program, constant information and data source information of the called program are determined, and target test information is generated. By the technical means, the target test information can be automatically generated according to the initial position information and the source code information of the program to be tested, which are provided by the tester, so that the technical problems that the cost for manually analyzing the codes by the tester in the related technology is too high and the compiling efficiency of an automatic test case cannot be guaranteed are at least partially solved, the manual participation is reduced, the time for generating the target test information is saved, and the efficiency and the accuracy of information processing are further improved.
The method shown in fig. 2 is further described with reference to fig. 3-6 in conjunction with specific embodiments.
FIG. 3 schematically illustrates a flowchart of a method of determining a callee and start location information of the callee in accordance with an embodiment of the disclosure.
According to an embodiment of the present disclosure, in one example, operation S210 may include the following operations.
And disassembling the source code information to obtain the processed source code information. And determining the called program and the starting position information of the called program associated with the source code information according to the starting position information of the program to be tested and the processed source code information.
According to an embodiment of the present disclosure, in one example, as shown in fig. 3, in operation S311, start position information and source code information of a program to be tested may be acquired.
In operation S312, the source code information may be disassembled to obtain processed source code information.
In operation S313, start position information of the called program may be determined according to the processed source code information.
In operation S314, it may be determined whether there is a jump to the callee.
In the case where it is determined that there is a jump to the callee, operation S315 may be performed to determine the callee.
In the case where it is determined that there is no jump in the called program, or after the execution of operation S315 is completed, operation S316 may be performed to determine whether the call of the program to be tested is ended.
In a case where it is determined that the call of the program to be tested has not ended, the iterative execution of operations S313 to S316 may be continued.
In the case where it is determined that the calling of the program to be tested is ended, the called program and the start position information of the called program may be determined.
According to the embodiment of the present disclosure, the disassembling process may also be referred to as computer software Reverse engineering (Reverse engineering), and may include performing Reverse analysis and research work on a target program of software to derive design elements such as ideas, principles, structures, algorithms, processing procedures, operation methods, and the like used by a software product. The disassembling process can be performed by a method combining static debugging and dynamic debugging.
According to embodiments of the present disclosure, the processed source code information may be stored in a predetermined format in a designated register of the machine. For example, the preset format may include fixedly reserving the first four bytes, designating the middle eight bytes as the version number of the current programming language, storing program constants using the last eight bytes, and so on. The specific content of the preset format may be set by a person skilled in the art according to actual requirements, and different programming languages may adapt to the corresponding preset format.
According to the embodiment of the disclosure, fixed fields can be used in the processed source code information to refer to operations such as jump, judgment, ending of current program function, and the like of a program. For example, the field jump may be used to characterize the starting location information for invoking the called program in the program to be tested.
According to the embodiment of the disclosure, the start position information of at least one called program can be firstly determined in the processed source code information according to the position of the field jump, and the called program is analyzed by taking the start position information of each called program as a starting point.
According to the embodiment of the disclosure, the program calling relationship can be determined according to the initial position information of the program to be tested, the source code information, the called program and the initial position information of the called program.
According to the embodiment of the disclosure, by disassembling the source code information, the called program associated with the source code information and the initial position information of the called program can be determined, and further, the target test information can be further automatically generated according to the program calling relation, so that the efficiency and the accuracy of generating the target test information are improved.
According to an embodiment of the present disclosure, operation S220 may include the following operations.
And determining constant name information and data source name information according to the called program and the initial position information of the called program. And determining the constant information and the data source information according to the constant name information and the data source name information.
According to embodiments of the present disclosure, the constants may include a character-type constant, a date-type constant, a logic-type constant, a currency-type constant, and a sign-type constant. The constant name information can be set by the relevant personnel in a self-defining way when writing the program.
According to the embodiment of the disclosure, the name information of the data source can be set by a relevant person in a user-defined manner when writing a program according to the information of the database driver, the database storage position, the database name and the like.
According to an embodiment of the present disclosure, the constant information may include specific contents corresponding to the constant name information. The data source information may include specific content corresponding to the data source name information.
Fig. 4 schematically illustrates a flow chart of a method of determining constant name information and data source name information according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, in one example, determining the constant name information and the data source name information according to the called program and the start position information of the called program may include the following operations.
In the case where it is detected that the called program includes a constant, constant name information is determined. And processing the called program to obtain the name information of the data source under the condition that the called program is detected to comprise the preset keywords.
According to an embodiment of the present disclosure, in one example, as shown in fig. 4, in operation S421, a called program and start position information of the called program may be determined.
In operation S422, it may be determined whether a constant exists in the called program.
In the case where it is determined that the called program has a constant, operation S423 may be performed to determine constant name information.
In the case where it is determined that the called program does not have a constant or the execution is completed in operation S423, operation S424 may be performed to determine whether the called program has a preset keyword.
In the case that it is determined that the called program has the preset keyword, operation S425 may be performed to process the called program and obtain the data source name information.
In the case where it is determined that the called program does not have the preset keyword or the execution is completed in operation S425, operation S426 may be performed to determine whether there is another called program.
In the case where it is determined that there are other called programs, the iterative execution of operations S421 to S426 may be continued.
In the case where it is determined that there are no other callees, the constant name information and the data source name information may be determined.
According to the embodiment of the disclosure, at least one called program can be analyzed according to the program calling relation, so as to obtain the actual called constant name information and data source name information.
According to an embodiment of the present disclosure, it may be determined whether it is a call for a database operation. For example, the determination may be made based on preset keywords for characterizing database operations, and if the called program is determined to relate to database operations, the annotation of the called program may be parsed to record the referenced data source name information. The preset keyword may be set by a person skilled in the art according to actual needs, for example, select, insert, and the like may be included, and the specific content of the preset keyword is not limited in the embodiments of the present disclosure.
According to the embodiment of the disclosure, the constant name information can be determined when the called program is detected to include the constant, and the called program can be processed to obtain the data source name information when the called program is detected to include the preset keyword. Through the technical means, the calling chain comprising the initial position information of the program to be tested, the source code information, the called program and the initial position information of the called program can be further analyzed, so that the actually used constant information and data source information can be determined according to the constant name information and the data source name information used by each called program, and the information processing efficiency is improved.
Fig. 5 schematically illustrates a flow chart of a method of determining constant information and data source information according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, in one example, determining the constant information and the data source information according to the constant name information and the data source name information may include the following operations.
And determining constant information according to the constant name information, wherein the constant information comprises a constant value corresponding to the constant name information. And determining data source information according to the data source name information, wherein the data source information comprises at least one of address information, port number information, identifier information, user name information and password information corresponding to the data source name information.
According to an embodiment of the present disclosure, in one example, as shown in fig. 5, in operation S521, a configuration file may be determined.
In operation S522, the configuration file may be parsed to obtain data source configuration information and constant configuration information.
In operation S523, constant information of the called program may be determined according to the start position information of the called program.
In operation S524, data source information of the called program may be determined according to the starting location information of the called program.
In operation S525, whether the call of the program is ended may be tested.
According to the embodiment of the disclosure, the configuration file of the called program can be analyzed to match the actually configured constant information and data source information with the constant name information and data source name information one by one. The corresponding constant name information and constant information, data source name information and data source information can be recorded in a list format.
According to the embodiment of the disclosure, the constant information matched with the constant name information of the called program can be determined by calculating the similarity between the constant name information of the called program and the constant name information in the configuration file.
According to the embodiment of the disclosure, the similarity between the data source name information of the called program and the data source name information in the configuration file can be calculated through a similarity calculation method and a similarity detection algorithm, and the data source information matched with the data source name information of the called program is determined.
According to an embodiment of the present disclosure, the similarity calculation method may include cosine similarity, minimum edit distance, euclidean distance, jackard correlation coefficient, pearson correlation coefficient, hamming distance, and the like. The similarity detection algorithm may include TF-IDF (Term-Inverse Document Frequency) algorithm, BM25 algorithm, Simhash algorithm, LSI (Latent Semantic Indexing) model, DSSM (Deep learned Semantic matching model), ConvNet based on convolutional neural network, LSTM (Long Short-Term Memory), and the like.
According to an embodiment of the present disclosure, the identifier information may include a name used when the user programs, for naming variables, constants, functions, statement blocks, etc., to establish a relationship between the name and the use. The identifier information may include letters, numbers, and other characters.
According to the embodiment of the disclosure, the constant information and the data source information are determined according to the constant name information and the data source name information, so that the actual called program, and the system data source information and the constant value associated with the called program can be obtained based on the configuration file, thereby reducing the manual participation and improving the accuracy of generating the target test information.
According to an embodiment of the present disclosure, operation S230 may include the following operations.
And processing the constant information and the data source information to obtain the processed constant information and the processed data source information. And determining target test information according to the initial position information, the source code information, the initial position information of the called program, the processed constant information and the data source information of the program to be tested.
According to the embodiment of the disclosure, the constant information and the data source information can be integrated and formatted, and the determined target test information is provided for the tester, so that the tester can conveniently perform configuration and writing operation of the automatic test of the inventory program code.
According to the embodiment of the disclosure, the target test information can be automatically determined according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the processed constant information and the data source information, so that a tester can test the program to be tested according to the target test information, and the efficiency and the accuracy of the program test are improved.
Fig. 6 schematically shows an example schematic diagram of an information processing method according to an embodiment of the present disclosure.
As shown in fig. 6, a tester may input a program to be tested 601, and the program to be tested 601 may include start position information and source code information of the program to be tested 601.
The source code information of the program to be tested 601 may be subjected to disassembling processing, and a call relation including a called program associated with the program to be tested 601 and start position information of the called program may be recorded in a call chain. For example, the callee in the call chain may include the callee 602_1, the callee 602_2, the callee 602_3, …, the callee 602_ N, …, and the callee 602_ N.
A loop analysis may be performed on each callee in the call chain to determine constant name information for each callee, which may include at least one constant name. The injection code corresponding to the data source can be found according to the database keyword, and the name information of the data source is determined, wherein the name information of the data source can comprise at least one name information of the data source. For example, the constant name information 603_21 and the data source name information 603_22 of the callee 602_2 may be determined, and the constant name information 603_31 and the data source name information 603_32 of the callee 602_3 may be determined. The constant name information 603_21 may include constant names 603_211, constant names 603_212, …, constant names 603_21P, …, and constant names 603_ 21P. The data source name information 603_22 may include a data source name 603_221, a data source name 603_222, …, a data source name 603_21Q, …, and a data source name 603_ 21Q.
The system configuration file may be analyzed to determine constant information corresponding to the constant name information and data source information corresponding to the data source name information. For example, a constant value 604_211 corresponding to the constant name 603_211, constant values 604_212, … corresponding to the constant name 603_212, constant values 604_21P, … corresponding to the constant name 603_21P, and constant value 604_21P corresponding to the constant name 603_21P may be determined. Address information 603_2211, port number information 603_2212, identifier information 603_2213, user name information 603_2214, and password information 603_2215 corresponding to the data source name 603_221 can be determined.
At least one of the constant value and address information, port number information, identifier information, username information, and password information referenced by each invoked program may be integrated and formatted for automated code testing by a tester.
Fig. 7 schematically shows a block diagram of an information processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, the information processing apparatus 700 includes a first determining module 701, a second determining module 702, and a generating module 703.
The first determining module 701 is configured to determine, in response to receiving a test request, start position information of a called program associated with the test request and start position information of a called program corresponding to the called program according to the test request, where the test request includes the start position information and source code information of a program to be tested.
The second determining module 702 is configured to determine the constant information and the data source information of the called program according to the called program and the start position information of the called program corresponding to the called program.
The generating module 703 is configured to generate target test information according to the start position information of the program to be tested, the source code information, the start position information of the called program, the constant information, and the data source information.
According to an embodiment of the present disclosure, the second determination module 702 includes a first determination unit and a second determination unit.
And the first determining unit is used for determining the constant name information and the data source name information according to the called program and the initial position information of the called program.
And the second determining unit is used for determining the constant information and the data source information according to the constant name information and the data source name information.
According to an embodiment of the present disclosure, the first determination unit includes a first determination subunit and a first processing subunit.
And the first determining subunit is used for determining the constant name information under the condition that the called program is detected to comprise the constant.
And the first processing subunit is used for processing the called program to obtain the name information of the data source under the condition that the called program is detected to comprise the preset keywords.
According to an embodiment of the present disclosure, the second determination unit includes a second determination subunit and a third determination subunit.
And the second determining subunit is used for determining the constant information according to the constant name information, wherein the constant information comprises a constant value corresponding to the constant name information.
And the third determining subunit is configured to determine the data source information according to the data source name information, where the data source information includes at least one of address information, port number information, identifier information, user name information, and password information corresponding to the data source name information.
According to an embodiment of the present disclosure, the generating module 703 comprises a processing unit and a third determining unit.
And the processing unit is used for processing the constant information and the data source information to obtain the processed constant information and the processed data source information.
And the third determining unit is used for determining target test information according to the initial position information, the source code information, the initial position information of the called program, the processed constant information and the data source information of the program to be tested.
According to an embodiment of the present disclosure, the first determining module 701 includes a second processing subunit and a fourth determining subunit.
And the second processing subunit is used for performing disassembly processing on the source code information to obtain the processed source code information.
And the fourth determining subunit is used for determining the called program and the initial position information of the called program associated with the source code information according to the initial position information of the program to be tested and the processed source code information.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the first determining module 701, the second determining module 702 and the generating module 703 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the first determining module 701, the second determining module 702, and the generating module 703 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the first determining module 701, the second determining module 702 and the generating module 703 may be at least partly implemented as a computer program module, which when executed may perform a corresponding function.
It should be noted that the information processing apparatus portion in the embodiments of the present disclosure corresponds to the information processing method portion in the embodiments of the present disclosure, and the description of the information processing apparatus portion specifically refers to the information processing method portion, and is not repeated herein.
Fig. 8 schematically shows a block diagram of an electronic device adapted to implement an information processing method according to an embodiment of the present disclosure. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, a computer electronic device 800 according to an embodiment of the present disclosure includes a processor 801 which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or RAM 803. Note that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 800 may also include input/output (I/O) interface 805, input/output (I/O) interface 805 also connected to bus 804, according to an embodiment of the present disclosure. Electronic device 800 may also include one or more of the following components connected to I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 802 and/or RAM 803 described above and/or one or more memories other than the ROM 802 and RAM 803.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being configured to cause the electronic device to implement the information processing method provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 801, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via communication section 809, and/or installed from removable media 811. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. An information processing method comprising:
in response to receiving a test request, determining a called program associated with the test request and initial position information of the called program corresponding to the called program according to the test request, wherein the test request comprises the initial position information and source code information of a program to be tested;
determining constant information and data source information of the called program according to the called program and initial position information of the called program corresponding to the called program; and
and generating target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the constant information and the data source information.
2. The method of claim 1, wherein the determining the constant information and the data source information of the called program according to the called program and the start position information of the called program corresponding to the called program comprises:
determining the constant name information and the data source name information according to the called program and the initial position information of the called program; and
and determining the constant information and the data source information according to the constant name information and the data source name information.
3. The method of claim 2, wherein the determining the constant name information and data source name information from the called program and the starting location information of the called program comprises:
determining the constant name information in the case of detecting that the called program comprises a constant; and
and processing the called program to obtain the name information of the data source under the condition that the called program is detected to comprise preset keywords.
4. The method of claim 2 or 3, wherein the determining the constant information and the data source information from the constant name information and the data source name information comprises:
determining the constant information according to the constant name information, wherein the constant information comprises a constant value corresponding to the constant name information; and
and determining the data source information according to the data source name information, wherein the data source information comprises at least one of address information, port number information, identifier information, user name information and password information corresponding to the data source name information.
5. The method of claim 4, wherein the generating target test information according to the start position information of the program to be tested, the source code information, the start position information of the called program, the constant information, and the data source information comprises:
processing the constant information and the data source information to obtain processed constant information and data source information; and
and determining the target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the processed constant information and the data source information.
6. The method of any of claims 1-5, wherein the determining, in response to receiving a test request, start location information of a callee associated with the test request and a callee corresponding to the callee from the test request comprises:
disassembling the source code information to obtain processed source code information; and
and determining the called program and the initial position information of the called program associated with the source code information according to the initial position information of the program to be tested and the processed source code information.
7. An information processing apparatus comprising:
the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for responding to the received test request, and determining the called program associated with the test request and the initial position information of the called program corresponding to the called program according to the test request, and the test request comprises the initial position information and the source code information of the program to be tested;
the second determining module is used for determining the constant information and the data source information of the called program according to the called program and the initial position information of the called program corresponding to the called program; and
and the generating module is used for generating target test information according to the initial position information of the program to be tested, the source code information, the initial position information of the called program, the constant information and the data source information.
8. An electronic device, comprising:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 6.
10. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 6 when executed.
CN202210370987.0A 2022-04-08 2022-04-08 Information processing method and device, electronic equipment and computer readable storage medium Pending CN114817007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210370987.0A CN114817007A (en) 2022-04-08 2022-04-08 Information processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210370987.0A CN114817007A (en) 2022-04-08 2022-04-08 Information processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114817007A true CN114817007A (en) 2022-07-29

Family

ID=82534164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210370987.0A Pending CN114817007A (en) 2022-04-08 2022-04-08 Information processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114817007A (en)

Similar Documents

Publication Publication Date Title
CN109359194B (en) Method and apparatus for predicting information categories
CN112463729B (en) Data file warehousing method and device, electronic equipment and medium
CN115587575A (en) Data table creation method, target data query method, device and equipment
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN112817831A (en) Application performance monitoring method, device, computer system and readable storage medium
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN113869789A (en) Risk monitoring method and device, computer equipment and storage medium
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
US20180314683A1 (en) Method and device for processing natural language
CN112231696A (en) Malicious sample identification method and device, computing equipment and medium
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN115292187A (en) Method and device for automatically testing code-free page, electronic equipment and medium
CN115827122A (en) Operation guiding method and device, electronic equipment and storage medium
CN114301713A (en) Risk access detection model training method, risk access detection method and risk access detection device
CN111400623B (en) Method and device for searching information
CN115080433A (en) Testing method and device based on flow playback
CN114817007A (en) Information processing method and device, electronic equipment and computer readable storage medium
CN113535568B (en) Verification method, device, equipment and medium for application deployment version
US8935343B2 (en) Instant messaging network resource validation
CN117454038A (en) Page detection method and device
CN116894004A (en) Information display method and device, electronic equipment and computer readable storage medium
CN116680184A (en) Code scanning method, device, electronic equipment and medium
CN115438632A (en) Text data processing method and device, electronic equipment and readable storage medium
CN116795700A (en) Prepositioning method and device for abnormal faults of interface program
CN117278623A (en) Method and device for processing request data, computer equipment and storage medium

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