CN111625446A - 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
CN111625446A
CN111625446A CN202010367697.1A CN202010367697A CN111625446A CN 111625446 A CN111625446 A CN 111625446A CN 202010367697 A CN202010367697 A CN 202010367697A CN 111625446 A CN111625446 A CN 111625446A
Authority
CN
China
Prior art keywords
software
tested
library function
library
return value
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.)
Granted
Application number
CN202010367697.1A
Other languages
Chinese (zh)
Other versions
CN111625446B (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 Robotics China Co Ltd
Original Assignee
KUKA Robotics China 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 Robotics China Co Ltd filed Critical KUKA Robotics China 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 and 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 a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions; loading the library function set, and operating the library functions contained in the library function set; obtaining a return value obtained by running the library functions in the library function set; and determining a test result of the software to be tested based on the return value. According to the technical scheme of the embodiment of the application, the test coverage rate of the library function in the tested software is improved, and the reliability of a product of the tested software in subsequent use is indirectly ensured.

Description

Software testing method and device, computer readable medium and electronic equipment
Technical Field
The present application relates to the field of software testing, and in particular, to a method and an apparatus for testing library functions, a computer-readable medium, and an electronic device.
Background
The real-time performance of the existing common systems such as Windows and Linux is not high, and communication is delayed. Some tasks with higher real-time performance, such as on-line sorting by robots, cannot be completed.
Some existing automation equipment manufacturers use an autonomously designed language to develop software, and when the autonomously designed language is used, a test means for library functions written in a traditional language cannot be used. The insufficient coverage rate of the library function test directly affects the quality and reliability of software, and introduces a plurality of uncertain risks to subsequent development and product use.
Disclosure of Invention
The embodiment of the application provides a software testing method, and the testing method can overcome the problem of low coverage rate of library function detection 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 by practice of the application.
According to an aspect of an embodiment 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 a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions; loading the library function set, and operating the library functions contained in the library function set; obtaining a return value obtained by running the library functions 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, there is provided a software testing method for determining a test result of software to be tested 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, there is provided a software testing method, determining a testing result of the software to be tested based on the comparison result, including: if the return value is matched with the preset value, judging that the test of the software to be tested is normal; and if the return value is not matched with the preset value, judging that the test of the software to be tested is abnormal.
According to an aspect of the embodiments of the present application, a software testing method is provided, in which a library function set is created, and a global variable is created as a return value of the library function set, where the library function set includes a library function to be tested that is externally dependent in software to be tested, and the library function to be tested that is externally dependent is a library function that needs to call other library functions to implement software functions; loading the library function set, and operating the library functions contained in the library function set; obtaining a return value obtained by running the library functions 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 comprises a throw exception; determining a test result for the software under test based on the return value, including: if the return value throws an exception, matching an exception instance generated according to the exception with a preset exception 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, there is provided a software testing method for determining a testing result of software to be tested 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 example is unsuccessfully matched with the preset abnormal object, judging that the software to be tested is abnormal in test.
According to some aspects of the embodiments of the present application, based on the above aspects, before the library functions included in the library function set are run, the software testing method further includes: and establishing connection with a tested terminal, wherein the tested terminal comprises parameters for testing the library function to be tested in the software to be tested.
According to an aspect of an embodiment of the present application, based on the foregoing solution, the terminal under test includes an industrial robot.
According to an aspect of an embodiment of the present application, there is provided a software testing apparatus including:
the system comprises a creating unit, a processing unit and a processing unit, wherein the creating unit is used for creating a library function set and creating a global variable as a return value of the library function set, the library function set comprises a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions;
the loading unit loads the library function set and runs the library functions contained in the library function set;
the acquisition unit is used for acquiring a return value obtained by operating the library function in the library function set;
and the result determining unit is used for determining the test result of the software to be tested based on the return value.
According to an aspect of an embodiment of the present application, there is provided a computer readable medium on which a computer program is stored, the computer program, when executed by a processor, implementing the software testing method applied to a motion controller as described in the above embodiment.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device 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 the 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 to be subsequently and actually used, 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 on automation equipment, a library function in the library function set is operated to obtain a return value, and a test result for the software to be tested is determined based on the return value. Therefore, the coverage rate of the library function test in the software to be tested is improved, and the risk of subsequent development or use of the software to be tested is reduced.
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 present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 2 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 3 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 4 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 5 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 6 shows a flow diagram of a software testing method according to an embodiment of the present application;
FIG. 7 shows a block diagram of a software testing device according to an embodiment of the present application;
FIG. 8 shows a block diagram of a software testing device according to an embodiment of the present application;
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 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 application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to 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 actual execution sequence may be changed according to the actual situation.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 1 shows a flowchart of a software testing method according to an embodiment of the present application, which can be loaded to a hardware device for operation. Referring to fig. 1, the software testing method at least includes steps S110 to S140, which are 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 a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions;
step S120, loading the library function set and operating the library functions contained in the library function set;
step S130, obtaining a return value obtained by operating the library function 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 library function file stores the names of the library functions and corresponding object codes. Each library function has definite functions, entrance call parameters and return values, and can be called by different people. In an embodiment of the present invention, a library function set is created, where the library function set includes a library function to be tested that is externally dependent in software to be tested, and the library function to be tested that is externally dependent refers to a library function to be tested that needs to execute a program segment of another library function in the software to be tested by calling a statement to complete a predetermined work in an execution process. The call may comprise one call or a plurality of calls. The set of library functions is also a function with an entry call parameter and a return value. Creating a global variable as a return value for the set of library functions. Variables are classified by scope into global variables (external variables) and local variables (internal variables). The scope of a global variable starts from the position where it is defined until the end of the program file in which it is located, the local variable is only valid 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 a library function set under test, a scope of the global variable is defined by a test program from the beginning of a position where the global variable is defined until the end of the whole test program, and the test program is a program designed and written for detecting software to be tested. The use of global variables allows data to be transferred between library functions, between library functions and test programs, and also defines the type and initial value of data to which the global variable is assigned when created.
The set of library functions is loaded. I.e. loading a library function file, which may be loaded during the running of the test program, in order to run the library functions contained in the set of library functions on the device, which may be a motion controller.
And executing the library functions contained in the library function set. The library function set comprises a library function to be tested which is externally dependent in the software to be tested, and the library function to be tested which is externally dependent is a library function which needs 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 a calling statement in the test program to generate an execution result, and if the running library functions are externally dependent library functions and the called library functions are in other library function sets of the software to be tested, declaring variables used for returning by the called library functions 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 called library function.
And obtaining a return value obtained by operating the library functions in the library function set. And after the test program executes the library function set, acquiring an execution return value of the library function set through external calling, wherein the execution return value is stored in a global variable. Based on the return value, further, a test result of the software to be tested is determined.
Fig. 2 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. 1, and 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 the test result of the software to be tested based on the comparison result.
In an embodiment of the present invention, a global variable is created as a return value of the library function set, the library function includes an externally dependent library function, and a data type of the variable needs to be defined and an initial value needs to be assigned 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, wherein if no abnormity 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 the 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 can be manually input or automatically generated through a program, and the preset value can be stored in another variable of the test program, wherein the variable can be a global variable or a local variable.
And determining a test result of the software to be tested based on the comparison result. And 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, a library function is to find a square root, input test data 9, expect a calculation result of 3, and a preset rule is to indicate that the library function is operating normally if a return value is equal to a preset value. Inputting 3, storing it in a variable in advance, or automatically generating by a section of program for solving square root with confirmed normal function, running the library function for solving square root, if the running return value is 3, determining that the test result of the function of the library function for solving square root is normal.
Fig. 3 shows a flowchart of a software testing method according to an embodiment of the present application, the software testing method is based on the software testing method shown in fig. 2, and in an embodiment of the present invention, on the basis of the software testing method shown in fig. 2, step S220 includes:
step S221, if the return value is matched with the preset value, judging that the test of the software to be tested is normal;
step S222, if the return value is not matched with the preset value, judging that the software to be tested is abnormal in test.
If the returned value corresponds to the preset value, corresponds to the preset range and the like, the software to be tested reaches 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 illustrating a software testing method according to an embodiment of the present application, where the software testing method is based on the software testing method illustrated in fig. 1, and if the return value includes a throw exception, step S140 includes step S310 and step S320 based on fig. 1.
S310, if the returned value throws an exception, matching an exception instance generated according to the exception with a preset exception object to obtain a matching result;
and 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 returned value throws an exception, matching is performed between an exception instance generated by the exception and a preset exception object to obtain a matching result. Some functions are part of a function that throws exceptions that indicate that a program has been corrupted, but some exceptions may also occur in some legitimate cases, such as a username-password error, an account not present, and so on. When an exception occurs, the exception is checked by using a preset statement, and the exception instance is matched with the preset exception object to obtain a matching result. The preset abnormal object can be built in the system or can be customized by the user. For example, when the instruction exceeds the working range of the robot, the matching with the preset out-of-range exception (outofrangeexception) is successful, when the format of the input parameter is incorrect, the matching with the preset parameter format incorrect exception (format exception) is successful, and the like, according to the matching result, the test result of the software to be tested is determined.
Fig. 5 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. 4, and in an embodiment of the present invention, includes step S321 and step S322 in step S320,
step S321, if the matching result shows that the abnormal instance is successfully matched with the preset abnormal object, judging that the test of the software to be tested is normal;
step S322, if the matching result shows that the matching between the abnormal instance and the preset abnormal object is unsuccessful, determining that the software to be tested is abnormal in test.
In an embodiment of the present invention, based on the foregoing software testing method, if the generated exception instance corresponds to one or more preset exception objects, i.e. successfully matches, it may indicate that the software under test can correctly capture the exception, and may also indicate that the test result of the software under test 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 a software testing method according to an embodiment of the present application, and in some embodiments of the present invention, further includes the following steps: and S410, establishing connection with a tested terminal, wherein the tested terminal comprises parameters for testing a library function to be tested in the software to be tested. Step S410 may be after step S110, before the library functions included in the library function set are run 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 test parameters of the library function set to be tested may use the actual parameters of the terminal device, and at this time, a connection with the terminal device needs to be established to obtain parameters, such as the maximum load, the degree of freedom, the fastest moving speed, and the like, for testing the library function to be tested in the software to be tested. After the connection is established, a relevant configuration program needs to be run on the terminal device to realize the interaction of the signals.
On the basis of the software testing method shown in fig. 6, in step S410, the terminal under test includes an industrial robot.
In some embodiments of the present invention, based on the software testing method shown in fig. 6, the terminal device to be tested includes an industrial robot including a robot arm and a mobile robot.
The motion controller (or motion control card) is an important component of the robot, controls the behavior of the robot, and in order to solve the problem that the real-time performance of the existing common systems such as Windows and Linux is not high, some existing automation equipment manufacturers can adopt an autonomously designed language to program, for example, a highly-invasive (servtronix) software development is carried out by using an autonomously designed MC-BASIC. Manufacturers of automation equipment can add some common functions into library functions, such as some underlying basic library functions, mathematical optimization, linear algebra, equation solution, image processing, motion control and the like, so as to facilitate the use of subsequent users, however, software programs written in languages designed autonomously are used, so that the detection coverage rate of the library functions is not high, and the existing test method aiming at the traditional languages cannot be used. In addition, there may be a tested library function that is externally dependent in the tested software, that is, the software function that needs to be designed only by calling other library functions is realized, which increases the testing difficulty. Therefore, before the software is loaded to a motion controller for actual use, the performance of the library function of the control software needs to be tested so as to improve the stability of the performance of subsequent robot products.
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 collection and other collection 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 available, only the tested externally-dependent library function is loaded, so that the test target cannot be realized. In one embodiment of the present application, a set of library functions is created that includes the externally dependent library function under test, which is used to simulate the library of functions that will be subsequently used in practice. A global variable is created as a return value for the set of library functions to ensure that the return value is called outside the set. And loading the library function set onto a motion controller, and establishing a connection between the motion controller and the robot so as to test the software to be tested running in the motion controller by using the actual parameters of the robot. Accordingly, some start-up configuration program is required to be run for the robot, and the parameters required by the transfer test are included in the configuration program. The tests may include a normative test and a special limit scenario test. The method for operating the library function set, such as the motion control library function, comprises the following steps: the method comprises the steps of automatically generating joint point positions by using random numbers, operating a motion control library function to control robot joints to move, obtaining actual point positions of robot joint motion through a feedback mechanism, comparing the actual point positions with randomly generated point positions, and determining that the motion control function of the library function is normal if the actual point positions are matched with the randomly generated point positions. Otherwise, it is abnormal. If the randomly generated joint point position exceeds the reachable range of the robot, an abnormality is generated, and if the abnormal example is matched with a preset abnormal object which represents the out-of-range, the motion control function of the library function can be determined to be normal. Otherwise, the function of the motion control of the library function is determined to be abnormal.
The following describes embodiments of the apparatus of the present application, which may be used to perform the software detection method in the above embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the software detection method described above in the present application.
FIG. 7 shows a block diagram of a software testing device according to an embodiment of the present application.
Referring to fig. 7, a software detection apparatus 700 according to an embodiment of the present application includes:
a creating unit 710, 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 a library function to be tested that is externally dependent in software to be tested, and the library function to be tested that is externally dependent 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 the 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;
a result determining unit 740, configured to determine a test result for the software to be tested based on the return value.
In an 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 an 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 test of the software to be tested is normal; and if the return value is not matched with the preset value, judging that the test of the software to be tested is abnormal.
In an embodiment of the present invention, the obtaining 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 result determination unit 740 is further configured to: if the return value throws an exception, matching an exception instance generated according to the exception with a preset exception object to obtain a matching result; the result determination unit 740 is further configured to: and determining a test result of the software to be tested based on the matching result.
In an 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 example is unsuccessfully matched with the preset abnormal object, judging that the software to be tested is abnormal in test.
FIG. 8 shows a block diagram of a software testing device according to an embodiment of the present application.
Referring to fig. 8, a software detection apparatus 800 according to an embodiment of the present application is shown in fig. 7 and includes: on the basis of the creating unit 710, the loading unit 720, the obtaining unit 730 and the result determining unit 740, the method further includes: a connection unit 760 is established.
Based on the above solution, in an embodiment of the present invention, the connection unit 760 is configured to establish a connection with a terminal under test, where the terminal under test includes a parameter for testing a library function to be tested in the software under test.
Based on the above solution, in an embodiment of the present invention, the connection establishing unit 760 is further configured to: and establishing a connection with an industrial robot, wherein the industrial robot comprises parameters for testing the library function to be tested in the software to be tested.
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment 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 bring any limitation to the functions and the scope of the application of the embodiments.
As shown in fig. 900, computer system 900 includes a Central Processing Unit (CPU)901, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for system operation are also stored. The CPU 901, ROM902, and RAM 903 are connected to each other via 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 portion 906 including a keyboard, a mouse, and the like; an output section 907 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 908 including a hard disk and 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 necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams 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 illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 901.
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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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), a 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 present application, 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 this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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. The computer program embodied on the 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 flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. 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 described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute 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 invention 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 invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

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 a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions;
loading the library function set, and operating the library functions contained in the library function set;
obtaining a return value obtained by running the library functions in the library function set;
and determining a test result of the software to be tested based on the return value.
2. The method for testing software 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 method for testing software according to claim 2, wherein determining the test result of the software to be tested based on the comparison result comprises:
if the return value is matched with the preset value, judging that the test of the software to be tested is normal;
and if the return value is not matched with the preset value, judging that the test of the software to be tested is abnormal.
4. The software testing method of claim 1, wherein the return value comprises a throw exception; determining a test result for the software under test based on the return value, including:
if the return value throws an exception, matching an exception instance generated according to the exception with a preset exception object to obtain a matching result;
and determining a test result of the software to be tested based on the matching result.
5. The software testing method of claim 4, wherein determining the testing result of the software to be tested 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 example is unsuccessfully matched with the preset abnormal object, judging that the software to be tested is abnormal in test.
6. The software testing method according to any one of claims 1 to 5, wherein before the library functions included in the library function set are run, the software testing method further comprises:
and establishing connection with a tested terminal, wherein the tested terminal comprises parameters for testing the library function to be tested in the software to be tested.
7. The software testing method of claim 6, wherein the terminal under test comprises an industrial robot.
8. A software testing apparatus, characterized in that the software testing apparatus comprises:
the system comprises a creating unit, a processing unit and a processing unit, wherein the creating unit is used for creating a library function set and creating a global variable as a return value of the library function set, the library function set comprises a library function to be tested which is externally dependent in software to be tested, and the library function to be tested which is externally dependent is a library function which needs to call other library functions to realize software functions;
the loading unit loads the library function set and runs the library functions contained in the library function set;
the acquisition unit is used for acquiring a return value obtained by operating the library function in the library function set;
and the result determining unit is used for determining the test result of the software to be tested based on the return value.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out a software testing method according to any one of claims 1 to 7.
10. 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 a software testing method as claimed in any one of claims 1 to 7.
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 true CN111625446A (en) 2020-09-04
CN111625446B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407406A (en) * 2021-05-26 2021-09-17 中国联合网络通信集团有限公司 Abnormity monitoring method and abnormity monitoring system
CN114327710A (en) * 2021-01-28 2022-04-12 深圳希施玛数据科技有限公司 Function management method, management device, terminal equipment and readable storage medium

