CN111625446B - Software testing method and device, computer readable medium and electronic equipment - Google Patents

Software testing method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN111625446B
CN111625446B CN202010367697.1A CN202010367697A CN111625446B CN 111625446 B CN111625446 B CN 111625446B CN 202010367697 A CN202010367697 A CN 202010367697A CN 111625446 B CN111625446 B CN 111625446B
Authority
CN
China
Prior art keywords
software
tested
library
return value
function set
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.)
Active
Application number
CN202010367697.1A
Other languages
Chinese (zh)
Other versions
CN111625446A (en
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.)
KUKA Robot Manufacturing Shanghai Co Ltd
Original Assignee
KUKA Robot Manufacturing Shanghai 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 KUKA Robot Manufacturing Shanghai Co Ltd filed Critical KUKA Robot Manufacturing Shanghai Co Ltd
Priority to CN202010367697.1A priority Critical patent/CN111625446B/en
Publication of CN111625446A publication Critical patent/CN111625446A/en
Application granted granted Critical
Publication of CN111625446B publication Critical patent/CN111625446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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

The embodiment of the application provides a software testing method, a software testing device, a computer readable medium and electronic equipment. The software testing method comprises the following steps: creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions; loading the library function set and running library functions contained in the library function set; acquiring a return value obtained by running a library function in the library function set; and determining a test result of the software to be tested based on the return value. The technical scheme of the embodiment of the application improves the test coverage rate of the library function in the tested software, and further indirectly ensures the reliability of the product using the tested software.

Description

