CN115840711B - Software testing method, system, storage medium and computer for graphic user interface - Google Patents

Software testing method, system, storage medium and computer for graphic user interface Download PDF

Info

Publication number
CN115840711B
CN115840711B CN202211705528.XA CN202211705528A CN115840711B CN 115840711 B CN115840711 B CN 115840711B CN 202211705528 A CN202211705528 A CN 202211705528A CN 115840711 B CN115840711 B CN 115840711B
Authority
CN
China
Prior art keywords
class
elements
class element
test
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211705528.XA
Other languages
Chinese (zh)
Other versions
CN115840711A (en
Inventor
田丰
黄伟
祝华锋
丁建中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Firefly Microelectronics Technology Co ltd
Original Assignee
Jiangxi Firefly Microelectronics 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 Jiangxi Firefly Microelectronics Technology Co ltd filed Critical Jiangxi Firefly Microelectronics Technology Co ltd
Priority to CN202211705528.XA priority Critical patent/CN115840711B/en
Publication of CN115840711A publication Critical patent/CN115840711A/en
Application granted granted Critical
Publication of CN115840711B publication Critical patent/CN115840711B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a software testing method, a system, a storage medium and a computer of a graphical user interface, wherein the method comprises the following steps: analyzing element information of all basic elements in the graphical user interface to be tested; screening out non-tag elements in each basic element, and dividing each non-tag element into a class of elements and a class of elements; the method comprises the steps of defining a test node by a user, constructing a preliminary test case file of two elements according to the test node, and performing preliminary test by using the preliminary test case file to obtain a preliminary test result; calculating the dependence and demand of two elements by using the element characteristics and the element positions; respectively acquiring execution data of two elements, and reallocating test case files based on a preliminary test result, the execution data of the two elements, the dependence degree, the demand degree and the total system execution amount; and converting the test case file into a test execution file, and performing software test on the two elements by using the test execution file to obtain a corresponding test result.

Description

Software testing method, system, storage medium and computer for graphic user interface
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, a system, a storage medium, and a computer for testing software of a graphical user interface.
Background
With the rapid development of computer technology, various types of software are layered endlessly in life, so that the number of software development is gradually increased, however, errors can occur in the process of designing and developing the software, so that the software function is invalid, and therefore, the quality problem of the software is more and more important.
The graphical user interface is a front-end representation of the underlying program code that reflects the corresponding front-end for user operations such as selecting a drop-down list item, clicking a control, and the like. Because of its more convenient user-operated features than the command line interfaces in previous computer systems, graphical user interfaces are becoming the most direct and efficient way of human-machine interaction in today's computer systems, and thus software testing for graphical user interfaces should also be a very important part of the overall graphical user interface software testing.
The existing user image interface testing method is quite boring and huge in labor cost due to manual testing by workers, and meanwhile, the manual testing has the problems of incomplete testing and large subjectivity. With the development of user image interface software, omission can not be avoided in manual test or invalid test cases can be generated because the association relation among the controls is not considered; meanwhile, with the enlargement, the complexity and the diversification of the user image interface software, the manual test also has the problems of uneven distribution or complex distribution of the test workload.
Disclosure of Invention
Based on this, an object of the present invention is to provide a method, a system, a storage medium and a computer for testing software of a graphical user interface, so as to at least solve the above-mentioned drawbacks.
The invention provides a software testing method of a graphical user interface, which comprises the following steps:
analyzing element information of all basic elements in a graphical user interface to be tested, wherein the element information comprises element positions, element characteristics and element identifiers;
screening out non-tag elements in the basic elements, and dividing the non-tag elements into a class of elements and a class of elements based on the element identifiers;
the self-defining test node constructs a preliminary test case file of the first class element and the second class element according to the test node, and performs preliminary test on the first class element and the second class element by utilizing the preliminary test case file to obtain a preliminary test result;
respectively calculating the dependence and the demand of the first class element and the second class element by utilizing the element characteristics and the element positions;
respectively acquiring execution data of the first class element and the second class element, and reallocating test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount;
and converting the test case file into a test execution file, and performing software test on the first class element and the second class element by using the test execution file to obtain a corresponding test result.
Further, the element identifiers are window type identifiers and non-window type identifiers, and the step of dividing each non-tag element into a class one element and a class two element based on the element identifiers comprises the following steps:
acquiring state variable data corresponding to the window type identifier and the non-window type identifier, and acquiring element states of the non-tag elements;
and dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
Further, the step of calculating the degree of dependence and the degree of demand of the first class element and the second class element by using the element characteristics and the element positions respectively includes:
respectively acquiring composition data of the first class element and the second class element, and judging the dependency relationship between the first class element and the second class element based on a composition data execution list;
respectively calculating the dependence of the first class element and the second class element according to the dependence;
and customizing the demand degree of the user on the element characteristics, and calculating the demand degree of the first class element and the second class element according to the demand degree of the element characteristics and the element position.
Further, the steps of respectively obtaining the execution data of the first class element and the second class element, and reallocating the test case file for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependency, the demand and the total system execution amount of the first class element and the second class element comprise:
acquiring the total number of newly added/changed codes and the total number of multiplexing codes generated during testing in the preliminary test result, and the number of newly added/changed codes and the number of multiplexing codes generated by the first class element and the second class element;
calculating the workload of the first-class element and the second-class element according to the total system code amount, the total number of the newly added/changed codes, the total number of the multiplexing codes, and the number of the newly added/changed codes and the number of the multiplexing codes generated by the first-class element and the second-class element;
and reallocating the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements as well as the workload of the first-class elements and the workload of the second-class elements.
Further, the calculation formulas of the workloads of the first class element and the second class element are as follows:
Figure SMS_1
in the method, in the process of the invention,
Figure SMS_2
representing the total amount of system code>
Figure SMS_3
Representing the number of new/changed code lines, +.>
Figure SMS_4
Representing the number of multiplexed code lines, ">
Figure SMS_5
Representing the total number of lines of the new add/change code, +.>
Figure SMS_6
Representing the total number of lines of the multiplexed code.
The invention also provides a software testing system of the graphic user interface, which comprises:
the element information analysis module is used for analyzing the element information of all basic elements in the graphical user interface to be tested, wherein the element information comprises element positions, element characteristics and element identifiers;
the element screening module is used for screening out non-tag elements in the basic elements and dividing the non-tag elements into a class of elements and a class of elements based on the element identifiers;
the primary test module is used for customizing a test node, constructing a primary test case file of the first class element and the second class element according to the test node, and carrying out primary test on the first class element and the second class element by utilizing the primary test case file so as to obtain a primary test result;
the parameter calculation module is used for calculating the dependence and the demand of the first class element and the second class element by utilizing the element characteristics and the element positions respectively;
the test case distribution module is used for respectively acquiring the execution data of the first class element and the second class element, and reallocating test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount;
and the software testing module is used for converting the test case file into a test execution file, and carrying out software testing on the first class element and the second class element by utilizing the test execution file so as to obtain a corresponding test result.
Further, the element identifier is a window identifier and a non-window identifier, and the element screening module includes:
the element state acquisition unit is used for acquiring state variable data corresponding to the window type identifier and the non-window type identifier and acquiring element states of the non-tag elements;
the element dividing unit is used for dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
Further, the parameter calculation module includes:
the relation calculation unit is used for respectively acquiring the composition data of the first class element and the second class element, and judging the dependency relation between the first class element and the second class element based on the composition data execution list;
the dependency calculation unit is used for calculating the dependencies of the first class element and the second class element according to the dependency relation;
the demand computing unit is used for customizing the demand degree of the user on the element characteristics and computing the demand degree of the first class element and the second class element according to the demand degree of the element characteristics and the element position.
Further, the test case distribution module includes:
a code data obtaining unit, configured to obtain a total number of newly added/changed codes and a total number of multiplexed codes generated during testing in the preliminary test result, and a number of newly added/changed codes and a number of multiplexed codes generated by the first class element and the second class element;
the working amount calculating unit is used for calculating the working amount of the first-class element and the second-class element according to the total system code amount, the total newly added/changed code line number, the total multiplexing code line number and the newly added/changed code line number and the multiplexing code line number generated by the first-class element and the second-class element respectively;
the test case distribution unit is used for redistributing the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements as well as the workload of the first-class elements and the workload of the second-class elements.
The invention also proposes a storage medium on which a computer program is stored which, when executed by a processor, implements the software testing method of a graphical user interface described above.
The invention also provides a computer, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the software testing method of the graphical user interface when executing the computer program.
According to the software testing method, system, storage medium and computer of the graphical user interface, the basic elements are screened to reduce the influence of non-tag elements in the testing process, the dependency degree and the demand degree of each element are calculated by utilizing the element characteristics and the element positions, the test case files are redistributed for each element by acquiring the execution data and the corresponding dependency degree and demand degree of each element, further the uniform distribution of the workload of each element test is ensured, the accuracy of the testing process of each element is further improved, and the testing efficiency is improved.
Drawings
FIG. 1 is a flowchart of a software testing method of a graphical user interface according to a first embodiment of the present invention;
FIG. 2 is a detailed flowchart of step S102 in FIG. 1;
FIG. 3 is a detailed flow chart of step S104 in FIG. 1;
fig. 4 is a detailed flowchart of step S105 in fig. 1;
FIG. 5 is a block diagram of a software testing system according to a second embodiment of the present invention;
fig. 6 is a block diagram showing a structure of a computer according to a third embodiment of the present invention.
The invention will be further described in the following detailed description in conjunction with the above-described figures.
Detailed Description
In order that the invention may be readily understood, a more complete description of the invention will be rendered by reference to the appended drawings. Several embodiments of the invention are presented in the figures. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "mounted" on another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like are used herein for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
Example 1
Referring to fig. 1, a software testing method of a gui according to a first embodiment of the present invention is shown, and the software testing method of the gui specifically includes steps S101 to S106:
s101, analyzing element information of all basic elements in a graphical user interface to be tested, wherein the element information comprises element positions, element characteristics and element identifiers;
in this embodiment, when a test request transmitted by a data interface is obtained, a graphical user interface to be tested in the test request is obtained through the data interface, all basic elements of the test request are obtained by using a graphical object in the graphical user interface, and element information of the basic elements is obtained, including element positions, element characteristics and element identifiers, where the basic elements are all constituent elements of the graphical user interface, for example: element components such as menu bars, text boxes, scroll bars, etc., the element positions are the distribution positions of the element in the graphical user interface, and the element characteristics are the characteristics of the element acting in the graphical user interface, for example: the scroll bar is used as a scroll display effect in the graphical user interface, the element characteristic of the scroll bar is scroll display, and the element identifier is a type identifier of the element in the graphical user interface, wherein the type identifier comprises a window class and a non-window class, and the non-window class also comprises a menu class and a control class.
S102, screening out non-tag elements in the basic elements, and dividing the non-tag elements into a class of elements and a class of elements based on the element identifiers;
further, referring to fig. 2, the step S102 specifically includes steps S1021 to S1022:
s1021, acquiring state variable data corresponding to the window type identifier and the non-window type identifier, and acquiring element states of the non-tag elements;
s1022, dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
In this embodiment, the tag element is element information that does not perform man-machine interaction in the graphical user interface, for example: the frame, the module of pure display effect and the like, because the label element can influence the test effect of the graphical user interface, the label element in each basic element is screened out, the non-label element in each basic element is remained, and the state variable data corresponding to the window type identifier and the non-window type identifier in the element identifier is obtained, wherein the data of the window type identifier is the same as the state variable data of the static data in the non-window type identifier, and the state variable data of the non-static data in the non-window type identifier is different from the data of the window type identifier and the state variable data of the static data in the non-window type identifier;
based on the above, the element states of the non-tag elements are obtained, when the element states are in the data of the window type identifier and the state variable data of the static data in the non-window type identifier, the element identifier of the non-tag element corresponding to the element state is the static data in the window type identifier or the non-window type identifier, at this time, the non-tag element corresponding to the element state is marked as a type of element, and when the element states are in the state variable data of the non-static data in the non-window type identifier, the element identifier of the non-tag element corresponding to the element state is the non-static data in the non-window type identifier, at this time, the non-tag element corresponding to the element state is marked as a type of element.
S103, customizing a test node, constructing a preliminary test case file of the first class element and the second class element according to the test node, and carrying out preliminary test on the first class element and the second class element by utilizing the preliminary test case file to obtain a preliminary test result;
when the software testing is carried out, the software testing method comprises the steps that a plurality of testing node attributes are contained, a user establishes testing nodes according to the testing node attributes in a self-defining mode, the testing nodes comprise node attribute identifiers and node configuration data, the node attribute identifiers are unique identifiers of the testing node attributes, and information of the corresponding testing node attributes can be obtained through the identifiers; node attribute data, including node attributes customized by a user according to requirements, for example: the user needs are connectivity tests, and the node attributes are connectivity test node attributes (building attribute information such as connectivity test interfaces).
After the user-defined test nodes are obtained, the test nodes are combined with the test case basic file, and then a primary test case file is obtained.
S104, respectively calculating the dependence and the demand of the first class element and the second class element by using the element characteristics and the element positions;
further, referring to fig. 3, the step S104 specifically includes S1041 to S1043:
s1041, respectively acquiring composition data of the first class element and the second class element, and judging the dependency relationship between the first class element and the second class element based on a composition data execution list;
s1042, respectively calculating the dependence of the first class element and the second class element according to the dependence;
s1043, the demand degree of the user on the element characteristics is customized, and the demand degree of the first class element and the second class element is calculated according to the demand degree of the element characteristics and the element position.
In the implementation, the composition data of a first element and a second element are respectively acquired, wherein the composition data is a triplet (, ψ and W) of the elements, wherein the phi represents a node in the elements, namely a processing function set for processing the elements in a graphical user interface, the ψ represents a node in the elements, namely an execution function set for executing the elements in the graphical user interface, the W represents the weight of the elements, namely the importance degree of the node in the elements and the nodes in all the elements, and when the number of times of processing and execution of the elements in the test process is larger, the importance degree is larger, and the corresponding W value is higher.
Because the processing and execution of part of the first class elements require the triggering of the second class elements, the second class elements are subjected to dependency binding with the first class elements triggered by the second class elements, and the corresponding dependency relationship is calculated by the first class elements and the second class elements according to a preset composition data execution list, for example: when clicking the networking window, a certain drop-down menu bar (a class of elements) displaying account numbers and passwords is triggered in a text box (a class of elements) of the networking window, so that the triggering of the menu bar (a class of elements) is completely dependent on the text box (a class of elements), the dependency relationship of the menu bar (a class of elements) on the text box (a class of elements) is marked as 1, when the triggering of a certain class of elements is not completely dependent on a class of elements, the dependency relationship between two elements is marked as 0.5, when the triggering of a certain class of elements is not dependent on a class of elements, the dependency relationship between two elements is marked as 0, at the moment, the dependency relationship of the menu bar on the text box is judged through a preset composition data execution list, and the execution sequence corresponding to the dependency relationship between all the class of elements and the class of elements is recorded in the composition data execution list, when the dependency relationship between the class of elements is obtained, the dependency relationship corresponding to the dependency relationship can be obtained through the composition data execution list, and the dependency relationship is marked as smaller, and the dependency relationship is higher.
Further, the demand degree of the user for the element characteristics is customized, and the demand degree of the first class element and the second class element is calculated according to the demand degree of the element characteristics and the element position.
In the present embodimentThe demand level is divided into importance levels of various demands (i.e. element characteristics) of the user in the graphical user interface, for example: when the graphic user interface has login operation, it means that the user has the highest requirement level for login, namely, the requirement level of element characteristics corresponding to the login operation is the highest, in order to ensure that the key function used by the user can ensure that the benefit of the test is maximized when the test is performed, the efficiency of the whole test process is higher, in the embodiment, the requirement level is set between 0 and 1, and the requirement level phi is set x Defined as 5 classes: wherein the degree of demand phi of absolute importance x Takes a value of 1, and the important demand degree phi x The value is more than or equal to 0.6 and less than phi x Less than or equal to 1, slightly important demand degree phi x The value is not less than 0.3L x Less than or equal to 0.6, unimportant demand degree phi x The value is more than or equal to 0.3 and less than phi x Less than or equal to 0.1, the demand degree phi without demand x The value is 0.
S105, respectively acquiring execution data of the first class element and the second class element, and reallocating test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount;
further, referring to fig. 4, the step S105 specifically includes S1051 to S1053:
s1051, obtaining the total number of newly added/changed codes and the total number of multiplexing codes generated during testing in the preliminary test result, and the number of newly added/changed codes and the number of multiplexing codes generated by the first class element and the second class element;
s1052, working out the workload of the first class element and the second class element according to the total system code amount, the total number of the new addition/change codes, the total number of the multiplexing codes, and the number of the new addition/change codes and the number of the multiplexing codes generated by the first class element and the second class element;
s1053, reallocating the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements, and the workload of the first-class elements and the workload of the second-class elements.
In particular implementations, the total amount of system code is obtained
Figure SMS_7
And in the case of an error at the time of the test in the above-mentioned preliminary test result, the total number of lines of the new add/change code generated for the purpose of modifying the error +.>
Figure SMS_8
And acquiring the total number of multiplexing code lines common to test>
Figure SMS_9
;/>
Obtaining the new code line number generated for modifying the error element and the second element under the condition that the error occurs in the preliminary test result
Figure SMS_11
And the number of general multiplexing code lines->
Figure SMS_13
According to the total system code>
Figure SMS_15
Total number of new/changed codes +.>
Figure SMS_12
And multiplexing the total number of lines of the code->
Figure SMS_14
And the number of new/changed code lines generated by one type of element and two types of element +.>
Figure SMS_16
And multiplexing the number of code lines->
Figure SMS_17
The workload of the first element and the second element is calculated according to the following formula>
Figure SMS_10
Figure SMS_18
The workload of obtaining a class element and a class element
Figure SMS_19
After that, in dependence on the class element and class element>
Figure SMS_20
Degree of demand phi x Calculating the comprehensive value of the first element and the second element, and reallocating the test case file according to the comprehensive value:
Figure SMS_21
Figure SMS_22
in the method, in the process of the invention,
Figure SMS_23
the allocation coefficient of the test case file is represented, default is 1, the value can be set by a tester, if the tester thinks that the element needs to be allocated with more test case files, the test case file is obtained by adding +.>
Figure SMS_24
The value is increased, and the corresponding integrated value is also increased,/->
Figure SMS_25
Representing the dependency between elements, ++>
Figure SMS_26
The dependency base value is represented, by default 50.
After the comprehensive value of each element is calculated, the comprehensive value and the total amount of the test case file are utilized to distribute each element so as to reduce the calculated amount of the test.
S106, converting the test case file into a test execution file, and performing software test on the first class element and the second class element by using the test execution file to obtain a corresponding test result.
In the specific implementation, since the test case file does not have the execution capability, the test case file needs to be converted into an executable test execution file, the test case file is converted into a C language or programming language program file, and software testing is performed on the software to be tested through the test execution file, so that a corresponding test result is obtained.
In summary, according to the software testing method of the graphical user interface in the above embodiment of the present invention, the basic elements are screened to reduce the influence of the non-tag elements during testing, the dependency and the demand of each element are calculated by using the element characteristics and the element positions, and the test case files are redistributed for each element by obtaining the execution data and the corresponding dependency and demand of each element, so that the workload distribution uniformity of the test of each element is ensured, the accuracy of the testing process of each element is further improved, and the testing efficiency is improved.
Example two
In another aspect, please refer to fig. 5, which shows a software testing system according to a second embodiment of the present invention, the system includes:
the element information analysis module 11 is configured to analyze element information of all basic elements in the graphical user interface to be tested, where the element information includes element positions, element characteristics, and element identifiers;
the element screening module 12 is configured to screen out non-tag elements in each basic element, and divide each non-tag element into a class element and a class element based on the element identifier;
further, the element identifier is a window class identifier and a non-window class identifier, and the element screening module 12 includes:
the element state acquisition unit is used for acquiring state variable data corresponding to the window type identifier and the non-window type identifier and acquiring element states of the non-tag elements;
the element dividing unit is used for dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
The preliminary test module 13 is configured to customize a test node, construct a preliminary test case file of the first class element and the second class element according to the test node, and perform a preliminary test on the first class element and the second class element by using the preliminary test case file to obtain a preliminary test result;
a parameter calculation module 14, configured to calculate a degree of dependence and a degree of demand of the first element and the second element respectively using the element characteristics and the element positions;
further, the parameter calculation module 14 includes:
the relation calculation unit is used for respectively acquiring the composition data of the first class element and the second class element, and judging the dependency relation between the first class element and the second class element based on the composition data execution list;
the dependency calculation unit is used for calculating the dependencies of the first class element and the second class element according to the dependency relation;
the demand computing unit is used for customizing the demand degree of the user on the element characteristics and computing the demand degree of the first class element and the second class element according to the demand degree of the element characteristics and the element position.
The test case distribution module 15 is configured to obtain execution data of the first class element and the second class element, and redistribute test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependency, the demand, and the total system execution amount of the first class element and the second class element;
further, the test case allocation module 15 includes:
a code data obtaining unit, configured to obtain a total number of newly added/changed codes and a total number of multiplexed codes generated during testing in the preliminary test result, and a number of newly added/changed codes and a number of multiplexed codes generated by the first class element and the second class element;
the working amount calculating unit is used for calculating the working amount of the first-class element and the second-class element according to the total system code amount, the total newly added/changed code line number, the total multiplexing code line number and the newly added/changed code line number and the multiplexing code line number generated by the first-class element and the second-class element respectively;
the test case distribution unit is used for redistributing the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements as well as the workload of the first-class elements and the workload of the second-class elements.
The software testing module 16 is configured to convert the test case file into a test execution file, and perform a software test on the first class element and the second class element using the test execution file.
The functions or operation steps implemented when the above modules and units are executed are substantially the same as those in the above method embodiments, and are not described herein again.
The software testing system provided by the embodiment of the invention has the same implementation principle and technical effects as those of the embodiment of the method, and for the sake of brevity, reference may be made to the corresponding contents of the embodiment of the method.
Example III
The present invention also proposes a computer, please refer to fig. 6, which shows a computer according to a third embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20, wherein the processor 20 implements the software testing method of the graphical user interface when executing the computer program 30.
The memory 10 includes at least one type of storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. Memory 10 may in some embodiments be an internal storage unit of a computer, such as a hard disk of the computer. The memory 10 may also be an external storage device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. Further, the memory 10 may also include both internal storage units and external storage devices of the computer. The memory 10 may be used not only for storing application software installed in a computer and various types of data, but also for temporarily storing data that has been output or is to be output.
The processor 20 may be, in some embodiments, an electronic control unit (Electronic Control Unit, ECU), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, for executing program codes or processing data stored in the memory 10, such as executing an access restriction program, or the like.
It should be noted that the structure shown in fig. 6 does not constitute a limitation of a computer, and in other embodiments, the computer may include fewer or more components than shown, or may combine certain components, or may have a different arrangement of components.
The embodiment of the invention also provides a storage medium, on which a computer program is stored, which when being executed by a processor, implements the software testing method of the graphical user interface.
Those of skill in the art will appreciate that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (9)

1. A method for testing software of a graphical user interface, comprising:
analyzing element information of all basic elements in a graphical user interface to be tested, wherein the element information comprises element positions, element characteristics and element identifiers;
screening out non-tag elements in the basic elements, and dividing the non-tag elements into one type of elements and two types of elements based on the element identifiers, wherein the one type of elements are non-tag elements corresponding to static data in window identifiers or non-window identifiers, and the two types of elements are non-tag elements corresponding to non-static data in non-window identifiers;
the self-defining test node constructs a preliminary test case file of the first class element and the second class element according to the test node, and performs preliminary test on the first class element and the second class element by utilizing the preliminary test case file to obtain a preliminary test result;
respectively calculating the dependence and the demand of the first class element and the second class element by utilizing the element characteristics and the element positions;
respectively acquiring execution data of the first class element and the second class element, and reallocating test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount;
converting the test case file into a test execution file, and performing software test on the first class element and the second class element by using the test execution file to obtain a corresponding test result;
the step of respectively acquiring the execution data of the first class element and the second class element, and reallocating the test case file for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount comprises the following steps:
acquiring the total number of newly added/changed codes and the total number of multiplexing codes generated during testing in the preliminary test result, and the number of newly added/changed codes and the number of multiplexing codes generated by the first class element and the second class element;
calculating the workload of the first-class element and the second-class element according to the total system code amount, the total number of the newly added/changed codes, the total number of the multiplexing codes, and the number of the newly added/changed codes and the number of the multiplexing codes generated by the first-class element and the second-class element;
and reallocating the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements as well as the workload of the first-class elements and the workload of the second-class elements.
2. The method of claim 1, wherein the element identifiers are window class identifiers and non-window class identifiers, and wherein the step of dividing each of the non-tag elements into a class one element and a class two element based on the element identifiers comprises:
acquiring state variable data corresponding to the window type identifier and the non-window type identifier, and acquiring element states of the non-tag elements;
and dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
3. The software testing method of a graphical user interface according to claim 1, wherein the step of calculating the degree of dependence and the degree of demand of the one type of element and the two type of element, respectively, using the element characteristics and the element positions comprises:
respectively acquiring composition data of the first class element and the second class element, and judging the dependency relationship between the first class element and the second class element based on a composition data execution list;
respectively calculating the dependence of the first class element and the second class element according to the dependence;
and customizing the demand degree of the user on the element characteristics, and calculating the demand degree of the first class element and the second class element according to the demand degree of the element characteristics and the element position.
4. The software testing method of a graphical user interface according to claim 1, wherein the calculation formulas of the workloads of the first class element and the second class element are:
Figure QLYQS_1
in the method, in the process of the invention,
Figure QLYQS_2
representing the total amount of system code>
Figure QLYQS_3
Representing the number of new/changed code lines, +.>
Figure QLYQS_4
Representing the number of multiplexed code lines, ">
Figure QLYQS_5
Representing the total number of lines of the new add/change code, +.>
Figure QLYQS_6
Representing the total number of lines of the multiplexed code.
5. A software testing system for a graphical user interface, comprising:
the element information analysis module is used for analyzing the element information of all basic elements in the graphical user interface to be tested, wherein the element information comprises element positions, element characteristics and element identifiers;
the element screening module is used for screening out non-tag elements in the basic elements, and dividing the non-tag elements into one type of elements and two types of elements based on the element identifiers, wherein the one type of elements are non-tag elements corresponding to static data in window identifiers or non-window identifiers, and the two types of elements are non-tag elements corresponding to non-static data in non-window identifiers;
the primary test module is used for customizing a test node, constructing a primary test case file of the first class element and the second class element according to the test node, and carrying out primary test on the first class element and the second class element by utilizing the primary test case file so as to obtain a primary test result;
the parameter calculation module is used for calculating the dependence and the demand of the first class element and the second class element by utilizing the element characteristics and the element positions respectively;
the test case distribution module is used for respectively acquiring the execution data of the first class element and the second class element, and reallocating test case files for the first class element and the second class element based on the preliminary test result, the execution data of the first class element and the second class element, the dependence degree and the demand degree of the first class element and the second class element and the total system execution amount;
the software testing module is used for converting the test case file into a test execution file, and carrying out software testing on the first class element and the second class element by utilizing the test execution file so as to obtain a corresponding test result;
the test case distribution module comprises:
a code data obtaining unit, configured to obtain a total number of newly added/changed codes and a total number of multiplexed codes generated during testing in the preliminary test result, and a number of newly added/changed codes and a number of multiplexed codes generated by the first class element and the second class element;
the working amount calculating unit is used for calculating the working amount of the first-class element and the second-class element according to the total system code amount, the total newly added/changed code line number, the total multiplexing code line number and the newly added/changed code line number and the multiplexing code line number generated by the first-class element and the second-class element respectively;
the test case distribution unit is used for redistributing the test case files for the first-class elements and the second-class elements according to the dependence and the demand of the first-class elements and the second-class elements as well as the workload of the first-class elements and the workload of the second-class elements.
6. The software testing system of a graphical user interface of claim 5 wherein the element identifications are window class identifications and non-window class identifications, the element screening module comprising:
the element state acquisition unit is used for acquiring state variable data corresponding to the window type identifier and the non-window type identifier and acquiring element states of the non-tag elements;
the element dividing unit is used for dividing each non-tag element into a class element and a class element according to the state variable data and the element state.
7. The software testing system of a graphical user interface of claim 5 wherein said parameter calculation module comprises:
the relation calculation unit is used for respectively acquiring the composition data of the first class element and the second class element, and judging the dependency relation between the first class element and the second class element based on the composition data execution list;
the dependency calculation unit is used for calculating the dependencies of the first class element and the second class element according to the dependency relation;
the demand computing unit is used for customizing the demand degree of the user on the element characteristics and computing the demand degree of the first class element and the second class element according to the demand degree of the element characteristics and the element position.
8. A storage medium having stored thereon a computer program which, when executed by a processor, implements a software testing method of a graphical user interface as claimed in any of claims 1 to 4.
9. A computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a software testing method for a graphical user interface as claimed in any one of claims 1 to 4 when the computer program is executed.
CN202211705528.XA 2022-12-29 2022-12-29 Software testing method, system, storage medium and computer for graphic user interface Active CN115840711B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211705528.XA CN115840711B (en) 2022-12-29 2022-12-29 Software testing method, system, storage medium and computer for graphic user interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211705528.XA CN115840711B (en) 2022-12-29 2022-12-29 Software testing method, system, storage medium and computer for graphic user interface

Publications (2)

Publication Number Publication Date
CN115840711A CN115840711A (en) 2023-03-24
CN115840711B true CN115840711B (en) 2023-05-09

Family

ID=85579408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211705528.XA Active CN115840711B (en) 2022-12-29 2022-12-29 Software testing method, system, storage medium and computer for graphic user interface

Country Status (1)

Country Link
CN (1) CN115840711B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117331847B (en) * 2023-12-01 2024-01-30 成都中科合迅科技有限公司 Automatic test method and system supporting graphic interface

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020069039A1 (en) * 2000-12-01 2002-06-06 Ricks Kenneth G. System and method for creating architectural descriptions of real-time simulations
US20120131556A1 (en) * 2010-11-19 2012-05-24 International Business Machines Corporation Xpath-based selection assistance of gui elements during manual test script authoring for xml-based applications
US9652366B2 (en) * 2014-12-04 2017-05-16 Hcl Technologies Ltd. Code change analysis to optimize testing lifecycle
CN104699608B (en) * 2015-03-10 2017-10-27 于秀山 Graphic User Interface software automatic test approach and device
CN107193739B (en) * 2017-05-23 2020-06-05 张泽祎 Black box regression testing method
US20200272558A1 (en) * 2019-02-21 2020-08-27 Microsoft Technology Licensing, Llc Automated layout testing for mobile device applications
CN111625447B (en) * 2020-05-06 2023-08-18 Oppo广东移动通信有限公司 Test method and device, electronic equipment and computer readable storage medium
CN115168196A (en) * 2022-06-24 2022-10-11 四川大学 WEB GUI test case generation method based on event dependency model
CN115248783B (en) * 2022-09-26 2022-12-23 江西萤火虫微电子科技有限公司 Software testing method, system, readable storage medium and computer equipment

Also Published As

Publication number Publication date
CN115840711A (en) 2023-03-24

Similar Documents

Publication Publication Date Title
US7890951B2 (en) Model-based provisioning of test environments
CN108304201B (en) Object updating method, device and equipment
US7899903B2 (en) Template based management system
US6995765B2 (en) System, method, and computer program product for optimization of a scene graph
CN107896162B (en) Deployment method and device of monitoring system, computer equipment and storage medium
US7624349B2 (en) Declarative definition enabling graphical designer reuse
US8560819B2 (en) Software execution using multiple initialization modes
US20130283188A1 (en) Template based management of services
CN108958736A (en) Page generation method, device, electronic equipment and computer-readable medium
US11966312B2 (en) Operation logs visualization device, operation logs visualization method and operation logs visualization program
WO2007121571A1 (en) Method and system for determining compatibility of computer systems
CN115840711B (en) Software testing method, system, storage medium and computer for graphic user interface
US10747638B2 (en) Computing memory health metrics
CN110519100A (en) A kind of more cluster management methods, terminal and computer readable storage medium
CN106557307B (en) Service data processing method and system
CN112765023A (en) Test case generation method and device
US20080180437A1 (en) Reporting fixed-point information for a graphical model
CN111736884A (en) Componentization method and system
CN116541065A (en) Software system construction method, device, equipment and computer readable storage medium
CN101136780A (en) Method, system to obtain user command information, and user command registered device
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN102354275B (en) Text input box and data processing method thereof
US11182272B2 (en) Application state monitoring
US9436575B2 (en) Selective profiling of applications
US7675866B1 (en) Method and system for analyzing resource needs for a configurable computing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant