Method and system for automatically testing defrosting decision of refrigerator based on API (Application Program Interface)

An automated testing system for refrigerator defrost decisions using a CI Job task and data tables addresses inefficiencies in manual testing, ensuring efficient and resource-saving defrost decision testing.

CN119065971APending Publication Date: 2024-12-03SICHUAN HONGMEI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411107750.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Manual testing methods for refrigerator defrost decisions are inefficient, time-consuming, and require significant manpower and material resources, especially when dealing with numerous data modifications and expansions.

Method used

An automated testing method and system based on an API interface, utilizing a CI Job task on the Jenkins continuous integration platform, with data tables Excel-1 and Excel-2, to execute and compare defrost decision scripts automatically, ensuring efficient testing.

Benefits of technology

The automated method reduces human and material resource consumption, enhances testing efficiency, and maintains consistency in defrost decision results without altering the API interface interaction mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065971A_ABST
    Figure CN119065971A_ABST
Patent Text Reader

Abstract

The invention discloses a refrigerator defrosting decision automatic test method and system based on an API interface, and the method comprises the steps: building a CI Job task of the refrigerator defrosting decision automatic test on a jenkins continuous integration platform, selecting execution parameters from a data table through the CI Job task, carrying out the construction compiling of the CI Job task, automatically executing related compiling scripts, and achieving the automatic test. According to the method, the API interface interaction mode of the cloud end and the refrigerator equipment end is not changed, the CI job is established on the jenkins continuous integration platform to automatically execute the test case of the defrosting decision, the method is easy to implement in an existing refrigerator defrosting decision scheme, the test method can be automatically executed, the problems that manual test is large in data size and large in workload are solved, and the test efficiency is improved. Therefore, automation is realized and test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of refrigerator defrosting decision testing, and in particular to an API-based refrigerator defrosting decision automation testing method and system. Background Art

[0002] With the deepening of intelligent home appliances, people are pursuing intelligence while refrigerator users have higher and higher requirements for energy efficiency. In order to improve the energy efficiency of refrigerator use, the real data of the refrigerator's historical operating status is used as the basis for the refrigerator defrosting algorithm. By developing a difference extraction algorithm and a performance auxiliary judgment algorithm, and extracting relevant decision values ​​such as the boot rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value through a reliable algorithm, and determining whether to execute defrost or delay defrost based on the decision algorithm; and realizing the "thousand-machine" intelligent defrosting according to the user environment, so that the refrigerator can be improved in energy saving, freshness preservation, noise reduction and other performance.

[0003] The existing refrigerator defrost decision test is mainly a manual test method that combines the ApiPost7 test tool with the serial port tool to analyze the defrost decision log. The tester establishes a defrost decision interface test case on the ApiPost7 tool and configures the development environment of each case. When the decision algorithm of a case needs to be tested, the parameters of the case are modified, such as modifying the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value. After the modification, the defrost decision algorithm is combined, and the result after the modification is determined locally to execute defrost or delay defrost, and the error reason for executing defrost is confirmed; after the local calculation and confirmation of the relevant results of the modified parameters, the developer clicks Send in the ApiPost7 tool, and the relevant decision algorithm script will be executed, and the relevant defrost decision will be printed out through the serial port tool. The tester analyzes the decision results in the serial port log and compares them with the locally determined decision results. If the results are consistent, the modified data test passes. Since there are only 20 basic use cases based on the decision algorithm, but hundreds of data modification and expansion use cases derived from the basic use cases, and new use cases and regression test cases may be added during the testing process, this manual testing method will waste a lot of manpower and material resources, and is time-consuming and inefficient. Summary of the invention

[0004] In view of the defects of the currently commonly used refrigerator defrost decision system, the purpose of the present invention is to provide an automated testing method and system for refrigerator defrost decision based on an API interface, so as to solve the problem that the manual testing method wastes a lot of manpower and material resources, is time-consuming and inefficient.

[0005] The present invention solves the above problems through the following technical solutions:

[0006] The automated test method for refrigerator defrosting decision based on API interface includes:

[0007] Establish a CI Job task for refrigerator defrosting decision automation test on the Jenkins continuous integration platform, select execution parameters from the data table through the CIJob task, and then build and compile the CI Job task, automatically execute related compilation scripts, and realize automated testing;

[0008] The data table includes at least excel-1 and excel-2. The excel-1 table is used to pass parameters to the API interface and obtain corresponding results after construction. The excel-2 table is used to save the expected results during use case design and compare them with the results after construction.

[0009] The automatic execution of the relevant compilation scripts realizes the automated testing; the specific steps are:

[0010] A. Retrieve the corresponding data items from the first row of the Excel-1 table in sequence, and pass each data item to the API interface in the form of function parameters. By building and compiling the CI Job task, call the relevant refrigerator defrosting decision execution script to implement the data test from rows 1, 2, ..., n in the Excel-1 table, and return the result data of the required big data field;

[0011] B. Compare the decision result fields extracted after each execution with the corresponding expected result data in Excel-2. If the key values ​​extracted from the two correspond to each other, the test passes until all defrost decision use case tests are completed.

[0012] As a further improvement, the key values ​​include: executing defrost or delaying defrost, and various defrost error printing data.

[0013] As a further improvement, the method further includes:

[0014] Prepare two data tables, Excel-1 and Excel-2, locally. Excel-1 stores all the test case values ​​to be modified, including the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value; Excel-2 stores the decision results that are changed due to the modification of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, and ensures that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate result comparison in the later automated testing.

[0015] In addition, the present invention also solves the above-mentioned problem through the following technical solutions:

[0016] Used to implement the automated testing method for refrigerator defrosting decision based on the API interface as described above.

[0017] As a further improvement, the system comprises: an algorithm execution module, a result analysis and key value extraction module and a data result comparison module which are arranged in sequence.

[0018] The algorithm execution module is used to execute the modified data use case obtained by the parameters through the API interface, execute the data items n=1, 2, ..., N, in the data table, and return the corresponding results through the API interface;

[0019] The result analysis and key value extraction module analyzes the results returned by the API interface and extracts the key values ​​of the corresponding fields of the big data;

[0020] The data result comparison module compares the key value extracted by the result analysis and key value extraction module with the expected value in the data table.

[0021] As a further improvement, the system further includes a use case data design module.

[0022] The use case data design module is used to prepare two data tables, Excel-1 and Excel-2, locally in advance. Excel-1 stores all test case values ​​to be modified, including the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value; Excel-2 stores the decision results changed due to the modification of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, and ensures that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate result comparison in the later automated testing.

[0023] In addition, the present invention also solves the above-mentioned problem through the following technical solutions:

[0024] An electronic device, comprising:

[0025] processor;

[0026] a memory for storing instructions executable by the processor;

[0027] The processor is used to read the executable instructions from the memory and execute the instructions to implement the automated test method for refrigerator defrosting decision based on the API interface as described above.

[0028] In addition, the present invention also solves the above-mentioned problem through the following technical solutions:

[0029] A computer-readable storage medium stores a computer program, wherein the computer program is used to execute the automated test method for refrigerator defrosting decision based on an API interface as described above.

[0030] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0031] The present invention does not change the API interface interaction mode between the cloud and the refrigerator device end. It realizes the test case of automatically executing the defrost decision by establishing a CI job task on the Jenkins continuous integration platform. It is easy to implement in the existing refrigerator defrost decision scheme, and can automatically execute the test method, solving the problems of large amount of data and heavy workload in manual testing, thereby realizing automation and improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of the existing defrosting decision-making test method;

[0033] Figure 2 This is a flow chart of the automated test method for refrigerator defrosting decision based on the API interface in the present invention;

[0034] Figure 3 The present invention provides an API-based refrigerator defrosting decision automation test method execution principle;

[0035] Figure 4 This is a block diagram of the refrigerator defrosting decision automation test system based on the API interface in the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below in conjunction with the drawings in the preferred embodiments of the present application. In the drawings, the same or similar reference numerals throughout represent the same or similar parts or parts with the same or similar functions. The described embodiments are part of the embodiments of the present application, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0037] Figure 1The existing defrost decision test method is described. Through the ApiPost7 test tool and the manual test method combined with the serial port tool to analyze the defrost decision log, the tester creates a defrost decision interface test case on the ApiPost7 tool and configures the development environment of each case. When the decision algorithm of a case needs to be tested, the parameters of the case are modified, such as modifying the startup rate & high speed ratio, the freezing chamber cooling speed, the average difference and the average fluctuation value. After the modification, the defrost decision algorithm is combined, and the result after the modification is determined locally to execute defrost or delay defrost, and confirm the error reason for executing defrost; when the developer clicks Send in the ApiPost7 tool, the relevant decision algorithm script will be executed, and the relevant defrost decision will be printed out through the serial port tool. The tester analyzes the decision results in the serial port log and compares them with the locally determined decision results. If the results are consistent, the modified data test passes.

[0038] Figure 2 The present invention describes the refrigerator defrosting decision automation test method based on API interface. Two data tables excel-1 are prepared locally in advance for transmission to API interface. After construction, the corresponding results and excel-2 are used to save the expected results of use case design, and compared with the results after construction.