Citations (7)

* 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
US20030052917A1 (en) * 2001-09-14 2003-03-20 David Dubovsky Data structures for use with environment based data driven automated test engine for GUI applications
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

Patent Citations (7)

* 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
US20030052917A1 (en) * 2001-09-14 2003-03-20 David Dubovsky Data structures for use with environment based data driven automated test engine for GUI applications
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 (2)

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

Cited By (4)

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

Also Published As

Publication number Publication date
CN111625446B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN111625446B (en) Software testing method and device, computer readable medium and electronic equipment
CN112100072B (en) Static detection method, device, equipment and medium for application program code
CN110673936B (en) Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment
CN108959064B (en) Popup window processing method and device for automatic test
CN113377484A (en) Popup window processing method and device
CN115437336A (en) Test method and device for test case, 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
CN117555720B (en) Code repairing method, device, equipment and medium
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN111476349A (en) Model testing method and server
CN114237182B (en) Robot scheduling method and system
CN115062304A (en) Risk identification method and device, electronic equipment and readable storage medium
CN113568834A (en) SDK code compatibility detection method, device, computer equipment and medium
CN110032624B (en) Sample screening method and device
CN111752823A (en) Method, device and equipment for testing vehicle-mounted power supply application software
CN110928798A (en) Code testing method, device and equipment
KR101761732B1 (en) Apparatus and method for detecting error of application source code
CN115695504B (en) Internet of things platform communication method, device, equipment and storage medium
CN115374015B (en) Testing method, testing simulation device and medium for scheduling algorithm
CN117573089A (en) Method and device for generating communication protocol stack code, electronic equipment and storage medium
CN111174744B (en) Method for screening and calculating physical spacing between test points on PCB
CN114238075A (en) Method, device, equipment, medium and product for testing program component
US20240037012A1 (en) Computer-implemented method for verifying a software component of an automated driving function
CN118193383A (en) Fuzzy test system and method for real-time operation system

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