User interface test coverage
A user interface (“UI”) code coverage system and process determines the coverage by test code of UI Components in a computer program. In other words, the UI code coverage system and process determine whether the test code tests a UI Component. In at least one embodiment, the UI code coverage system and process identify the particular UI Components tested by the test code, provide coverage (i.e. tested) statistics, provide a visualization of the UI Component tested, provide a visualization of tested and not-tested (also referred to respectively as “covered” and “not covered”) UI Components of a UI Screen.
1 . An apparatus to determine coverage by test code of user interface (UI) components in a first computer program, the apparatus comprising:
one or more processors of a computer system; and
a memory, coupled to the one or more processors, that stores code and execution of the code by the one or more processors causes the computer system to perform operations comprising:
sending a computer program that includes UI components to a computer system;
receiving a report of the coverage by the test code of the UI components;
(a) locating a UI object in one of the UI components by following a mapped objects hierarchical path in a UI map from a root UI object down to the UI object being located for the UI objects in the UI map;
(b) linking the UI object located with an image showing how the UI object in the UI component looks like when the UI of the computer program is actually visually displayed for the UI objects in the UI map;
(c) storing the link, an identifier (ID) of the UI object located, and screen location coordinate information of the UI object located in a UI component name mapping database for the UI objects in the UI map;
(d) extracting from the test code, ID's of the UI components that are being accessed by the test code;
(e) determining the coverage by the test code of the UI components by comparing a number of UI components in the computer program relative to a number of UI components extracted from the test code; and
(f) generating a report of the coverage by the test code.
2 . The apparatus of claim 1 wherein execution of the code by the one or more processors causes the computer system to perform further operations comprising:
determining if the computer program has changed;
for determining if the test code has changed; and
causing the means in elements (a)-(c) and (e)-(g) to operate when either the computer program or the test code has changed.
3 . The apparatus of claim 1 wherein the performance of elements (a)-(c) and (e)-(g) is platform independent.
4 . The apparatus of claim 1 wherein determining the coverage by the test code of the UI components by comparing a number of UI components in the computer program relative to a number of UI components extracted from the test code comprises:
determining a number of the UI objects being accessed by the test code compared with a total number of UI Objects present in the computer program.
5 . The apparatus of claim 1 wherein execution of the code by the one or more processors causes the computer system to perform further operations comprising:
determining the coverage by the test code without regard to a platform used to display a UI screen that includes the UI Components.
6 . An apparatus to determine coverage by test code of user interface (UI) components in a first computer program, the apparatus comprising:
one or more processors of a first computer system; and
a memory, coupled to the one or more processors, that stores code and execution of the code by the one or more processors causes the computer system to perform operations comprising:
sending a computer program that includes UI components to a second computer system;
receiving a report of the coverage by the test code of the UI components, wherein the second computer system is programmed with code stored in a memory and execution by one or more processors of the second computer system to determine the coverage by test code of user interface (UI) components in a computer program comprises:
(a) locating a UI object in one of the UI components by following a mapped objects hierarchical path in a UI map from a root UI object down to the UI object being located;
(b) linking the UI object located with an image showing how the UI object in the UI component looks when the UI of the computer program is actually visually displayed;
(c) storing the link, an identifier (ID) of the UI object located, and screen location coordinate information of the UI object located in a UI component name mapping database;
(d) repeating (a)-(c) for additional UI objects in the UI map;
(e) extracting from the test code, ID's of the UI objects in the UI components that are being accessed by the test code;
(f) determining the coverage by the test code of the UI components by comparing a number of UI objects located in the UI components in the computer program relative to a number of UI objects extracted from the test code to determine coverage of the UI objects in the UI components by the test code, wherein determining coverage of the UI components is derived from a determination of the coverage of the UI objects in the UI components; and
(g) generating the report of the coverage by the test code of the UI components.
7 . The apparatus of claim 6 wherein execution of the second code further comprises:
wherein execution of the code by the one or more processors of the second computer causes the second computer system to perform further operations comprising:
determining if the computer program has changed;
determining if the test code has changed; and
when either the computer program or the test code has changed, performing elements (a)-(g).
8 . The method of claim 6 wherein the performance of elements (a)-(g) is platform independent.
9 . The method of claim 6 wherein determining the coverage by the test code of the UI components by comparing a number of UI components in the computer program relative to a number of UI components extracted from the test code comprises:
determining of the UI objects being accessed by the test code compared with a total number of UI Objects present in the computer program.
10 . The method of claim 6 wherein elements (a)-(g) are performed without executing the computer program and without executing the test code.
11 . The method of claim 6 wherein execution of the code further comprises:
determining the coverage by the test code without regard to a platform used to display a UI screen that includes the UI Components.