Software testing method and device, computer readable medium and electronic equipment
Technical Field
The present invention relates to the field of software testing, and in particular, to a method and apparatus for testing library functions, a computer readable medium, and an electronic device.
Background
The existing common systems such as Windows, linux have low real-time performance and delay communication. Some tasks with high real-time performance, such as online sorting of robots, cannot be completed.
Some existing automation equipment manufacturers use an autonomously designed language to develop software, when the autonomously designed language is used, a testing means of library functions written aiming at the traditional language cannot be used, in addition, library functions in some software to be tested need to be called when being executed, testing difficulty is increased, and therefore the detection coverage rate of the library functions is not high enough. The deficiency of the coverage rate of library function test directly affects the quality and reliability of software, and introduces a lot of uncertain risks for subsequent development and product use.
Disclosure of Invention
The embodiment of the application provides a software testing method, which can overcome the problem of low detection coverage rate of library functions in software to be tested at least to a certain extent.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the embodiments of the present application, there is provided a software testing method, including: creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions; loading the library function set and running library functions contained in the library function set; acquiring a return value obtained by running a library function in the library function set; and determining a test result of the software to be tested based on the return value.
According to an aspect of the embodiments of the present application, based on the foregoing solution, a software testing method is provided, and a test result of the software to be tested is determined based on the return value, including: if the type of the return value is a set type, comparing the return value with a preset value to obtain a comparison result; and determining a test result of the software to be tested based on the comparison result.
According to an aspect of the embodiments of the present application, based on the foregoing solution, a software testing method is provided, and based on the comparison result, determining a test result of the software to be tested includes: if the return value is matched with the preset value, judging that the software to be tested is tested normally; and if the return value is not matched with the preset value, judging that the software to be tested is abnormal in test.
According to one aspect of the embodiment of the application, a software testing method is provided, a library function set is created, global variables are created to serve as return values of the library function set, the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions; loading the library function set and running library functions contained in the library function set; acquiring a return value obtained by running a library function in the library function set; and determining a test result of the software to be tested based on the return value. Wherein the return value includes a cast exception; determining a test result of the software to be tested based on the return value, including: if the return value throws out the abnormality, matching is carried out according to an abnormality instance generated by the abnormality and a preset abnormality object to obtain a matching result; and determining a test result of the software to be tested based on the matching result.
According to an aspect of the embodiments of the present application, based on the foregoing solution, a software testing method is provided, and a test result of the software to be tested is determined based on a matching result, including: if the matching result shows that the abnormal instance is successfully matched with the preset abnormal object, judging that the software to be tested is tested normally; and if the matching result shows that the abnormal instance is not successfully matched with the preset abnormal object, judging that the software to be tested is abnormal.
According to some aspects of embodiments of the present application, based on the foregoing aspects, before running the library functions included in the library function set, the software testing method further includes: and establishing connection with a tested terminal, wherein the tested terminal comprises parameters for testing the library functions to be tested in the software to be tested.
According to an aspect of the embodiments of the present application, based on the foregoing solution, the tested terminal includes an industrial robot.
According to an aspect of the embodiments of the present application, there is provided a software testing apparatus, including:
the method comprises the steps of creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions;
the loading unit is used for loading the library function set and running library functions contained in the library function set;
the acquisition unit acquires a return value obtained by running the library functions in the library function set;
and the result determining unit is used for determining a test result of the software to be tested based on the return value.
According to an aspect of the embodiments of the present application, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a software testing method applied to a motion controller as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; and a storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the software testing method applied to a motion controller as described in the above embodiments.
In the technical solutions provided in some embodiments of the present application, a library function set is created to simulate a function library that is actually used subsequently, a global variable is created as a return value of the library function set, external call to an operation result is implemented, the library function set is loaded onto an automation device, library functions in the library function set are operated, a return value is obtained, and a test result for the software to be tested is determined based on the return value. Thereby improving the coverage rate of library function test in the tested software and further reducing the subsequent development or use risk of the tested software.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 2 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 3 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 4 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 5 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 6 illustrates a flow chart of a software testing method according to one embodiment of the present application;
FIG. 7 illustrates a block diagram of a software testing apparatus according to one embodiment of the present application;
FIG. 8 illustrates a block diagram of a software testing apparatus according to one embodiment of the present application;
fig. 9 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
The implementation details of the technical solutions of the embodiments of the present application are described in detail below:
FIG. 1 illustrates a flow chart of a software testing method that may be loaded onto a hardware device for operation according to one embodiment of the present application. Referring to fig. 1, the software testing method at least includes steps S110 to S140, and is described in detail as follows:
step S110, creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions;
step S120, loading the library function set and running the library functions contained in the library function set;
step S130, obtaining a return value obtained by running the library functions in the library function set;
and step S140, determining a test result of the software to be tested based on the return value.
Creating a library function set is to program some library functions into the same library function file. The names of the library functions and corresponding object codes are stored in the library function file. Each library function has definite functions, entry call parameters and return values, and can be called by different people. In one embodiment of the invention, a library function set is created, wherein the library function set comprises externally-dependent library functions to be tested in the software to be tested, and the externally-dependent library functions to be tested refer to library functions to be tested which need to execute program segments of other library functions in the software to be tested by calling sentences to complete set work in the execution process. The call may include one call or may include a plurality of calls. The collection of library functions is also a function with entry call parameters and return values. A global variable is created as a return value for the set of library functions. Variables are divided into global variables (external variables) and local variables (internal variables) by scope. The scope of a global variable starts from the location where it was defined until the end of the program file where it is located, the local variable is valid only within the function that defines it, and outside its scope the local variable is not visible. In this embodiment, a global variable is created as a return value of the tested library function set, and the scope of the global variable is a program designed and written for detecting the software to be tested from the start of defining the position of the global variable by the test program until the whole test program ends. The use of global variables can transfer data between library functions and test programs, and in addition, the type and initial value of the data to which the global variables are assigned need to be defined during creation.
The set of library functions is loaded. I.e. load library function files, which may be loaded during the running of the test program, for running the library functions contained in the set of library functions on the device, which may be a motion controller.
And running the library functions contained in the library function set. The library function set comprises externally-dependent library functions to be tested in the software to be tested, wherein the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions. The other library functions comprise other library functions in the current library function set and library functions in other library function sets in the software to be tested. And calling the library functions in the library function set through the calling statement in the test program to generate an execution result, and if the running library function is an externally-dependent library function and the called library function is in other library function sets of the software to be tested, declaring the variables used for returning by the called library function as global variables. As described above, when the execution result is saved in a global variable, the global variable may be called outside the library function file of the library function being called.
And obtaining a return value obtained by running the library functions in the library function set. After the test program executes the library function set, an execution return value of the library function set is obtained through external calling, and the execution return value is stored in a global variable. And further, determining a test result of the software to be tested based on the return value.
FIG. 2 shows a flow chart of a software testing method according to one embodiment of the present application, which is based on the software testing method shown in FIG. 1, step S140 includes the following steps;
step S210, if the type of the return value is a set type, comparing the return value with a preset value to obtain a comparison result;
step S220, determining a test result of the software to be tested based on the comparison result.
In one embodiment of the invention, a global variable is created as a return value of the set of library functions, including library functions that depend externally, the data type of which is defined and assigned an initial value while the variable is created. And running a library function set in the tested software through the test program to obtain a return value of the library function set, and if no abnormality occurs, the type of the running return value is consistent with the type of a preset global variable. And when the type of the return value after operation is consistent with the type of the preset global variable, comparing the return value with the preset value to obtain a comparison result. The preset value may be manually input or automatically generated by a program, and may be stored in another variable of the test program, which may be a global variable or a local variable.
And determining a test result of the software to be tested based on the comparison result. After the comparison result is obtained, determining the test result of the software to be tested based on a preset rule according to the comparison result. For example, the function of a certain library function is to take the square root, test data 9 is input, the expected calculation result is 3, and the preset rule is that if the return value is equal to the preset value, the function of the library function is normally operated. Then input 3 is needed, which is stored in a variable in advance, or automatically generated by a section of program for solving square root with confirmed function, the library function for solving square root is operated, if the return value of operation is 3, the result of testing the library function for solving square root is confirmed to be normal because the return value of operation is equal to the return value of operation.
Fig. 3 shows a flowchart of a software testing method according to an embodiment of the present application, which is based on the software testing method shown in fig. 2, and in an embodiment of the present invention, step S220 includes:
step S221, if the return value is matched with the preset value, judging that the software to be tested is tested normally;
step S222, if the return value does not match the preset value, determining that the software to be tested is abnormal.
If the returned value corresponds to the preset value, corresponds to the value including the value equal to or within the preset range, and the like, the software to be tested is indicated to reach the preset function, and the test result of the software to be tested can be judged to be normal. Otherwise, it is abnormal.
Fig. 4 is a flowchart of a software testing method according to an embodiment of the present application, where the software testing method is based on the software testing method shown in fig. 1, and step S140 includes step S310 and step S320 based on fig. 1 if the return value includes a throw exception.
S310, if the return value throws out an abnormality, matching is carried out according to an abnormality instance generated by the abnormality and a preset abnormality object, and a matching result is obtained;
s320, determining a test result of the software to be tested based on the matching result.
In some embodiments of the present invention, based on the software testing method shown in fig. 1, if the return value throws out an exception, the exception instance generated by the exception is matched with a preset exception object, so as to obtain a matching result. Some functions have thrown exceptions as part of the function, which indicate that the program has been subject to errors, but some exceptions may occur in some legitimate cases, such as a user name password error, account number absence, etc. When an abnormality occurs, checking the occurrence of the abnormality by using a preset statement, and matching the abnormality instance with a preset abnormality object to obtain a matching result. The preset abnormal object can be built-in the system or user-defined. For example, when the command exceeds the working range of the robot, the command is successfully matched with a preset out-of-range exception (outofrange), when the format of the input parameter is incorrect, the command is successfully matched with a preset parameter format incorrect exception (format exception), and the like, and the test result of the software to be tested is determined according to the matched result.
Fig. 5 shows a flow chart of a software testing method according to an embodiment of the present application, which is based on the software testing method shown in fig. 4, in an embodiment of the present invention, step S320 includes step S321 and step S322,
step S321, if the matching result shows that the abnormal instance and the preset abnormal object are successfully matched, judging that the software to be tested is tested normally;
and step S322, if the matching result shows that the abnormal instance is not successfully matched with the preset abnormal object, judging that the software to be tested is abnormal.
In one embodiment of the present invention, based on the foregoing software testing method, if the generated abnormal instance corresponds to one or more preset abnormal objects, that is, successfully matches, it may be indicated that the tested software can correctly capture the abnormality, or it may be indicated that the test result of the tested software is normal. Otherwise, the test is abnormal.
On the basis of the software testing method shown in fig. 1 to 5, fig. 6 shows a flowchart of the software testing method according to one embodiment of the present application, and in some embodiments of the present invention, the method further includes the following steps: s410, connection with a tested terminal is established, wherein the tested terminal comprises parameters for testing the library function to be tested in the software to be tested. Step S410 may follow step S110, before running the library functions included in the library function set in step S120.
On the basis of the software testing method shown in fig. 1 to 5, in the process of loading the library function set, the actual parameters of the terminal equipment can be used as the testing parameters of the tested library function set, and connection with the terminal equipment needs to be established at this time to obtain the parameters for testing the library function to be tested in the software to be tested, such as the maximum load, the degree of freedom, the fastest moving speed and the like. After the connection is established, a relevant configuration program needs to be run on the terminal device to enable signal interaction.
Based on the software testing method shown in fig. 6, in step S410, the tested terminal includes an industrial robot.
In some embodiments of the present invention, the terminal device under test comprises an industrial robot including a mechanical arm and a mobile robot based on the software testing method shown in fig. 6.
The motion controller (or motion control card) is an important part of the robot, and controls the behavior of the robot, so that in order to solve the problem of low real-time performance of the existing common systems, such as Windows, linux, some existing automation equipment manufacturers can program by adopting an autonomous design language, such as high-creation (Servotronix) for software development by using an autonomous design MC-BASIC. Manufacturers of automation equipment can add some common functions into library functions, such as some bottom basic library functions, mathematical optimization, linear algebra, equation solving, image processing, motion control and the like, so that subsequent users can conveniently use the library functions, however, a software program written by an autonomously designed language is used, the detection coverage rate of the library functions is not high, and the conventional testing method for the traditional language cannot be used. In addition, the tested software may have a tested library function which depends on the outside, namely, the designed software function can be realized by calling other library functions, so that the testing difficulty is increased. Therefore, before the software is loaded into the motion controller for practical use, the performance of the library functions of the control software needs to be tested to improve the stability of the performance of the subsequent robot product.
To improve test coverage of library functions in a library function set of software under test that are dependent on other library functions. Other library functions include other library functions in the set and other set of library functions in the software under test. Library functions written using MC-BASIC require loading to run on the controller. If the library functions of other sets are loaded, the tested external dependent library functions cannot realize the test target, and in order to solve the problem, whether the return value of the dependent library functions is a global variable needs to be confirmed, if not, the return value needs to be declared as the global variable. In one embodiment of the present application, a set of library functions is created, including library functions under test that are externally dependent, the set of library functions being used to simulate a library of functions that are subsequently in actual use. A global variable is created as a return value for the collection of library functions to ensure that the return value is invoked outside the collection. The library function set is loaded onto a motion controller, which is connected to the robot to test the software under test running in the motion controller using the actual parameters of the robot. Accordingly, some start-up configuration procedures need to be run on the robot, which contain parameters required for the transfer test. The tests may include a routine test and a special limit scenario test. A specific method for running a library function set, such as a motion control library function, comprises the following steps: and automatically generating joint points by using random numbers, running a motion control library function to control the robot joints to move, obtaining actual points of the robot joint motion through a feedback mechanism, comparing the actual points with randomly generated points, and if the actual points are matched with the randomly generated points, determining that the motion control function of the library function is normal. Otherwise, it is abnormal. If the joint point positions generated randomly exceed the reachable range of the robot, an abnormality is generated, and if the abnormal instance is matched with a preset abnormal object representing the out-of-range, the motion control function of the library function can be determined to be normal. Otherwise, determining the function of the motion control of the library function as abnormal.
The following describes an embodiment of an apparatus of the present application that may be used to perform the software detection method of the above-described embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the software detection method described in the present application.
FIG. 7 illustrates a block diagram of a software testing apparatus according to one embodiment of the present application.
Referring to fig. 7, a software detection device 700 according to an embodiment of the present application includes:
the creating unit 710 is configured to create a library function set, and create a global variable as a return value of the library function set, where the library function set includes an externally-dependent library function to be tested in the software to be tested, and the externally-dependent library function to be tested is a library function that needs to call other library functions to implement a software function;
a loading unit 720, configured to load the library function set, and run library functions included in the library function set;
an obtaining unit 730, configured to obtain a return value obtained by running a library function in the library function set;
and a result determining unit 740, configured to determine a test result of the software under test based on the return value.
In one embodiment of the present invention, the result determining unit 740 is further configured to: if the type of the return value is a set type, comparing the return value with a preset value to obtain a comparison result; and determining a test result of the software to be tested based on the comparison result.
In one embodiment of the present invention, the result determining unit 740 is further configured to: if the return value is matched with the preset value, judging that the software to be tested is tested normally; and if the return value is not matched with the preset value, judging that the software to be tested is abnormal in test.
In one embodiment of the present invention, the acquiring unit 730 is further configured to: the method comprises the steps of obtaining a return value obtained by running a library function in the library function set, wherein the return value comprises a throwing exception; the above result determining unit 740 is further configured to: if the return value throws out the abnormality, matching is carried out according to an abnormality instance generated by the abnormality and a preset abnormality object to obtain a matching result; the above result determining unit 740 is further configured to: and determining a test result of the software to be tested based on the matching result.
In one embodiment of the present invention, based on the foregoing scheme, the result determining unit 740 is further configured to: if the matching result shows that the abnormal instance is successfully matched with the preset abnormal object, judging that the software to be tested is tested normally; and if the matching result shows that the abnormal instance is not successfully matched with the preset abnormal object, judging that the software to be tested is abnormal.
FIG. 8 illustrates a block diagram of a software testing apparatus according to one embodiment of the present application.
Referring to fig. 8, a software detection device 800 according to one embodiment of the present application, shown in fig. 7, includes: on the basis of the creation unit 710, the loading unit 720, the acquisition unit 730, and the result determination unit 740, further includes: a connection unit 760 is established.
Based on the above-mentioned scheme, in one embodiment of the present invention, the connection unit 760 is configured to establish a connection with a terminal to be tested, where the terminal to be tested includes parameters for testing the library function to be tested in the software to be tested.
Based on the above, in one embodiment of the present invention, the connection establishment unit 760 is further configured to: and establishing connection with an industrial robot, wherein the industrial robot comprises parameters for testing library functions to be tested in the software to be tested.
Fig. 9 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
It should be noted that, the computer system 900 of the electronic device shown in fig. 9 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 900, the computer system 900 includes a central processing unit (Central Processing Unit, CPU) 901 which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 902 or a program loaded from a storage section 908 into a random access Memory (Random Access Memory, RAM) 903, for example, performing the methods described in the above embodiments. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, ROM902, and RAM 903 are connected to each other through a bus 904. An Input/Output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output section 907 including a speaker and the like, such as a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. When the computer program is executed by a Central Processing Unit (CPU) 901, various functions defined in the system of the present application are performed.
It should be noted that, the computer readable medium shown in the embodiments of the present application 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 (Erasable Programmable Read Only Memory, EPROM), 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 the context of this document, 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 the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program 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. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
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 application. Where 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.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; 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 implement the methods described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (9)

