[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN116450511A - Information updating method, device, electronic equipment and computer readable medium - Google Patents

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

Info

Publication number
CN116450511A
CN116450511A CN202310366026.7A CN202310366026A CN116450511A CN 116450511 A CN116450511 A CN 116450511A CN 202310366026 A CN202310366026 A CN 202310366026A CN 116450511 A CN116450511 A CN 116450511A
Authority
CN
China
Prior art keywords
interface
tested
code
information
test case
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
CN202310366026.7A
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.)
Duodian Life Chengdu Technology Co ltd
Original Assignee
Duodian Life Chengdu Technology 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 Duodian Life Chengdu Technology Co ltd filed Critical Duodian Life Chengdu Technology Co ltd
Priority to CN202310366026.7A priority Critical patent/CN116450511A/en
Publication of CN116450511A publication Critical patent/CN116450511A/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/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/3676Test management for coverage analysis
    • 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/3692Test management for test results analysis
    • 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

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)
  • Debugging And Monitoring (AREA)

Abstract

Embodiments of the present disclosure disclose information updating methods, apparatuses, electronic devices, and computer-readable media. One embodiment of the method comprises the following steps: acquiring a code to be tested and a base line code of the code to be tested from a code library; determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested; by using the mapping relation between the interface and the test case, determining a test case matched with interface information to be tested in the interface information set to be tested to obtain a target test case set; testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result; and updating the mapping relation between the interface and the test case according to the test result. According to the implementation mode, after the code of the research personnel is submitted, the interface affecting the software can be quickly found, the related test cases are automatically executed, and the case missing test phenomenon is avoided.

Description

