CN114168470A - Software system testing method and device, electronic equipment and storage medium - Google Patents

Software system testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114168470A
CN114168470A CN202111487141.7A CN202111487141A CN114168470A CN 114168470 A CN114168470 A CN 114168470A CN 202111487141 A CN202111487141 A CN 202111487141A CN 114168470 A CN114168470 A CN 114168470A
Authority
CN
China
Prior art keywords
test
software system
script
recording
menu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111487141.7A
Other languages
Chinese (zh)
Inventor
靳丽斯
李龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Caxa Technology Co Ltd
Original Assignee
Caxa Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Caxa Technology Co Ltd filed Critical Caxa Technology Co Ltd
Priority to CN202111487141.7A priority Critical patent/CN114168470A/en
Publication of CN114168470A publication Critical patent/CN114168470A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a software system testing method and device, electronic equipment and a storage medium. The test method comprises the following steps: analyzing whether a menu tool of each test object in the specified software system can be identified by adopting the current recording script or not; under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, calling an object operation plug-in, wherein an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in advance; and executing an operation command of a menu tool in the target test object by adopting the object operation plug-in, and combining a recorded case test result of the test case to obtain a system automation test report. Therefore, the automatic test can be normally carried out, and an automatic test report is obtained after the execution is finished.

Description

Software system testing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of system testing, in particular to a software system testing method and device, electronic equipment and a storage medium.
Background
With the adoption of more and more software enterprises for carrying out automatic testing by adopting tools, in the process of writing and recording scripts for various automatic testing tools based on GUI objects, more or less UI objects are always found to be present and can not be correctly recorded/identified, so that the automatic testing can not be normally carried out.
In the related art, when a script is recorded by an automated testing tool based on a GUI object, the automated testing tool is often based on an object command, such as a so-called "context mode" normal recording mode, and a phenomenon that a right-click menu and a secondary menu are not successfully recorded often occurs in the normal recording mode, for example, for a secondary menu and a tertiary menu of PLM software, such a right-click menu or a right-click secondary menu and a tertiary menu all have a special point, a menu is easy to disappear after a mouse is moved, and a phenomenon that such a right-click option menu cannot be recognized and recorded often occurs, so that part of functions of a product cannot be covered by an automated test, a manual substitution test is required, and a workload is additionally increased.
Therefore, it is necessary to solve the problem that if a phenomenon that part of UI objects cannot be identified occurs during the process of recording a script by an automatic test tool, a mouse and keyboard event plug-in is additionally generated to identify UI objects in the automatic test tool.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a testing method and device of a software system, electronic equipment and a storage medium, which at least solve the technical problems that in the related technology, a testing tool cannot identify part of testing objects in the process of recording scripts, the part of testing objects cannot execute automatic testing, manual replacement testing is required, and the workload is additionally increased.
According to an aspect of an embodiment of the present invention, there is provided a method for testing a software system, including: analyzing whether a menu tool of each test object in a specified software system can be identified by adopting a current recording script, wherein the recording script is used for recording the process of each test case when the test is executed, and the test case refers to the function test of a plurality of test objects in the specified software system; under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, calling an object operation plug-in, wherein an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in advance; and executing an operation command of a menu tool in the target test object by adopting the object operation plug-in, and obtaining a system automation test report by combining the recorded case test result of the test case.
Optionally, before analyzing whether the menu tool of each test object in the specified software system can be identified by using the currently recorded script, the test method further includes: acquiring a plurality of available operation commands of the specified software system; determining an operation function of an operation main body of the external operation equipment when each available operation command is completed on a system interface of the specified software system; and encapsulating the operation function corresponding to each available operation command to obtain the object operation plug-in.
Optionally, in a case that a menu tool in a target test object in the specified software system cannot be identified by using the current recorded script, the test method further includes: acquiring an equipment path recording strategy, wherein the equipment path recording strategy is used for indicating that an interface of external equipment in a software system is adopted to designate a coordinate position for operation; and switching the script recording strategy adopting the current recording script into the equipment path recording strategy so as to identify the menu tool in the target test object in the specified software system.
Optionally, before analyzing whether the menu tool of each test object in the specified software system can be identified by using the currently recorded script, the test method further includes: acquiring product testing requirements, and compiling at least one test case based on the product testing requirements; and recording the process of each test case when the test is executed, and generating the recording script.
Optionally, after generating the recording script, the testing method further includes: adding test objects appearing in the specified software system to an object library; analyzing the occurrence frequency of each test object in the object library in a plurality of recording scripts respectively; and setting the test object with the occurrence frequency larger than a first preset frequency threshold value as a shared object.
Optionally, after generating the recording script, the testing method further includes: performing generalized packaging and functional packaging on the recording script, wherein the generalized packaging means packaging the test cases with the occurrence times larger than a second preset time threshold value, and the functional packaging means performing function packaging on serial test cases; analyzing the script type of the packaged recording script; and classifying the plurality of recording scripts according to the script types.
Optionally, the menu tools included in the test object are categorized into a plurality of menu levels and/or a keyboard and mouse menu set.
According to another aspect of the embodiments of the present invention, there is also provided a test apparatus for a software system, including: the system comprises an analysis unit, a storage unit and a control unit, wherein the analysis unit is used for analyzing whether a menu tool of each test object in a specified software system can be identified by adopting a current recording script, the recording script is used for recording the process of each test case when the test is executed, and the test case is used for performing functional test on a plurality of test objects in the specified software system; the system comprises a calling unit and an object operation plug-in unit, wherein the calling unit is used for calling an object operation plug-in unit under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, and an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in unit in advance; and the determining unit is used for executing an operation command of a menu tool in the target test object by adopting the object operation plug-in and obtaining a system automation test report by combining the recorded case test result of the test case.
Optionally, the testing apparatus of the software system further includes: the system comprises a first acquisition unit, a second acquisition unit and a control unit, wherein the first acquisition unit is used for acquiring a plurality of available operation commands of a specified software system before analyzing whether a menu tool of each test object in the specified software system can be identified by adopting a current recording script; the first determination module is used for determining an operation function of an operation main body of the external operation equipment when each available operation command is completed on a system interface of the specified software system; and the first encapsulation module is used for encapsulating the operation function corresponding to each available operation command to obtain the object operation plug-in.
Optionally, the testing apparatus of the software system further includes: the second obtaining unit is used for obtaining an equipment path recording strategy under the condition that a menu tool in a target test object in the specified software system cannot be identified by adopting the current recording script, wherein the equipment path recording strategy is used for indicating that an interface of external equipment in the software system is used for specifying a coordinate position to operate; and the switching module is used for switching the script recording strategy adopting the current recording script into the equipment path recording strategy so as to identify the menu tool in the target test object in the specified software system.
Optionally, the testing apparatus of the software system further includes: the third acquisition unit is used for acquiring product test requirements before analyzing whether the menu tool of each test object in the specified software system can be identified by adopting the current recording script, and compiling at least one test case based on the product test requirements; and the first generation module is used for recording the process of each test case during test execution and generating the recording script.
Optionally, the testing apparatus of the software system further includes: the adding module is used for adding the test object appearing in the specified software system into an object library after the recording script is generated; the first analysis module is used for analyzing the occurrence frequency of each test object in the object library in a plurality of recording scripts respectively; and the setting module is used for setting the test object with the occurrence frequency larger than a first preset frequency threshold value as a shared object.
Optionally, the testing apparatus of the software system further includes: the second packaging module is used for performing generalized packaging and functional packaging on the recording script after the recording script is generated, wherein the generalized packaging means packaging the test cases with the occurrence frequency larger than a second preset frequency threshold value, and the functional packaging means performing function packaging on the serial test cases; the second analysis module is used for analyzing the script type of the packaged recording script; and the classification module is used for classifying the plurality of recording scripts according to the script types.
Optionally, the menu tools included in the test object are categorized into a plurality of menu levels and/or a keyboard and mouse menu set.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of testing a software system of any of the above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the software system testing method described in any one of the above.
The method comprises the steps of adopting a menu tool for analyzing whether a current recording script can identify each test object in a specified software system, calling an object operation plug-in under the condition that the current recording script cannot identify the menu tool in a target test object in the specified software system, wherein the object operation plug-in is pre-packaged with an operation command for simulating external operation equipment to the specified software system, adopting the object operation plug-in to execute the operation command for the menu tool in the target test object, and combining a recorded case test result of a test case to obtain a system automation test report. In the application, under the condition that the menu tool in the target test object in the specified software system can not be identified by adopting the current recorded script, the menu tool in the test object can be operated by the object operation plug-in, therefore, the automatic test can be normally carried out, the application can realize the operation of a specific software system through the packaged object operation plug-in unit, realize the automatic identification of partial test objects, reduce the manual test action, reduce the manual workload, improve the test working efficiency, normally carry out the automatic test, obtain an automatic test report after the execution is finished, thereby solving the problem that the test tool in the related technology can not identify part of the test objects in the process of recording the script, the part of test objects can not execute the automatic test, and manual replacement test is needed, so that the technical problem of extra workload is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of an alternative method of testing a software system according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative method of testing a software system according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an alternative software system testing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The present invention can be applied to automated testing of various software systems, including but not limited to: drawing software, a product management system (such as a PLM system) and an office software system (such as a word operating system) can automatically identify menu tools (such as a secondary menu/right-click menu) of partial test objects (such as interface design UI objects), so that the automatic test efficiency is improved.
Based on the test mode of the existing automatic test tool, the test mode of the existing automatic test tool comprises but is not limited to: a test mode based on an object command and a test mode based on a physical path of the mouse. In the prior art, a test mode of an existing automatic test tool is adopted, so that a phenomenon that a menu tool (for example, a secondary menu/right-click menu) of a part of test objects (for example, interface design UI objects) is recorded unsuccessfully occurs, so that part of functions of a product cannot be covered by the automatic test, manual replacement test is required, and workload is additionally increased. The invention can provide an object operation plug-in, wherein the object operation plug-in is pre-packaged with an operation command simulating an external operation device to a specified software system, the operation command of a menu tool in a target test object is executed through the object operation plug-in, so that the automatic test can be normally carried out, and a test case test result of a recorded test case is obtained by combining a test mode of an existing automatic test tool, so as to obtain a system automatic test report. The invention is illustrated below with reference to various examples.
Example one
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for testing a software system, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than that presented herein.
Fig. 1 is a flow chart of an alternative testing method for a software system according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, analyzing whether a menu tool of each test object in the specified software system can be identified by adopting a current recording script, wherein the recording script is used for recording the process of each test case when the test is executed, and the test case refers to the function test of a plurality of test objects in the specified software system;
step S104, under the condition that the menu tool in the target test object in the specified software system cannot be identified by adopting the current recording script, calling an object operation plug-in, wherein an operation command simulating external operation equipment to the specified software system is packaged in advance in the object operation plug-in;
and step S106, executing an operation command of the menu tool in the target test object by adopting the object operation plug-in, and combining the recorded case test result of the test case to obtain a system automation test report.
Through the steps, whether the menu tool of each test object in the specified software system can be identified by adopting the current recording script can be analyzed, and the object operation plug-in is called under the condition that the menu tool in the target test object in the specified software system cannot be identified by adopting the current recording script, wherein the object operation plug-in is pre-packaged with an operation command simulating external operation equipment to the specified software system, the object operation plug-in is adopted to execute the operation command simulating the menu tool in the target test object, and the system automation test report is obtained by combining the recorded case test result of the test case. In this embodiment, in the case that the menu tool in the target test object in the specified software system cannot be identified by using the current recorded script, the menu tool in the test object can be operated by the object operation plug-in, therefore, the automatic test can be normally carried out, the embodiment can realize the operation of a specific software system through the packaged object operation plug-in unit, realize the automatic identification of partial test objects, reduce the manual test action, reduce the manual workload, improve the test working efficiency, normally carry out the automatic test, obtain an automatic test report after the execution is finished, thereby solving the problem that the test tool in the related technology can not identify part of the test objects in the process of recording the script, the part of test objects can not execute the automatic test, and manual replacement test is needed, so that the technical problem of extra workload is solved.
The present invention will be described below with reference to the above-described embodiments.
Optionally, before analyzing whether the menu tool for each test object in the specified software system can be identified by using the currently recorded script, the testing method further includes: acquiring a plurality of available operation commands of a specified software system; determining an operation function when an operation main body of the external operation equipment completes each available operation command on a system interface of a specified software system; and encapsulating the operation function corresponding to each available operation command to obtain the object operation plug-in.
The present embodiment may develop a specific object operation plug-in for each type of software system, such as an autonomous command set function or an object operation plug-in for a specific drawing software (e.g., CAD software) or a PLM product full life cycle management software, which is schematically illustrated as an object operation plug-in, and the function implemented by the autonomous command set function is the same as that of the object operation plug-in.
In this embodiment, the object operation plug-in is essentially an application program interface encapsulation function of the operating system, so as to simulate the working mode of the external operating device to cover the available operation commands in the specific software system. Optionally, the external operating device includes but is not limited to: stylus, mouse, keyboard; available operational commands include, but are not limited to: keyboard commands, control commands ctrl, shift commands, Alt commands. The object operation plug-in can simulate the movement of external operation equipment (such as a mouse) according to the relative position, simulate the operation of a left button, a right button and a roller wheel of the mouse, or simulate the mouse action operations such as the pressing operation, the double-click operation, the lifting operation, the translation operation and the like of the mouse, carry out the operation which can not be realized by recording the script through a packaged function or the object operation plug-in.
For example, in the graphics software, the right-Key menu WinKeyRight (Int Key, Int Rightmenu1, Int Rightmenu2, Int Rightmenu3, Int Rmdeltx, Int Rm1delty, Int Rm2deltx, Int Rm2delty, Int Rm3deltx, Int Rm3delty),
key: ascii code;
rightmenu 1: right-clicking a first-level menu;
rightmenu 2: right-clicking a secondary menu;
rightmenu 3: right-clicking a three-level menu;
rm × deltx, Rm × delty: the unit is the number of pixels relative to the first relative displacement of the level menu, and the pixel height of a same level menu can be obtained in a system through measurement. Requiring several moves to multiply by the unit pixel height.
After the object operation plug-in is developed, the object operation plug-in can be used in the automatic test process to complete the operations of clicking, moving and the like of an object menu in some systems.
Optionally, before analyzing whether the menu tool of each test object in the specified software system can be identified by using the currently recorded script, the test method further includes: acquiring product testing requirements, and compiling at least one test case based on the product testing requirements; and recording the process of each test case when the test is executed to generate a recording script.
In the embodiment, the test case can be compiled by analyzing the test requirements of the product, and then the script is recorded by adopting an automatic test tool.
The test case may refer to performing functional testing on a plurality of test objects in a specified software system, for example, for a word system, the test case may include, but is not limited to: creating a test case for a word, inserting the test case for the word, laying out the test case for the word application and testing the case for the word view. The set test cases and the repeated use mode are different for different software systems.
Optionally, after the recording script is generated, the testing method further includes: adding a test object appearing in a specified software system into an object library; analyzing the occurrence frequency of each test object in the object library in a plurality of recording scripts respectively; and setting the test object with the occurrence frequency larger than a first preset frequency threshold value as a shared object.
After recording the script using the automated test tool, it may be added to the object library, for example, the types of object libraries include, but are not limited to: graphical user interface a GUI object library. Optionally, in this embodiment, when a test object appearing in a specified software system is added to the object library, a naming rule of the object library of the test object (for example, a UI object) and a naming rule of the encapsulation function may also be formulated.
After the test objects appearing in the specified software system are added into the object library, the object library can be classified and sorted, the GUI objects with high use frequency are set as shared objects (aiming at the condition of more scripts), and the UI object library which is not frequently used is added into the local object library, so that the management of the object library is more efficiently executed.
Optionally, after the recording script is generated, the testing method further includes: performing generalized packaging and functional packaging on the recording script, wherein the generalized packaging means packaging the test cases with the occurrence times larger than a second preset time threshold value, and the functional packaging means performing function packaging on serial test cases; analyzing the script type of the packaged recording script; and classifying the plurality of recorded scripts according to the script types.
In this embodiment, the scripts are packaged in a generalized manner (generalized means that a general test function is packaged, and a general test function means a part of test cases shared by multiple recorded scripts or having a large similarity) and a functional manner (functional means that a serial test case is packaged, and a serial test case means that sequential execution order relationships exist between test cases, for example, to open a word action, including creating a word case, a file address confirmation case, and opening a word case, which have sequential execution relationships and need to be packaged for a serial test case), according to the test case and the recorded scripts, and the script types include but are not limited to: structured scripts, shared scripts.
Step S102, whether the menu tool of each test object in the specified software system can be identified by adopting the current recording script is analyzed, wherein the recording script is used for recording the process when each test case is tested, and the test case refers to the function test of a plurality of test objects in the specified software system.
Optionally, the menu tools included in the test object are categorized into a plurality of menu levels and/or keystroke/mouse menu sets.
Menu levels include, but are not limited to: the menu comprises a body menu, a first-level menu and a second-level menu, wherein the key and mouse menu set comprises but is not limited to: for a part of menu tools of UI objects such as a secondary menu, a right mouse button menu and the like, many common test tools cannot be identified, and an object operation plug-in configured in advance needs to be called to simulate an operation command so as to realize the operation of the menu tools.
And step S104, under the condition that the menu tool in the target test object in the specified software system cannot be identified by adopting the current recording script, calling an object operation plug-in, wherein the object operation plug-in is packaged with an operation command simulating external operation equipment to the specified software system in advance.
And step S106, executing an operation command of the menu tool in the target test object by adopting the object operation plug-in, and combining the recorded case test result of the test case to obtain a system automation test report.
In this embodiment, the object operation plug-in may be used to execute an operation command for a menu tool in a target test object to obtain an object test result, obtain an object test result in combination with a recorded case test result of a test case, and synthesize the object test result and the recorded case test result of the test case.
Optionally, in a case that a menu tool in a target test object in the specified software system cannot be identified by using the current recorded script, the test method further includes: acquiring an equipment path recording strategy, wherein the equipment path recording strategy is used for indicating that an interface of external equipment in a software system is adopted to designate a coordinate position for operation; and switching the script recording strategy adopting the current recording script into an equipment path recording strategy so as to identify the menu tool in the target test object in the specified software system.
For the situation that part of menu tools (such as a right-click menu, a secondary menu and a tertiary menu) cannot record in the recording process, switching to other recording modes, namely a device path recording strategy, can be tried first to verify whether correct identification can be achieved. The equipment path recording strategy can be understood as the recording of a physical path of a mouse, and in the mode, the menu tool identification and the self-test of the designated position are realized by adopting the fixed coordinates of image pixel points. After the device path recording strategy is adopted, if the object still cannot be correctly identified, an OS autonomous command set function or an object operation plug-in can be called to process and identify the object.
The device path recording policy and the identification mode of the calling object operation plug-in this embodiment may be running in parallel, and both may identify a menu tool in a target test object in a specified software system.
The method comprises the steps of adding test objects which cannot be recorded in an automatic test tool into an object library through external equipment, classifying and sorting the manually added test objects, calling internal functions of a software system to carry out universal setting, carrying out functional packaging, running scripts, carrying out automatic testing under the unattended condition, checking an automatic test running result by utilizing the mutual binding effect of an automatic test case and the automatic test scripts, and checking whether the unidentifiable test objects can be correctly identified in the running process.
The invention is described below in connection with an alternative embodiment.
Fig. 2 is a flowchart of another alternative software system testing method according to an embodiment of the present invention, as shown in fig. 2, including:
(1) analyzing the test requirements and compiling test cases;
(2) recording a script (obtaining a recorded script) by adopting an automatic testing tool, adding a GUI object library and formulating a naming rule of a UI object function;
(3) and classifying and sorting the GUI object library. The frequently used GUI objects are set as shared objects (for the case of a large number of scripts), and the infrequently used UI object library is added to the local object library.
(4) The script is encapsulated. And performing generalized and functional packaging on the script according to the test case and the recorded script. And the packaged functions are classified into structured scripts, shared scripts and the like in a refining mode.
(5) And identifying a right-click menu, a secondary menu and a tertiary menu.
(6) And judging whether the right-click menu, the second-level menu and the third-level menu can be identified. In the recording process, a right-click menu, a secondary menu and a tertiary menu cannot be recorded, and the right-click menu, the secondary menu and the tertiary menu are preferably tried to be switched to other recording modes to verify whether the right-click menu, the secondary menu and the tertiary menu can be correctly identified.
(7) If it is still not correctly identified, an autonomous command set function or object handling plug-in should be called to identify.
(8) And executing the automated test. And automatically running the recording script, checking the automatic test running result through the binding effect of the recording script and the object operation plug-in, and checking the identified UI object.
By the embodiment, when the software system is automatically tested, if the unrecognized test object is encountered, the automatic test can be realized by calling the autonomous command set function or the object operation plug-in.
The invention is described below in connection with an alternative embodiment.
Example two
The present embodiment provides a testing apparatus for a software system, and each implementation unit included in the testing apparatus corresponds to each implementation step in the first embodiment.
Fig. 3 is a schematic diagram of an alternative testing apparatus for a software system according to an embodiment of the present invention, and as shown in fig. 3, the testing apparatus may include: an analyzing unit 31, a calling unit 33, a determining unit 35, wherein,
the analysis unit 31 is configured to analyze whether the current recording script is used to identify a menu tool of each test object in the specified software system, where the recording script is used to record a process when each test case performs a test, and the test case is used to perform a function test on a plurality of test objects in the specified software system;
the calling unit 33 is configured to call an object operation plug-in unit when the menu tool in the target test object in the specified software system cannot be identified by using the current recording script, where an operation command for simulating an external operation device to the specified software system is pre-packaged in the object operation plug-in unit;
the determining unit 35 is configured to execute an operation command for a menu tool in the target test object by using an object operation plug-in, and obtain a system automation test report by combining a case test result of the recorded test case.
The testing device of the software system can analyze whether the menu tool of each test object in the specified software system can be identified by adopting the current recording script through the analysis unit 31, and call the object operation plug-in unit through the call unit 33 under the condition that the menu tool in the target test object in the specified software system cannot be identified by adopting the current recording script, wherein the object operation plug-in unit is pre-packaged with an operation command simulating external operation equipment to the specified software system, the operation command simulating the menu tool in the target test object is executed by adopting the object operation plug-in unit through the determination unit 35, and a system automation test report is obtained by combining the case test result of the recorded test case. In this embodiment, in the case that the menu tool in the target test object in the specified software system cannot be identified by using the current recorded script, the menu tool in the test object can be operated by the object operation plug-in, therefore, the automatic test can be normally carried out, the embodiment can realize the operation of a specific software system through the packaged object operation plug-in unit, realize the automatic identification of partial test objects, reduce the manual test action, reduce the manual workload, improve the test working efficiency, normally carry out the automatic test, obtain an automatic test report after the execution is finished, thereby solving the problem that the test tool in the related technology can not identify part of the test objects in the process of recording the script, the part of test objects can not execute the automatic test, and manual replacement test is needed, so that the technical problem of extra workload is solved.
Optionally, the testing apparatus of the software system further includes: the system comprises a first acquisition unit, a second acquisition unit and a control unit, wherein the first acquisition unit is used for acquiring a plurality of available operation commands of a specified software system before analyzing whether a menu tool of each test object in the specified software system can be identified by adopting a current recording script; the first determination module is used for determining an operation function of an operation main body of the external operation equipment when each available operation command is completed on a system interface of a specified software system; and the first encapsulation module is used for encapsulating the operation function corresponding to each available operation command to obtain the object operation plug-in.
Optionally, the testing apparatus of the software system further includes: the second acquisition unit is used for acquiring an equipment path recording strategy under the condition that a menu tool in a target test object in the specified software system cannot be identified by adopting the current recording script, wherein the equipment path recording strategy is used for indicating that the interface of the external equipment in the software system is used for specifying a coordinate position to operate; and the switching module is used for switching the script recording strategy adopting the current recording script into an equipment path recording strategy so as to identify a menu tool in a target test object in the specified software system.
Optionally, the testing apparatus of the software system further includes: the third acquisition unit is used for acquiring product test requirements before analyzing whether the menu tool of each test object in the specified software system can be identified by adopting the current recording script, and compiling at least one test case based on the product test requirements; and the first generation module is used for recording the process of each test case during test execution and generating a recording script.
Optionally, the testing apparatus of the software system further includes: the adding module is used for adding the test object appearing in the specified software system into the object library after the recording script is generated; the first analysis module is used for analyzing the occurrence frequency of each test object in the object library in a plurality of recording scripts respectively; and the setting module is used for setting the test object with the occurrence frequency larger than the first preset frequency threshold value as the shared object.
Optionally, the testing apparatus of the software system further includes: the second packaging module is used for performing generalized packaging and functional packaging on the recording script after the recording script is generated, wherein the generalized packaging means packaging the test cases with the occurrence times larger than a second preset time threshold value, and the functional packaging means performing function packaging on the serial test cases; the second analysis module is used for analyzing the script type of the packaged recording script; and the classification module is used for classifying the plurality of recorded scripts according to the script types.
Optionally, the menu tools included in the test object are categorized into a plurality of menu levels and/or keystroke/mouse menu sets.
The testing device of the software system may further include a processor and a memory, the analyzing unit 31, the calling unit 33, the determining unit 35, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory. The kernel can be set to be one or more than one, and the object test result and the recorded case test result of the test case are synthesized by adjusting the kernel parameters to obtain a system automation test report.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute the software system testing method of any one of the above.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the method of testing a software system of any of the above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the software system testing method of any one of the above items.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: analyzing whether a menu tool of each test object in the specified software system can be identified by adopting the current recording script, wherein the recording script is used for recording the process of each test case when executing the test, and the test case refers to the function test of a plurality of test objects in the specified software system; under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, calling an object operation plug-in, wherein an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in advance; and executing an operation command of a menu tool in the target test object by adopting the object operation plug-in, and combining a recorded case test result of the test case to obtain a system automation test report.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for testing a software system, comprising:
analyzing whether a menu tool of each test object in a specified software system can be identified by adopting a current recording script, wherein the recording script is used for recording the process of each test case when the test is executed, and the test case refers to the function test of a plurality of test objects in the specified software system;
under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, calling an object operation plug-in, wherein an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in advance;
and executing an operation command of a menu tool in the target test object by adopting the object operation plug-in, and obtaining a system automation test report by combining the recorded case test result of the test case.
2. The testing method of claim 1, wherein prior to analyzing whether a menu tool specifying each test object in the software system can be identified using the currently recorded script, the testing method further comprises:
acquiring a plurality of available operation commands of the specified software system;
determining an operation function of an operation main body of the external operation equipment when each available operation command is completed on a system interface of the specified software system;
and encapsulating the operation function corresponding to each available operation command to obtain the object operation plug-in.
3. The testing method of claim 1, wherein in the case that the menu tool in the target test object in the specified software system cannot be identified using the currently recorded script, the testing method further comprises:
acquiring an equipment path recording strategy, wherein the equipment path recording strategy is used for indicating that an interface of external equipment in a software system is adopted to designate a coordinate position for operation;
and switching the script recording strategy adopting the current recording script into the equipment path recording strategy so as to identify the menu tool in the target test object in the specified software system.
4. The testing method of claim 1, wherein prior to analyzing whether a menu tool specifying each test object in the software system can be identified using the currently recorded script, the testing method further comprises:
acquiring product testing requirements, and compiling at least one test case based on the product testing requirements;
and recording the process of each test case when the test is executed, and generating the recording script.
5. The testing method of claim 4, wherein after generating the recording script, the testing method further comprises:
adding test objects appearing in the specified software system to an object library;
analyzing the occurrence frequency of each test object in the object library in a plurality of recording scripts respectively;
and setting the test object with the occurrence frequency larger than a first preset frequency threshold value as a shared object.
6. The testing method of claim 4, wherein after generating the recording script, the testing method further comprises:
performing generalized packaging and functional packaging on the recording script, wherein the generalized packaging means packaging the test cases with the occurrence times larger than a second preset time threshold value, and the functional packaging means performing function packaging on serial test cases;
analyzing the script type of the packaged recording script;
and classifying the plurality of recording scripts according to the script types.
7. The method according to any one of claims 1 to 6, wherein the menu tools contained in the test object are classified into a plurality of menu levels and/or a keyboard and mouse menu set.
8. A test apparatus for a software system, comprising:
the system comprises an analysis unit, a storage unit and a control unit, wherein the analysis unit is used for analyzing whether a menu tool of each test object in a specified software system can be identified by adopting a current recording script, the recording script is used for recording the process of each test case when the test is executed, and the test case is used for performing functional test on a plurality of test objects in the specified software system;
the system comprises a calling unit and an object operation plug-in unit, wherein the calling unit is used for calling an object operation plug-in unit under the condition that a menu tool in a target test object in a specified software system cannot be identified by adopting a current recording script, and an operation command simulating external operation equipment to the specified software system is packaged in the object operation plug-in unit in advance;
and the determining unit is used for executing an operation command of a menu tool in the target test object by adopting the object operation plug-in and obtaining a system automation test report by combining the recorded case test result of the test case.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of testing the software system of any one of claims 1 to 7 via execution of the executable instructions.
10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls a device to execute the method for testing the software system according to any one of claims 1 to 7.
CN202111487141.7A 2021-12-07 2021-12-07 Software system testing method and device, electronic equipment and storage medium Pending CN114168470A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111487141.7A CN114168470A (en) 2021-12-07 2021-12-07 Software system testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111487141.7A CN114168470A (en) 2021-12-07 2021-12-07 Software system testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114168470A true CN114168470A (en) 2022-03-11