1. A software testing method, characterized in that the software testing method comprises:
creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions;
loading the library function set and running library functions contained in the library function set;
obtaining a return value obtained by running a library function in the library function set, wherein the return value comprises a throwing exception;
determining a test result of the software to be tested based on the return value;
the determining the test result of the software to be tested based on the return value comprises the following steps:
if the return value throws out the abnormality, matching is carried out according to an abnormality instance generated by the abnormality and a preset abnormality object to obtain a matching result;
and determining a test result of the software to be tested based on the matching result.
2. The software testing method according to claim 1, wherein determining a test result for the software under test based on the return value comprises:
if the type of the return value is a set type, comparing the return value with a preset value to obtain a comparison result;
and determining a test result of the software to be tested based on the comparison result.
3. The software testing method according to claim 2, wherein determining the test result of the software under test based on the comparison result comprises:
if the return value is matched with the preset value, judging that the software to be tested is tested normally;
and if the return value is not matched with the preset value, judging that the software to be tested is abnormal in test.
4. The software testing method according to claim 1, wherein determining the test result for the software under test based on the matching result comprises:
if the matching result shows that the abnormal instance is successfully matched with the preset abnormal object, judging that the software to be tested is tested normally;
and if the matching result shows that the abnormal instance is not successfully matched with the preset abnormal object, judging that the software to be tested is abnormal.
5. The software testing method according to any one of claims 1 to 4, characterized in that before running the library functions contained in the library function set, the software testing method further comprises:
and establishing connection with a tested terminal, wherein the tested terminal comprises parameters for testing the library functions to be tested in the software to be tested.
6. The software testing method of claim 5, wherein the terminal under test comprises an industrial robot.
7. A software testing apparatus, the software testing apparatus comprising:
the method comprises the steps of creating a library function set, and creating a global variable as a return value of the library function set, wherein the library function set comprises externally-dependent library functions to be tested in software to be tested, and the externally-dependent library functions to be tested are library functions which need to call other library functions to realize the software functions;
the loading unit is used for loading the library function set and running library functions contained in the library function set;
the acquisition unit is used for acquiring a return value obtained by running the library functions in the library function set, wherein the return value comprises a throwing exception;
the result determining unit is used for determining a test result of the software to be tested based on the return value, and is also used for matching an abnormal instance generated by the abnormality with a preset abnormal object to obtain a matching result if the return value throws the abnormality, and determining the test result of the software to be tested based on the matching result.
8. A computer readable medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the software testing method according to any one of claims 1 to 6.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the software testing method of any of claims 1 to 6.
CN202010367697.1A 2020-04-30 2020-04-30 Software testing method and device, computer readable medium and electronic equipment Active CN111625446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010367697.1A CN111625446B (en) 2020-04-30 2020-04-30 Software testing method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010367697.1A CN111625446B (en) 2020-04-30 2020-04-30 Software testing method and device, computer readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111625446A CN111625446A (en) 2020-09-04
CN111625446B true CN111625446B (en) 2023-05-23