Information updating method, device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to an information updating method, an apparatus, an electronic device, and a computer readable medium.
Background
Software testing is a technique for operating a program under certain conditions to find program errors, measure software quality, and evaluate whether it meets design requirements. Currently, when performing software testing, the following methods are generally adopted: the method mainly adopts a black box test, namely a tester writes test cases according to the required documents to test the software.
However, when the software test is performed in the above manner, there are often the following technical problems:
firstly, a tester only writes test cases according to a requirement document and tests the test cases, the condition of missing test is easy to cause, the problem caused by code adjustment on the existing function of software cannot be found out quickly, and normal use of the software after online is affected.
Second, it is difficult to find problems with codes in software in a timely manner, which adversely affects subsequent use.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose information updating methods, apparatuses, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an information updating method, the method including: acquiring a code to be tested and a base line code of the code to be tested from a code library, wherein the code to be tested is a code file with changed file content; determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested, wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with the changing content of the code to be tested; determining a test case matched with interface information to be tested in an interface information set to be tested by using a mapping relation between an interface and the test case to obtain a target test case set; testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result; and updating the mapping relation between the interface and the test case according to the test result.
In a second aspect, some embodiments of the present disclosure provide an information updating apparatus, the apparatus including: an acquisition unit configured to acquire a code to be tested and a baseline code of the code to be tested from a code library, wherein the code to be tested is a code file with changed file content; a first determining unit configured to determine interface information to be tested based on the code to be tested and the baseline code, and obtain an interface information set to be tested, where each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with a change content of the code to be tested; the second determining unit is configured to determine a test case matched with the interface information to be tested in the interface information set to be tested by using the mapping relation between the interface and the test case, so as to obtain a target test case set; the test unit is configured to test the code to be tested by utilizing the target test cases in the target test case set to obtain a test result; and the updating unit is configured to update the mapping relation between the interface and the test case according to the test result.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors causes the one or more processors to implement the method described in any of the implementations of the first aspect above.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
The above embodiments of the present disclosure have the following advantageous effects: according to the information updating method of some embodiments of the present disclosure, after the code of the developer is submitted, the interface affecting the software can be quickly found, and the related test cases are automatically executed, so that the case missing test phenomenon caused by experience judgment of the tester is avoided, and meanwhile, the software testing efficiency is greatly improved. Specifically, the reason why the related software testing method has the missing test phenomenon is that: during development, developers often modify the historical code of the software, which results in other functions being affected. If a tester writes test cases and tests only according to new requirements, other historical functions influenced by code change can be missed. Based on this, in the information updating method according to some embodiments of the present disclosure, first, a code to be tested and a baseline code of the code to be tested are obtained from a code library, where the code to be tested is a code file whose file content is changed. And then, determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested. Wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with the changed content of the code to be tested. Thus, the code to be tested and the baseline code determine the change range of the code, and accurate evaluation of the influence range of new code adjustment is realized. And then, determining the test case matched with the interface information to be tested in the interface information set to be tested by using the mapping relation between the interface and the test case, and obtaining a target test case set. And then, testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result. Thus, the relevant test cases are automatically recommended according to the code change range. And finally, updating the mapping relation between the interface and the test case according to the test result. Therefore, after the code of the research personnel is submitted, the interface affecting the software can be quickly found, the related test cases are automatically executed, the case missing test phenomenon caused by experience judgment of the test personnel is avoided, and meanwhile, the software testing efficiency is greatly improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of some embodiments of an information update method according to the present disclosure;
FIG. 2 is a schematic diagram of the structure of some embodiments of an information updating apparatus of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates a flow 100 of some embodiments of an information update method according to the present disclosure. The information updating method comprises the following steps:
step 101, obtaining a code to be tested and a base line code of the code to be tested from a code library.
In some embodiments, the execution body of the information updating method may acquire the code to be tested and the baseline code of the code to be tested from the code library through a wired connection manner or a wireless connection manner. The code to be tested may be a code file with changed file content.
And 102, determining interface information to be tested based on the code to be tested and the baseline code, and obtaining an interface information set to be tested.
In some embodiments, each interface characterized by the interface information to be tested in the interface information set to be tested may be an interface associated with the changed content of the code to be tested. The executing body determines the interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested, and the executing body may include the following steps:
determining a local abstract syntax tree corresponding to the change content in the code to be tested, and obtaining the local change abstract syntax tree.
And a second step of determining a local abstract syntax tree corresponding to the local change abstract syntax tree from the abstract syntax tree of the base line code, and obtaining a local reference abstract syntax tree.
And a third step of determining code change information based on the local change abstract syntax tree and the local reference abstract syntax tree. The code change information may include: class of change and method of change.
And step four, determining interface information to be tested by using the baseline codes and the code change information, and obtaining an interface information set to be tested.
In some optional implementations of some embodiments, the determining, by the execution body, a local abstract syntax tree corresponding to the change content in the code to be tested, to obtain the local change abstract syntax tree may include the following steps:
first, a modified code file in code files related to the code to be tested is determined based on a change extraction command and the code to be tested. The change extraction command may be a git (distributed version control system) command. The modified code file may be determined from the code to be tested using the change extraction command.
And a second step of filtering the preset filtering information from the modified code file to obtain a change code. The preset filtering information may include comments and blanks. The modification code includes a pruned code and an added code.
As an example, "-464, prjspaceinvolvedvo, setprjcode (prjdetail, getprjcode ()); 465, prjspaceinvolvedVO. SetStatus (prjDetail. GetStatus ()); "change code may be characterized". Therein, "-464, prjspaceinvolvedvo, setprjcode (prjdetail,)" indicates 464 lines of reduced content as: prjSpaceivolvedVO. SetPrjCode (prjDetail getPrjCode ()). "465, prjspaceinvolvedVO. SetStatus (prjDetail getStatus ())" indicates465 lines add: prjSpaceivolvedVO.setStatus (prjDetail.getStatus ()).
Thirdly, the modified codes are analyzed by utilizing preset grammar to obtain modification information. Wherein the modification information may include a modified class and a modified method.
And step four, generating a local abstract syntax tree corresponding to the modification information to obtain a local change abstract syntax tree. The local abstract syntax tree corresponding to the modification information may be a part corresponding to the modification information in the syntax tree of the code to be tested.
Optionally, the executing body determines a local abstract syntax tree corresponding to the local change abstract syntax tree from the abstract syntax tree of the baseline code, so as to obtain a local reference abstract syntax tree, and may include the following steps:
firstly, carrying out grammar analysis on the baseline codes by utilizing preset grammar to obtain grammar analysis results.
And secondly, generating an abstract syntax tree of the baseline code by using the syntax analysis result.
And thirdly, determining the local abstract syntax tree corresponding to the abstract syntax tree and the local change abstract syntax tree as a local reference abstract syntax tree.
Optionally, the executing body determines the code change information based on the local change abstract syntax tree and the local reference abstract syntax tree, and may include the steps of:
the first step is to compare the local change abstract syntax tree with the local reference abstract syntax tree to obtain change information. The change information can be used to characterize the change of the method in the class or the change of the parameter in the class.
And a second step of determining the change information as code change information.
Optionally, the executing body determines the interface information to be tested by using the baseline code and the code change information to obtain an interface information set to be tested, which may include the following steps:
and the first step is to compile the baseline codes to obtain target compression packets. The target compression packet may be a jar packet.
And secondly, determining the function call relation in the target compressed package by using a byte code analysis tool. The function call relationship may be used to characterize that a function in a class calls a function in the class. The bytecode analysis tool may be a java-callgraph.
Third, based on the code change information and the function call relationship, the affected methods in the class are determined, resulting in an affected method set.
And step four, filtering the codes to be tested by using the affected method set to obtain an interface address set.
And fifthly, determining the information of the interfaces indicated by the interface addresses in the interface address set as the interface information to be tested, and obtaining the interface information set to be tested.
The step of determining the interface information to be tested based on the code to be tested and the baseline code to obtain the interface information set to be tested and the related expansion step are taken as an invention point of the embodiment of the disclosure, so that the technical problem mentioned in the background art, namely test personnel only write test cases according to the required documents and test the test cases, the condition of missing test is easily caused, the problem caused by the adjustment of the code to the existing functions of the software cannot be quickly found, and the normal use of the software after the software is on line is affected, is solved. Factors that cause the above technical problems are often as follows: during development, developers often modify historical codes, which results in other functions being affected. If the above factors are solved, the effect of reducing the missing test condition caused by the insufficient evaluation range of the code change can be achieved. In order to achieve the effect, the interface recording tool is used for recording related interfaces involved in test case execution, and finally mapping relation data of the test case and the interfaces are formed. When code submission is carried out, the code to be tested and the abstract syntax tree are acquired for comparison analysis, so that an interface which changes due to the code change is positioned. And then, combining the test case and the interface mapping relation data with the changed interface information to determine the test case which is executed preferentially. And finally, carrying out interface recording when the recommended test case is executed, so as to update the test case and the interface mapping data based on the new recording data.
And step 103, determining the test case matched with the interface information to be tested in the interface information set to be tested by using the mapping relation between the interface and the test case, and obtaining a target test case set.
In some embodiments, the executing body may determine, by using a mapping relationship between the interface and the test case, a test case that matches with the interface information to be tested in the interface information set to be tested, so as to obtain the target test case set. The mapping relationship between the interface and the test case may include at least one mapping information pair. The mapping information pair in the mapping relation between the interface and the test case can comprise interface information and test case information. The interface information in the mapping relationship between the interface and the test case may include an interface number and an interface description. The test case information in the mapping relationship between the interface and the test case may include a case number and a case description.
As an example, the interface number in the interface information may be "1", and the interface description may be "/comm/getUserInfo". The interface information may be "1,/comm/getUserInfo". The case number in the test case information may be "1", and the case description may be "acquire user basic information". The test case information may be "1" to obtain user basic information "
In some optional implementations of some embodiments, before the acquiring the code to be tested and the baseline code of the code to be tested, the executing entity may execute the following steps:
first, a test case set is obtained. The test cases in the test case set may be pre-written.
And step two, executing each test case in the test case set to generate a mapping information pair in the mapping relation between the interface and the test case.
Optionally, the executing body executes each test case in the test case set to generate a mapping information pair in a mapping relationship between an interface and the test case, and may include the following steps:
in the first step, an interface recording tool is started to record an interface in response to determining that the test case starts to be executed. The interface recording can also be performed by a network request recording tool or other network monitoring tools. In the process of executing the test case, the interface recording tool, the network request recording tool or other network monitoring tools can record the information of the interface called in the process of executing the test case.
And secondly, closing the interface recording tool to stop interface recording and obtaining an interface recording result in response to the fact that the test case is completely executed. The interface recording result may be null or include at least one piece of interface information.
And thirdly, determining whether the interface recording is successful or not based on the interface recording result. If the interface recording result is null, it may indicate that the interface recording fails. If the interface recording result is not null, the interface recording success can be indicated.
And fourthly, combining the case information of the test case with each interface information in the interface recording result to obtain at least one mapping information pair in response to the fact that the interface recording is successful.
And 104, testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result.
In some embodiments, the executing body may test the code to be tested by using a target test case in the target test case set to obtain a test result, and may execute the following test steps for each target test case in the target test case set:
and firstly, responding to the determination that the target test case starts the test of the code to be tested, and starting the interface recording tool to record the interface.
And secondly, closing the interface recording tool to stop interface recording and obtaining a target interface recording result in response to determining that the test of the target test case on the code to be tested is finished. The target interface recording result may include at least one piece of interface information.
And thirdly, combining the case information of the target test case and the interface information in the recording result of the target interface to obtain at least one test mapping information pair.
And step four, adding the at least one test mapping information pair into the test result. Wherein, the test result may be initially empty.
In some optional implementations of some embodiments, the execution body may further execute each test case in the set of test cases to generate a mapping information pair in a mapping relationship between an interface and the test case in response to detecting an update operation on the set of test cases. Wherein, the updating operation may include: new additions, edits and modifications.
And 105, updating the mapping relation between the interface and the test case according to the test result.
In some embodiments, the updating, by the execution body, the mapping relationship between the interface and the test case according to the test result may include the following steps:
the first step is to compare the mapping information pairs in the mapping relation between the interface and the test case with the test mapping information pairs in the test result to obtain a change mapping information set. The change map information set may include new map information and deletion map information.
And updating the mapping relation between the interface and the test case according to the newly added mapping information and the deleted mapping information in the change mapping information set.
The above embodiments of the present disclosure have the following advantageous effects: according to the information updating method of some embodiments of the present disclosure, after the code of the developer is submitted, the interface affecting the software can be quickly found, and the related test cases are automatically executed, so that the case missing test phenomenon caused by experience judgment of the tester is avoided, and meanwhile, the software testing efficiency is greatly improved. Specifically, the reason why the related software testing method has the missing test phenomenon is that: during development, developers often modify the historical code of the software, which results in other functions being affected. If a tester writes test cases and tests only according to new requirements, other historical functions influenced by code change can be missed. Based on this, in the information updating method according to some embodiments of the present disclosure, first, a code to be tested and a baseline code of the code to be tested are obtained from a code library, where the code to be tested is a code file whose file content is changed. And then, determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested. Wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with the changed content of the code to be tested. Thus, the code to be tested and the baseline code determine the change range of the code, and accurate evaluation of the influence range of new code adjustment is realized. And then, determining the test case matched with the interface information to be tested in the interface information set to be tested by using the mapping relation between the interface and the test case, and obtaining a target test case set. And then, testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result. Thus, the relevant test cases are automatically recommended according to the code change range. And finally, updating the mapping relation between the interface and the test case according to the test result. Therefore, after the code of the research personnel is submitted, the interface affecting the software can be quickly found, the related test cases are automatically executed, the case missing test phenomenon caused by experience judgment of the test personnel is avoided, and meanwhile, the software testing efficiency is greatly improved.
With further reference to fig. 2, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of an information updating apparatus, which correspond to those method embodiments shown in fig. 1, and which are particularly applicable in various electronic devices.
As shown in fig. 2, the information updating apparatus 200 of some embodiments includes: the device comprises an acquisition unit 201, a first determination unit 202, a second determination unit 203, a test unit 204 and an updating unit 205, wherein the acquisition unit 201 is configured to acquire a code to be tested and a baseline code of the code to be tested from a code library, and the code to be tested is a code file with changed file content; a first determining unit 202 configured to determine interface information to be tested based on the code to be tested and the baseline code, and obtain an interface information set to be tested, where each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with a change content of the code to be tested; a second determining unit 203, configured to determine, by using a mapping relationship between the interface and the test case, a test case that matches with the interface information to be tested in the interface information set to be tested, so as to obtain a target test case set; the test unit 204 is configured to test the code to be tested by using the target test case in the target test case set to obtain a test result; and an updating unit 205 configured to update the mapping relationship between the interface and the test case according to the test result.
It will be appreciated that the elements described in the information updating apparatus 200 correspond to the respective steps in the method described with reference to fig. 1. Thus, the operations, features and advantages described above for the method are equally applicable to the information updating apparatus 200 and the units contained therein, and are not described herein.
Referring now to fig. 3, a schematic diagram of an electronic device 300 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 3 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 3, the electronic device 300 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various suitable actions and processes in accordance with a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic apparatus 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; and communication means 309. The communication means 309 may allow the electronic device 300 to be, among other things the devices communicate wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 300 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 3 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 309, or from storage device 308, or from ROM 302. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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. In some embodiments of 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. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a code to be tested and a base line code of the code to be tested from a code library, wherein the code to be tested is a code file with changed file content; determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested, wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with the changing content of the code to be tested; determining a test case matched with interface information to be tested in an interface information set to be tested by using a mapping relation between an interface and the test case to obtain a target test case set; testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result; and updating the mapping relation between the interface and the test case according to the test result.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, a first determination unit, a second determination unit, a test unit, and an update unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires a code to be tested and the base line code of the code to be tested" described above from a code library.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.

