Interactive Test Case Generation Through UI View Tree Traversal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for generating software test cases are inefficient due to the diversity and complexity of user interactive interfaces, leading to high computational costs and manual encoding issues.
Innovation Solution
A method for automatically generating interactive test cases by traversing clickable views in a user interface (UI) of an application program, recording path information, and generating test cases based on this traversal, using a stack to manage view positions and determining clickable views.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Extent of automation
If manual test case encoding method is used, then test cases can be generated, but manpower input increases and omissions may occur
Solution Approach 1:
The system performs self-service by automatically traversing the view tree and generating test cases without human intervention. The automated agent navigates through UI elements, executes click events, and creates test case code independently, eliminating the need for manual encoding while ensuring comprehensive coverage.
Solution Approach 2:
The patent replaces the mechanical manual encoding process with an automated computational system. Instead of human operators manually writing test case code, an automated agent traverses the view tree structure and programmatically generates test case representations, substituting human labor with algorithmic processing.
2Productivity
If manifold optimization-based algorithm is applied to modern application programs, then test case generation is attempted, but the diversity of interactive modes and complexity of user interface make it difficult to effectively obtain code space
Solution Approach 1:
The patent segments the complex user interface into a hierarchical view tree structure, where the UI is divided into parent views and child views. This segmentation simplifies the complexity by breaking down the monolithic interface into manageable hierarchical components that can be systematically traversed and tested.
Solution Approach 2:
The system performs preliminary action by pre-traversing the view tree to identify all clickable views and their hierarchical paths before actual test case generation. This preliminary exploration of the UI structure enables the system to understand the code space in advance, making the subsequent test case generation more efficient and targeted.
Data Source
AI summary
Disclosed is a method for automatically generating interactive test cases. The method comprises: after a UI of an application program is displayed, traversing all views in a view tree corresponding to the UI of the application program, and recording a path, in the view tree, of each view therein that can be clicked on, so as to obtain a set of path information, in the view tree, of all the views that can be clicked on in the UI; and respectively generating a corresponding test case for each piece of path information in the set: in the test case, according to path information, in the view tree, of a view under test, finding the view in the UI interface of the application program, and triggering a click event therefore, that is, completing a click interaction test on the view.