[0039] Then, by establishing a CI Job task for automated testing of refrigerator defrosting decisions on the Jenkins continuous integration platform, and selecting parameters through CI Job execution, first, the corresponding data items are retrieved from the first row in the Excel-1 table in sequence, and each data is passed to the API interface in the form of function parameters. By building and compiling the CI Job task to call the relevant refrigerator defrosting decision execution script, each data test from rows 1, 2,..., n in the Excel-1 table is implemented, and the result data of the required large data fields is returned; finally, the decision result field extracted after each execution is compared with the corresponding expected result data stored locally in the Excel-2 table.

[0040] Figure 3The execution principle of the automated test method for refrigerator defrosting decision based on API interface is described. Through the CI Job parameters in the Jenkins continuous integration platform, the use case data tables excel-1 and excel-2 are selected as CI job execution parameters, and then the CI Job is built and compiled to automatically execute the relevant compilation scripts. That is, by running the defrost decision test script, the data items n=1,2,…,N corresponding to the use case in the excel-1 data table are transferred to the API interface in the form of parameters, and the results returned by the API interface are analyzed, and the key values ​​of the corresponding fields of the big data are extracted, among which the key values ​​are such as executing defrost or delaying defrost, and various defrost error print data; and compared with the expected values ​​in the excel-2 table, if they are consistent, the test passes.

[0041] Figure 4 The block diagram of the refrigerator defrosting decision automation test system based on the API interface of the present invention is depicted.

[0042] The following will be combined Figure 1-4 , a refrigerator defrosting decision automation test method and system based on API interface involved in the embodiment of the present application are described in detail. It is worth noting that the following embodiments are only used to explain the present application and do not constitute a limitation of the present application.

[0043] Embodiment 1:

[0044] See attached Figure 2-3 , the refrigerator defrosting decision automation test method based on API interface includes:

[0045] First, prepare two data tables locally, Excel-1 and Excel-2. Excel-1 stores all the test case values ​​of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value to be modified; Excel-2 stores the decision results changed by modifying the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, such as: executing defrost or delaying defrost, and confirming the error reason for executing defrost, etc. And ensure that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate the comparison of results in the later automated testing.

[0046] Then, a CI Job task for refrigerator defrosting decision automation test is established on the Jenkins continuous integration platform, and the execution parameters are selected from the data table through the CI Job task, and then the CI Job task is built and compiled, and the relevant compilation scripts are automatically executed to achieve automated testing. Among them, the data table includes at least excel-1 and excel-2. The excel-1 table is used to pass the parameters to the API interface and obtain the corresponding results after construction; the excel-2 table is used to save the expected results of the use case design and compare them with the results after construction;

[0047] The automatic execution of the relevant compilation scripts realizes the automated testing; the specific steps are:

[0048] A. Retrieve the corresponding data items from the first row of the Excel-1 table in sequence, and pass each data item to the API interface in the form of function parameters. By building and compiling the CI Job task, call the relevant refrigerator defrosting decision execution script to implement the data test from rows 1, 2, ..., n in the Excel-1 table, and return the result data of the required big data field;

[0049] B. Compare the decision result fields extracted after each execution with the corresponding expected result data stored locally in Excel-2. If the key values ​​extracted from the two correspond to each other, the test passes until all defrost decision use case tests are completed.

[0050] Optionally, the key value includes at least: executing defrost or delaying defrost, and various defrost error printing data.

[0051] The refrigerator defrost decision automation testing method based on the API interface of the present invention is easy to implement in the existing refrigerator defrost decision scheme, with small investment and fast return, and solves the problems of large amount of data and heavy workload in manual testing, saves human and material resources, and improves testing efficiency.

[0052] Embodiment 2:

[0053] See attached Figure 4 The refrigerator defrost decision automation test system based on the API interface is used to implement the refrigerator defrost decision automation test method based on the API interface in Example 1, comprising: an algorithm execution module, a result analysis and key value extraction module and a data result comparison module which are arranged in sequence,

[0054] The algorithm execution module is used to obtain the modified data use case through the API interface, execute the data items n=1, 2, ..., N, in the data table, and return the corresponding results through the API interface;

[0055] The result analysis and key value extraction module analyzes the results returned by the API interface and extracts the key values ​​of the corresponding fields of the big data;

[0056] The data result comparison module compares the key value extracted by the result analysis and key value extraction module with the expected value in the data table.