Family

ID=80483976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111487141.7A Pending CN114168470A (en) 2021-12-07 2021-12-07 Software system testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114168470A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357519A (en) * 2022-10-20 2022-11-18 中科方德软件有限公司 Test method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357519A (en) * 2022-10-20 2022-11-18 中科方德软件有限公司 Test method, device, equipment and medium
CN115357519B (en) * 2022-10-20 2022-12-16 中科方德软件有限公司 Test method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN104391797A (en) GUI (graphical user interface) widget identification method and device
CN108845930B (en) Interface operation test method and device, storage medium and electronic device
US10810113B2 (en) Method and apparatus for creating reference images for an automated test of software with a graphical user interface
CN102054149A (en) Method for extracting malicious code behavior characteristic
CN109840206A (en) Data test method, apparatus, terminal and storage medium
CN103502936A (en) Image-based automation systems and methods
CN104809056A (en) Interface testing code generating method and device
CN114328173B (en) Software fuzzing test method and device, electronic equipment and storage medium
CN104375934A (en) Method for testing reliability of Android mobile phone software
JP3822044B2 (en) Design verification system, design verification method, and computer-readable recording medium storing design verification program
CN107608873B (en) Software testing method and system and testing platform
CN108664471A (en) Text region error correction method, device, equipment and computer readable storage medium
CN101216766A (en) Atom manipulation encapsulation apparatus and method
CN114168470A (en) Software system testing method and device, electronic equipment and storage medium
Havranek et al. V2S: a tool for translating video recordings of mobile app usages into replayable scenarios
CN110990282A (en) Automatic unit testing method
CN112416733B (en) Memory detection method, memory detection device and intelligent device
CN111459774B (en) Method, device, equipment and storage medium for acquiring flow of application program
CN116719736A (en) Test case generation method and device for testing software interface
CN113805861B (en) Code generation method based on machine learning, code editing system and storage medium
CN108469997B (en) Automatic identification method of user-defined heap management function based on dynamic characteristics
CN115033434A (en) Kernel performance theoretical value calculation method and device and storage medium
CN114416533A (en) Artificial intelligence-based use case generation method and system for vehicle-mounted electronic product
CN110909739B (en) Picture identification and operation method and device, computer equipment and storage medium
CN112148608B (en) Mobile terminal automated software testing method based on control function labeling

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