Claims (10)

1. An information updating method, comprising:
acquiring a code to be tested and a baseline code of the code to be tested from a code library, wherein the code to be tested is a code file with changed file content;
determining interface information to be tested based on the code to be tested and the baseline code to obtain an interface information set to be tested, wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with the changing content of the code to be tested;
determining a test case matched with interface information to be tested in an interface information set to be tested by using a mapping relation between an interface and the test case to obtain a target test case set;
testing the code to be tested by utilizing the target test cases in the target test case set to obtain a test result;
and updating the mapping relation between the interface and the test case according to the test result.
2. The method of claim 1, wherein the mapping relationship between the interface and the test case comprises at least one mapping information pair, the mapping information pair in the mapping relationship between the interface and the test case comprises interface information and test case information, the interface information in the mapping relationship between the interface and the test case comprises an interface number and an interface description, and the test case information in the mapping relationship between the interface and the test case comprises a case number and a case description; and
before the obtaining the code to be tested and the baseline code of the code to be tested, the method further comprises:
acquiring a test case set;
executing each test case in the test case set to generate a mapping information pair in the mapping relation between the interface and the test case.
3. The method of claim 2, wherein the executing each test case in the set of test cases to generate a mapping information pair in a mapping relationship of interfaces and test cases comprises:
in response to determining that the test case begins to execute, starting an interface recording tool to record an interface;
in response to determining that the test case is executed, closing the interface recording tool to stop interface recording and obtain an interface recording result, wherein the interface recording result is empty or comprises at least one piece of interface information;
determining whether the interface recording is successful or not based on the interface recording result;
and in response to determining that the interface recording is successful, combining the case information of the test case with each piece of interface information in the interface recording result to obtain at least one mapping information pair.
4. A method according to claim 3, wherein the method further comprises:
in response to detecting an update operation to the set of test cases, executing each test case in the set of test cases to generate a mapping information pair in a mapping relationship of an interface and the test case, wherein the update operation comprises: new additions, edits and modifications.
5. The method of claim 3, wherein updating the mapping between the interface and the test case according to the test result comprises:
comparing the mapping information pairs in the mapping relation between the interface and the test case with the test mapping information pairs in the test result to obtain a change mapping information set, wherein the change mapping information set comprises newly added mapping information and deleted mapping information;
and updating the mapping relation between the interface and the test case according to the newly added mapping information and the deleted mapping information in the change mapping information set.
6. The method of claim 3, wherein the testing the code to be tested with the target test cases in the target test case set to obtain a test result includes:
for each target test case in the target test case set, executing the following test steps:
responding to the determination that the target test case starts the test of the code to be tested, and starting the interface recording tool to record an interface;
in response to determining that the test of the code to be tested by the target test case is finished, closing the interface recording tool to stop interface recording, and obtaining a target interface recording result, wherein the target interface recording result comprises at least one piece of interface information;
combining the case information of the target test case and the interface information in the target interface recording result to obtain at least one test mapping information pair;
and adding the at least one test mapping information pair into the test result, wherein the test result is initially empty.
7. The method of claim 1, wherein the determining interface information to be tested based on the code to be tested and the baseline code, resulting in a set of interface information to be tested, comprises:
determining a local abstract syntax tree corresponding to the change content in the code to be tested to obtain a local change abstract syntax tree;
determining a local abstract syntax tree corresponding to the local change abstract syntax tree from the abstract syntax tree of the baseline code to obtain a local reference abstract syntax tree;
determining code change information based on the local change abstract syntax tree and the local reference abstract syntax tree, wherein the code change information comprises: class of change and method of change;
and determining interface information to be tested by using the baseline code and the code change information to obtain an interface information set to be tested.
8. An information updating apparatus comprising:
an acquisition unit configured to acquire a code to be tested and a baseline code of the code to be tested from a code library, wherein the code to be tested is a code file with changed file content;
a first determining unit configured to determine interface information to be tested based on the code to be tested and the baseline code, and obtain an interface information set to be tested, wherein each interface represented by the interface information to be tested in the interface information set to be tested is an interface associated with changing content of the code to be tested;
the second determining unit is configured to determine a test case matched with the interface information to be tested in the interface information set to be tested by using the mapping relation between the interface and the test case, so as to obtain a target test case set;
the test unit is configured to test the code to be tested by utilizing the target test cases in the target test case set to obtain a test result;
and the updating unit is configured to update the mapping relation between the interface and the test case according to the test result.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-7.
CN202310366026.7A 2023-04-07 2023-04-07 Information updating method, device, electronic equipment and computer readable medium Pending CN116450511A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310366026.7A CN116450511A (en) 2023-04-07 2023-04-07 Information updating method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310366026.7A CN116450511A (en) 2023-04-07 2023-04-07 Information updating method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN116450511A true CN116450511A (en) 2023-07-18