Family

ID=72270150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010367697.1A Active CN111625446B (en) 2020-04-30 2020-04-30 Software testing method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111625446B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799763A (en) * 2021-01-28 2021-05-14 深圳希施玛数据科技有限公司 Function management method, management device, terminal equipment and readable storage medium
CN113407406B (en) * 2021-05-26 2023-06-23 中国联合网络通信集团有限公司 Abnormality monitoring method and abnormality monitoring system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997000477A1 (en) * 1995-06-16 1997-01-03 Lucent Technologies Checkpoint and restoration systems for execution control
CN101482847A (en) * 2009-01-19 2009-07-15 北京邮电大学 Detection method based on safety bug defect mode
CN108459958A (en) * 2017-12-08 2018-08-28 平安科技(深圳)有限公司 The creation method of function and performance test script, device, equipment and storage medium
CN108959103A (en) * 2018-07-31 2018-12-07 西安电子科技大学 Method for testing software based on BWDSP library function
CN109101410A (en) * 2017-06-20 2018-12-28 北京明略软件系统有限公司 A kind of risk driven test method and device and computer readable storage medium
CN109291055A (en) * 2018-11-29 2019-02-01 库卡机器人(广东)有限公司 Motion planning and robot control method, apparatus, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6948152B2 (en) * 2001-09-14 2005-09-20 Siemens Communications, Inc. Data structures for use with environment based data driven automated test engine for GUI applications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997000477A1 (en) * 1995-06-16 1997-01-03 Lucent Technologies Checkpoint and restoration systems for execution control
CN101482847A (en) * 2009-01-19 2009-07-15 北京邮电大学 Detection method based on safety bug defect mode
CN109101410A (en) * 2017-06-20 2018-12-28 北京明略软件系统有限公司 A kind of risk driven test method and device and computer readable storage medium
CN108459958A (en) * 2017-12-08 2018-08-28 平安科技(深圳)有限公司 The creation method of function and performance test script, device, equipment and storage medium
CN108959103A (en) * 2018-07-31 2018-12-07 西安电子科技大学 Method for testing software based on BWDSP library function
CN109291055A (en) * 2018-11-29 2019-02-01 库卡机器人(广东)有限公司 Motion planning and robot control method, apparatus, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于威胁模型的软件安全性测试;杨广华;齐璇;施寅生;;计算机安全(第02期);全文 *

