An automated testing method and testing device for laser cutting CNC systems
Patent Information
- Application Number
- CN202310419087.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-04-19
AI Technical Summary
[0003]目前对于激光切割这种数控行业的测试基本采用人工测试,采用人工测试有如下缺点:(1)人员需对系统有一定的认知
[0040]本发明实施例的方法通过元素信息文件保存界面元素ID等信息,后续界面元素有所改动,无需修改接口,直接修改文本文件元素ID信息即可,具有维护简单、重复性强等优点。解决了人工需对系统有一定认知,版本迭代时需进行重复性测试,测试覆盖面不全及测试不准确等问题。
Smart Images

Figure CN116441768B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to CNC system testing technology, and more particularly to an automated testing method and testing device for laser cutting CNC systems. Background Technology
[0002] With the development of the laser cutting industry, the range of laser cutting products on the market is becoming increasingly diversified, offering users a wider selection. Despite the increasing variety of laser cutting products, their common core aspects remain the stability, precision, and safety of the machine tool processing. Safety is paramount; a machine tool malfunction could lead to serious safety accidents. Therefore, laser cutting machines must undergo thorough and effective systematic testing before being officially released.
[0003] Currently, testing in the CNC industry, such as laser cutting, is mainly done manually. Manual testing has the following disadvantages: (1) Personnel need to have a certain understanding of the system. (2) When versions are iterated, a large number of repetitive tests are performed. (3) During the testing process, personnel are affected by certain subjective and objective factors, ultimately affecting the test results or resulting in incomplete test coverage. (4) It is impossible to perform accurate testing on some data. (5) When adjusting the process, manual process adjustment testing is required repeatedly, which is very time-consuming.
[0004] The existing automated testing interfaces of other software are bound to the program. When the function is modified, the corresponding interface needs to be modified constantly in order to perform testing. The later maintenance is very cumbersome, costly and time-consuming.
[0005] Therefore, there is an urgent need for a method to automate the testing of CNC systems. Summary of the Invention
[0006] (a) Technical problems to be solved
[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides an automated testing method and testing device for laser cutting CNC systems.
[0008] (II) Technical Solution
[0009] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0010] In a first aspect, embodiments of the present invention provide an automated testing method for a laser cutting CNC system, comprising:
[0011] In response to a user-triggered test command, check whether all parameters in the current test interface are the initial parameters;
[0012] If not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to use multiple element information from the pre-established element information file as configuration parameters to configure the parameters in the test interface, and obtain the configured test interface.
[0013] Test the configured test interface and obtain the test report for output.
[0014] Optionally, before testing the configured test interface and obtaining the test report for output, the method further includes:
[0015] In response to at least one test function command selected by the user, add the corresponding function information to the configured test interface;
[0016] Accordingly, the configured test interface is tested, and a test report is obtained for output, including:
[0017] Test the interface with added functional information and obtain a test report for output.
[0018] Optionally, before testing the configured test interface and obtaining the test report for output, the method further includes:
[0019] By utilizing the shared memory between the host computer and the slave computer, the current operating information of the machine tool in the laser cutting system can be obtained;
[0020] Based on the machine tool's operating information, determine whether the parameters in the configured test interface are valid values;
[0021] If so, the configured test interface will be tested and a test report will be obtained for output; otherwise, an assertion operation will be performed.
[0022] Optionally, before detecting whether all parameters in the current test interface are initial parameters in response to a user-triggered test command, the method further includes:
[0023] Construct an element information file in CSV format, which stores the element identifier and the information to which the element identifier belongs in a row-column format;
[0024] The information associated with an element identifier includes: control type, control depth, and control name.
[0025] Optionally, the method further includes:
[0026] Iterate through the element information files corresponding to all functional test cases and interface test cases stored in the test case library;
[0027] Automated testing of functional test cases and interface test cases is performed on one or more programs of a laser cutting CNC system.
[0028] Secondly, the present invention also provides an automated testing device for a laser cutting CNC system, comprising:
[0029] The test case library is used to store the element information files corresponding to all functional test cases and interface test cases;
[0030] The configuration module is used to respond to the test command triggered by the user, detect whether the parameters in the current test interface are all initial parameters; if not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to use multiple element information from the pre-established element information file as configuration parameters to configure the parameters in the test interface, so as to obtain the configured test interface.
[0031] The execution module is used to test the configured test interface and obtain a test report for output.
[0032] Optionally, it also includes:
[0033] The parameter verification module is used to obtain the current machine tool operation information in the laser cutting system by means of shared memory between the host computer and the slave computer; and to determine whether the parameters in the configured test interface are valid values based on the machine tool operation information.
[0034] After the parameter verification module passes the verification, the execution module is used to test the configured test interface and obtain a test report for output.
[0035] If the parameter validation fails, the execution module will perform an assertion operation.
[0036] Optionally, the testing environment of the automated testing device is to perform automated testing on one or more modules in the laser cutting CNC system using a script written with the Unittest SetUp function.
[0037] Thirdly, the present invention also provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to perform the steps of the automated testing method for a laser cutting CNC system described in any of the first aspects above.
[0038] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the automated testing method for a laser cutting CNC system as described in any one of the first aspects.
[0039] (III) Beneficial Effects
[0040] The method of this invention stores interface element IDs and other information in an element information file. Subsequent changes to interface elements do not require modification of the interface; only the element ID information in the text file needs to be changed. This method offers advantages such as simple maintenance and high repeatability. It solves problems such as the need for manual system knowledge, repetitive testing during version iterations, incomplete test coverage, and inaccurate testing.
[0041] Compared with manual testing, the method of the present invention has the following advantages: low cost and high accuracy of test data; solves the problem of low efficiency of testers having to perform repetitive tests due to version iterations; solves the problem of testers affecting test results or causing incomplete test coverage due to subjective and objective reasons; and is simple to operate and easy to maintain.
[0042] In particular, subsequent changes to UI elements only require modifying the CSV file; no changes are needed to the test scripts, making maintenance convenient. Attached Figure Description
[0043] Figure 1 A flowchart illustrating the automated testing method for a laser cutting CNC system provided in an embodiment of the present invention;
[0044] Figure 2 This is a schematic diagram of functional test cases for an automated testing method for a laser cutting CNC system provided in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the interface test cases for an automated testing method of a laser cutting CNC system provided in an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the structure of an automated testing device for a laser cutting CNC system provided in an embodiment of the present invention. Detailed Implementation
[0047] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] like Figure 1 As shown, this embodiment provides an automated testing method for a laser cutting CNC system. This method can be executed using any control device of the laser cutting CNC system. The automated testing method of this embodiment includes:
[0049] 101. In response to a user-triggered test command, check whether all parameters in the current test interface are the initial parameters;
[0050] 102. If not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to configure the parameters in the test interface as configuration parameters using multiple element information from the pre-established element information file, and obtain the configured test interface.
[0051] For example, a CSV-formatted element information file can be pre-built, storing element identifiers, information about which the element identifier belongs, etc., in a row-and-column format. The information about which the element identifier belongs includes: control type, control depth, and control name.
[0052] CSV format files are shown in Table 1:
[0053] Start ButtonControl bthStart 4 Start Stop ButtonControl bthStop 3 Stop Go Border ButtonControl bthGoBorder 3 Go Border Edge Mode TextControl EdgMode 4 Edge Mode
[0054] The element-location method uses multiple element information from a pre-built element information file as configuration parameters to configure parameters in the test interface. Specifically, this can include:
[0055] The program parses a CSV file containing element information, iterates through the elements based on their IDs and names, and finally returns row information. The row information includes the element ID, control type, control depth, and name, which can be used to locate the unique element on the interface.
[0056] This embodiment uses an element-location method to avoid modifying the API interface when subsequent interface element information changes. In other words, this method requires only changing the element information in the CSV format element information file, without altering the interface functions, making it simple and easy to maintain.
[0057] 103. Test the configured test interface and obtain the test report for output.
[0058] In the specific implementation process, before step 103 above, the method of this embodiment may further include the following step 103a:
[0059] 103a. In response to at least one test function command selected by the user, add function information corresponding to the test function command to the configured test interface;
[0060] At this point, 103 can be: test the test interface with added functional information and obtain the test report for output.
[0061] In another possible implementation, prior to step 103 above, the method of this embodiment further includes the following step 102a:
[0062] 102a. Obtain the current machine tool operating information in the laser cutting system by using a shared memory method between the host computer and the slave computer;
[0063] Based on the machine tool's operating information, determine whether the parameters in the configured test interface are valid values;
[0064] If yes, proceed to step 103; otherwise, perform the assertion operation.
[0065] In practical applications, it is possible to traverse the element information files corresponding to all functional test cases and interface test cases stored in the test case library;
[0066] Automated testing of functional test cases and interface test cases is performed on one or more programs of a laser cutting CNC system.
[0067] The method in this embodiment stores information such as interface element IDs in an element information file. If subsequent interface elements are modified, there's no need to change the interface; simply modify the element ID information in the text file. This method offers advantages such as simple maintenance and high repeatability. It solves problems such as the need for manual system knowledge, repetitive testing during version iterations, incomplete test coverage, and inaccurate testing.
[0068] Combination Figure 2 and Figure 3 This paper describes a specific automated testing method for laser cutting CNC systems.
[0069] Figure 2 The testing method can proceed to the next round of testing by sequentially traversing the test case library after step 103 above.
[0070] Specifically, 201. Obtain a functional test case from the test case library;
[0071] 202. Determine if the functional test case has already been executed. If yes, end the test; otherwise, execute the test script. The test script here can be understood as using element location to configure parameters in the test interface by using multiple elements from the element information file containing the functional test case as configuration parameters, thus obtaining the configured test interface.
[0072] 203. Determine if the test script executes correctly. If not, print the reason for the failure. If it executes correctly...
[0073] During normal execution, the operating information of the current machine tool in the laser cutting system can be obtained by using the shared memory method between the host computer and the slave computer; based on the operating information of the machine tool, it can be determined whether the parameters in the configured test interface are valid values.
[0074] For example, communication between the lower-level machine and the upper-level machine is established through shared memory. The corresponding parameters of the lower-level machine are obtained and compared with the parameters in the configured test interface. If they are the same, no record is made; if they are different, the different values are recorded. The assertion operation compares the parameters in the configured test interface with the actual values of the machine tool. If they are equal, the test passes; if they are not equal, the value is recorded and saved, the test ends, and a test report is output.
[0075] Figure 3 The intermediate testing method is also the next round of testing after step 103, sequentially traversing the test case library. It corresponds to a single interface test case in the test case library. The interface test case is retrieved from the library, and it is then determined whether the test case has been executed. If it has not been executed, a reset operation is performed, and single / double-click operations are used to locate the element positions to obtain the configured test interface. The test script is then executed, the test case ends, and a test report is generated.
[0076] Compared to manual testing, the above method has the following advantages: low cost and high accuracy of test data; it replaces the repetitive testing required by testers due to version iterations; it solves the problem of test results being affected by subjective and objective reasons or resulting in incomplete test coverage; and it is simple to operate and easy to maintain.
[0077] In particular, for subsequent changes to interface elements, only the CSV file needs to be modified, without changing the test script, making maintenance convenient.
[0078] To better understand the above Figures 1 to 3 The method shown below will be explained from another perspective regarding the testing method.
[0079] The testing method in this embodiment can automatically acquire process parameter information, input process parameters into the process interface for processing, and specifically execute the following process:
[0080] Step 1: Search for the process file (such as CSV format) entered by the user in the terminal of this automated testing device.
[0081] Step 2: Locate the process document according to the process document path, parse the process document, and obtain the process parameters (the process document stores process parameter information in row and column format. For example, "Process 1"); cutting speed (10m / min); lifting height (2mm); cutting height (1mm); cutting gas, oxygen; cutting gas pressure (5BAR); peak power (100%); pulse frequency (100%); duty cycle (80%); focal position (-2mm); delay before turning off (50ms); delay before turning on (50ms); delay after turning on (20ms), etc., this embodiment does not limit these parameters).
[0082] Step 3: Locate the process button and open the process parameter interface; parse the file storing interface element information under the project path to obtain the interface process element information, and pass the interface process element information as a parameter to the positioning method to achieve element positioning.
[0083] In practice, this can be achieved by simulating a mouse click to open the process parameter interface.
[0084] Step 4: Following step 2 of the above method, obtain the process parameter information stored in the process file. Following step 3 of the above method, obtain information on other elements in the process parameter interface to achieve element location.
[0085] In other words, the obtained process parameter information can be entered into the corresponding process parameter in sequence in a simulated mouse input manner. After all parameters have been entered, the parameter interface can be closed.
[0086] Step 5: Locate the open button element and execute the open action.
[0087] Step 6: Locate and open the test drawing file based on the path entered by the user.
[0088] Step 7: Locate the start button, execute the start processing, and wait for the processing to finish.
[0089] Step 8: Obtain the dimensions of the test drawing, position the step button, click X+ / Y+, and move the distance greater than the dimensions of the test drawing to ensure that the cutting head is not in the area just processed.
[0090] Step 9: Jump to Step 2. At this point, the second process document is being parsed. This process is repeated until all process documents have been executed and the program stops.
[0091] Finally, you can observe the cross-section and slag adhesion of the cut pattern in turn to determine which process document has the best cutting effect compared to other process documents, and then use the process parameters of that process document in the future.
[0092] The above testing methods are all implemented through automated simulation, requiring no manual operation. They can effectively modify text file element ID information and have advantages such as simple maintenance and high repeatability. This solves problems such as the need for manual personnel to have a certain understanding of the system, the need for repetitive testing during version iterations, incomplete test coverage, and inaccurate testing.
[0093] Compared to manual testing, it has the following advantages: lower cost and higher accuracy of test data; it replaces the repetitive testing that testers need to perform due to version iterations; it solves the problem of test results being affected by subjective and objective reasons or resulting in incomplete test coverage; and it is simple to operate and easy to maintain.
[0094] like Figure 4As shown, this embodiment provides an automated testing device for a laser cutting CNC system. The automated testing device of this embodiment includes:
[0095] The test case library is used to store the element information files corresponding to all functional test cases and interface test cases;
[0096] The configuration module is used to respond to the test command triggered by the user, detect whether the parameters in the current test interface are all initial parameters; if not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to use multiple element information from the pre-established element information file as configuration parameters to configure the parameters in the test interface, so as to obtain the configured test interface.
[0097] The execution module is used to test the configured test interface and obtain a test report for output.
[0098] The configuration module can retrieve functional test cases from the test case library. For example, when the test device configuration module is opened, a zero-reset operation is performed to ensure that subsequent operations are performed on the interface after the zero-reset operation. By parsing the element information file, such as traversing line by line, the corresponding element information is obtained. The obtained element information is used as parameters, and configuration is implemented by element positioning. For example, moving the mouse to the element control will automatically fill the parameters into the specified element position.
[0099] This feature uses element positioning to locate elements in the configuration and enable single / double click operations to activate the function.
[0100] The configuration module is used to parse the CSV format text file containing element information to obtain element ID and Name information, and to traverse and search based on the element ID and Name. If the ID of the searched element is equal to the ID of the parsed text file content, the current line content is returned. If the searched element has no ID, it can be searched based on Name, and the search method is the same as ID search. After the search, the obtained data is sent to the specified element position through simulated keyboard input.
[0101] In practical applications, the automated testing device of this embodiment further includes: a parameter verification module, used to obtain the current machine tool operation information in the laser cutting system by means of a shared memory between the host computer and the slave computer; and to determine whether the parameters in the configured test interface are valid values based on the machine tool operation information.
[0102] After the parameter verification module passes the verification, the execution module is used to test the configured test interface and obtain a test report for output.
[0103] If the parameter verification module fails, the execution module will perform an assertion operation, which compares the parameter setting value in the configured test interface with the actual value of the machine tool. If they are equal, the test passes; otherwise, the value is recorded and saved, and the test ends.
[0104] The test environment of the automated testing device in this embodiment is obtained by writing a script using the Unittest SetUp function to perform automated testing on one or more modules in the laser cutting CNC system.
[0105] The test case library in this embodiment stores interface test cases and functional test cases, which can be called by other modules. Each test case in the test case library can be stored in advance in the project path of the function / module to be tested. Operators can configure each test case according to the testing needs and save it in CSV format. When the test cases are adjusted, the test case content in CSV format can be adjusted.
[0106] The parameters for functional and UI test cases are stored in a CSV file in a row-and-column format. The configuration module responds to user-triggered test commands by calling the CSV file via an API interface, parsing it line by line to obtain the corresponding configuration parameters and adaptively configuring the test interface accordingly.
[0107] When the edge finding function test case is executed, the CSV file of the edge finding function test case will be opened first, and parsed line by line to obtain the parameter information required by the edge finding function. By simulating keyboard input, the parameter information obtained from the CSV file of the edge finding function test case will be simulated to be input into the edge finding function interface.
[0108] Test cases are generated before testing, after being written and approved by the testers. The test case library includes N functional test cases and N interface test cases (N≧1).
[0109] The testing device in this embodiment solves the problem of test results being affected by subjective and objective reasons or resulting in incomplete test coverage; it is simple to operate and easy to maintain.
[0110] This embodiment also provides a computing device, which may be a device integrating a laser cutting CNC system, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program stored in the memory to perform the steps of an automated testing method for a laser cutting CNC system as described in any of the above embodiments.
[0111] This embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of an automated testing method for a laser cutting CNC system as described in any of the above embodiments.
[0112] It should be noted that the word "a" or "an" preceding a component does not preclude the existence of multiple such components. This invention can be implemented using hardware comprising several different components and using a suitably programmed computer. Among the listed devices, several of these devices may be embodied by the same hardware. The use of terms such as "first," "second," "third," etc., is merely for convenience and does not indicate any order. These terms can be understood as part of the component names.
[0113] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0114] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning of the basic inventive concept, can make other changes and modifications to these embodiments.
[0115] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from the spirit and scope of the invention.
Claims
1. An automated testing method for a laser cutting CNC system, characterized in that, The method is executed by the control equipment of a laser cutting CNC system, and includes: In response to a user-triggered test command, check whether all parameters in the current test interface are the initial parameters; If not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to use multiple element information from the pre-established element information file as configuration parameters to configure the parameters in the test interface, and obtain the configured test interface. Test the configured test interface and obtain the test report for output; Before testing the configured test interface and obtaining the test report for output, the method further includes: By utilizing the shared memory between the host computer and the slave computer, the current operating information of the machine tool in the laser cutting system can be obtained; Based on the machine tool's operating information, determine whether the parameters in the configured test interface are valid values; If so, the configured test interface will be tested and a test report will be obtained for output; otherwise, an assertion operation will be performed.
2. The automated testing method according to claim 1, characterized in that, Before testing the configured test interface and obtaining the test report for output, the method further includes: In response to at least one test function command selected by the user, add the corresponding function information to the configured test interface; Accordingly, the configured test interface is tested, and a test report is obtained for output, including: Test the interface with added functional information and obtain a test report for output.
3. The automated testing method according to claim 1, characterized in that, Before detecting whether all parameters in the current test interface are the initial parameters in response to a user-triggered test command, the method further includes: Construct an element information file in CSV format, which stores the element identifier and the information to which the element identifier belongs in a row-column format; The information associated with an element identifier includes: control type, control depth, and control name.
4. The automated testing method according to claim 1, characterized in that, The method further includes: Iterate through the element information files corresponding to all functional test cases and interface test cases stored in the test case library; Automated testing of functional test cases and interface test cases is performed on one or more programs of a laser cutting CNC system.
5. An automated testing device for a laser cutting CNC system, characterized in that, include: The test case library is used to store the element information files corresponding to all functional test cases and interface test cases; The configuration module is used to respond to user-triggered test commands and check whether all parameters in the current test interface are initial parameters. If not, adjust the parameters in the test interface to the initial parameters, and based on the parameters in the test interface, use the element positioning method to use multiple element information from the pre-established element information file as configuration parameters to configure the parameters in the test interface, and obtain the configured test interface. The execution module is used to test the configured test interface and obtain a test report for output. The parameter verification module is used to obtain the current machine tool operation information in the laser cutting system by means of shared memory between the host computer and the slave computer; and to determine whether the parameters in the configured test interface are valid values based on the machine tool operation information. After the parameter verification module passes the verification, the execution module is used to test the configured test interface and obtain a test report for output. If the parameter validation fails, the execution module will perform an assertion operation.
6. The automated testing device according to claim 5, characterized in that, The test environment of the automated testing device is obtained by writing scripts using the Unittest SetUp function to automatically test one or more modules in the laser cutting CNC system.
7. A computing device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to perform the steps of an automated testing method for a laser cutting CNC system as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of an automated testing method for a laser cutting CNC system as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Numerical control software testing system
CN103019936A
Graphic user interface test method and system
CN1851667A