Family

ID=87135063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310366026.7A Pending CN116450511A (en) 2023-04-07 2023-04-07 Information updating method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN116450511A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627851A (en) * 2023-07-24 2023-08-22 恒生电子股份有限公司 Interface testing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627851A (en) * 2023-07-24 2023-08-22 恒生电子股份有限公司 Interface testing method and device
CN116627851B (en) * 2023-07-24 2023-10-20 恒生电子股份有限公司 Interface testing method and device

Similar Documents

Publication Publication Date Title
CN111625473B (en) Interface test case generation method and device, storage medium and electronic equipment
CN109302522B (en) Test method, test device, computer system, and computer medium
US9910941B2 (en) Test case generation
CN110083543B (en) Regression testing method, device, electronic equipment and storage medium
CN112597047B (en) Test method, test device, electronic equipment and computer readable medium
CN111209202A (en) Terminal application testing method and device
CN110674047B (en) Software testing method and device and electronic equipment
CN112596966B (en) Chip verification method, device, equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN116450511A (en) Information updating method, device, electronic equipment and computer readable medium
CN111367791B (en) Method, device, medium and electronic equipment for generating test case
CN112084114B (en) Method and apparatus for testing interfaces
CN112817864B (en) Method, device, equipment and medium for generating test file
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN114116480A (en) Method, device, medium and equipment for determining application program test coverage rate
CN111382056A (en) Service testing method and device, server and storage medium
CN113704020B (en) Method and device for analyzing error field data of solid state disk
CN116561015B (en) Map application testing method, electronic device and computer readable medium
CN116467178B (en) Database detection method, apparatus, electronic device and computer readable medium
CN111382057A (en) Test case generation method, test method and device, server and storage medium
CN113377677B (en) Unit testing method and device
CN115484200B (en) Buried point testing method, buried point testing device, server, storage medium and buried point testing system
CN114327475A (en) Function duplicate name checking method, device, equipment, readable storage medium and product
CN116501634A (en) Test case management method, device, medium and electronic equipment
CN115562959A (en) Method and device for verifying branch prediction function, electronic 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