Also Published As

Publication number Publication date
CN111625446A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN111625446B (en) Software testing method and device, computer readable medium and electronic equipment
CN109388569B (en) Method for remotely detecting environmental anomaly of client, test server and storage medium
CN113360144B (en) Auxiliary processing method, device, storage medium and program product for software development
CN111382077B (en) Application program crash reason positioning method and device, electronic equipment and storage medium
CN108572892B (en) PowerPC multi-core processor-based offline test method and device
CN113821433A (en) Method, device, equipment, medium and product for testing cloud mobile phone application program
CN115656788B (en) Chip testing system, method, equipment and storage medium
CN110609786A (en) Software testing method and device, computer equipment and storage medium
CN115470141A (en) Fault simulation method, device and related equipment
CN115562931A (en) Processor debugging module verification method and device, electronic equipment and storage medium
CN113568834A (en) SDK code compatibility detection method, device, computer equipment and medium
KR102002545B1 (en) Code test automatic proceeding method through virtualixation and appratus for the same
CN110928798A (en) Code testing method, device and equipment
KR101761732B1 (en) Apparatus and method for detecting error of application source code
CN115145464B (en) Page testing method and device, electronic equipment and storage medium
CN117170987B (en) Monitoring method, system and related equipment of embedded real-time operating system
CN114020164B (en) Stylus control method and device, electronic equipment and storage medium
CN114327648B (en) Driving debugging method and device, electronic equipment and storage medium
CN114064508B (en) Mobile terminal software testing method and system based on group control technology
CN111857664B (en) Application development method, device, equipment and storage medium
CN113626332B (en) Debugging method, device, equipment, storage medium and computer program product
CN112882945B (en) Applet data processing method, device, equipment and storage medium
CN111782282B (en) Start program loading method and device, electronic equipment and storage medium
CN116991721A (en) Automatic network page testing method and device, electronic equipment and storage medium
CN114490422A (en) Method for monitoring files in industrial software by using Makefile

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
GR01 Patent grant
GR01 Patent grant