[0057] Optionally, the system also includes a use case data design module for preparing two data tables, Excel-1 and Excel-2, locally in advance. Excel-1 stores all test case values ​​to be modified, such as the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value; Excel-2 stores decision results that are changed due to the modification of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, and ensures that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate result comparison in the later automated testing.

[0058] Embodiment 3:

[0059] An electronic device, comprising:

[0060] processor;

[0061] a memory for storing instructions executable by the processor;

[0062] The processor is used to read the executable instructions from the memory and execute the instructions to implement the automated testing method for refrigerator defrosting decision based on the API interface as described in Example 1.

[0063] Here, it should be noted that the number of processors can be one or more. At the same time, the electronic device in the embodiment of the present disclosure may also include an input device and an output device. Among them, the processor, memory, input device and output device may be connected through a bus or in other ways, which are not specifically limited here.

[0064] The memory, as a computer-readable storage medium, can be used to store software programs, computer executable programs and various modules, such as the program or module corresponding to the control method of the table question and answer in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the electronic device by running the software programs or modules stored in the memory.

[0065] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.

[0066] Furthermore, on the other hand, the present application also proposes a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the automated testing method for refrigerator defrost decision based on the API interface as described in Example 1.

[0067] Although the present invention is described herein with reference to the illustrative embodiments of the present invention, the above embodiments are only preferred embodiments of the present invention, and the embodiments of the present invention are not limited to the above embodiments. It should be understood that those skilled in the art can design many other modifications and embodiments, which will fall within the scope and spirit of the principles disclosed in this application.

Claims

1. The automated test method for refrigerator defrosting decision based on API interface is characterized by: include: Establish a CI Job task for refrigerator defrosting decision automation test on the Jenkins continuous integration platform, select execution parameters from the data table through the CI Job task, then build and compile the CI Job task, automatically execute related compilation scripts, and implement automated testing; The data table includes at least excel-1 and excel-2. The excel-1 table is used to pass parameters to the API interface and obtain corresponding results after construction. The excel-2 table is used to save the expected results during use case design and compare them with the results after construction. The automatic execution of the relevant compilation scripts realizes the automated testing; the specific steps are: A. Retrieve the corresponding data items from the first row of the Excel-1 table in sequence, and pass each data item to the API interface in the form of function parameters. By building and compiling the CI Job task, call the relevant refrigerator defrosting decision execution script to implement the data test from rows 1, 2, ..., n in the Excel-1 table, and return the result data of the required big data field; B. Compare the decision result fields extracted after each execution with the corresponding expected result data in Excel-2. If the key values ​​extracted from the two correspond to each other, the test passes until all defrost decision use case tests are completed.

2. The refrigerator defrosting decision automation test method based on the API interface according to claim 1 is characterized in that: The key values ​​include: executing defrost or delaying defrost, and various defrost error print data.

3. The refrigerator defrosting decision automation test method based on API interface according to claim 1 is characterized in that: The method further comprises: Prepare two data tables, Excel-1 and Excel-2, locally. Excel-1 stores all the test case values ​​to be modified, including the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value; Excel-2 stores the decision results that are changed due to the modification of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, and ensures that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate result comparison in the later automated testing.

4. The refrigerator defrosting decision automation test system based on API interface is characterized by: Used to implement the automated testing method for refrigerator defrosting decision based on the API interface as claimed in claim 1.

5. The refrigerator defrosting decision automation test system based on API interface according to claim 4 is characterized in that: The system comprises: an algorithm execution module, a result analysis and key value extraction module and a data result comparison module which are arranged in sequence. The algorithm execution module is used to execute the modified data use case obtained by the parameters through the API interface, execute the data items n=1, 2, ..., N, in the data table, and return the corresponding results through the API interface; The result analysis and key value extraction module analyzes the results returned by the API interface and extracts the key values ​​of the corresponding fields of the big data; The data result comparison module compares the key value extracted by the result analysis and key value extraction module with the expected value in the data table.

6. The refrigerator defrosting decision automation test system based on API interface according to claim 5 is characterized in that: The system also includes a use case data design module, The use case data design module is used to prepare two data tables, Excel-1 and Excel-2, locally in advance. Excel-1 stores all test case values ​​to be modified, including the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value; Excel-2 stores the decision results changed due to the modification of the startup rate & high speed ratio, freezer cooling speed, average difference and average fluctuation value, and ensures that the data identifier of the decision result is consistent with the big data field of the decision result in the decision script, so as to facilitate result comparison in the later automated testing.

7. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the automatic testing method for refrigerator defrosting decision based on the API interface as claimed in claim 1.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the automated test method for refrigerator defrosting decision based on the API interface as claimed in claim 1.