CN104679519B - Graphical user interface software function acquisition methods and device - Google Patents

Graphical user interface software function acquisition methods and device Download PDF

Info

Publication number
CN104679519B
CN104679519B CN201510104809.3A CN201510104809A CN104679519B CN 104679519 B CN104679519 B CN 104679519B CN 201510104809 A CN201510104809 A CN 201510104809A CN 104679519 B CN104679519 B CN 104679519B
Authority
CN
China
Prior art keywords
node
menu
window
software
control
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
CN201510104809.3A
Other languages
Chinese (zh)
Other versions
CN104679519A (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.)
China Software Evaluation Center
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201510104809.3A priority Critical patent/CN104679519B/en
Publication of CN104679519A publication Critical patent/CN104679519A/en
Application granted granted Critical
Publication of CN104679519B publication Critical patent/CN104679519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a kind of graphical user interface software function acquisition methods, including:The Microsoft's user mutual automation MS UIA frames provided using Windows operating system, analyze the user interface of tested software, obtain the menu class and dialog class control element in main interface;By the click event of automatic trigger menu and control, secondary menu or secondary dialog box window is obtained, in this way, recurrence finds out the element included in the menu class or dialog class control of all levels of tested software;By analyzing menu hierarchy relation or dialog box window call relation, the function composition structure of tested software is drawn.Graphical user interface software function acquisition methods and device disclosed by the invention, can automatically, quickly and accurately obtain function possessed by Graphic User Interface software.

Description

Graphical user interface software function acquisition methods and device
Technical field
The present invention relates to technical field of software engineering, more particularly to a kind of graphical user interface software function acquisition methods and Device.
Background technology
Graphic User Interface software is with its is easy to operate, directly perceived, is conveniently used widely, compared with embedded software, Graphic User Interface software includes many windows, includes many controls again in each window, these windows and control are not The different function of software is constituted with combination, user is by the control in operation interface, function as defined in realization.Window and control Diversity and combination complexity, cause to be difficult to obtain function designed by software with conventional method, that is, allow to do Arrive, its workload is also very big.
Software function is the important attribute of software, is the works such as software size measurement, software development and the estimation of test job amount The basis of work.At present, software requirement mostlys come from Software Requirement Specification document, according to traditional software development V models, Software development was needed by several stages such as demand analysis → Outline Design → detailed design → coding → tests, wherein, software Demand analysis is the work firstly the need of development, in the software requirement analysis stage, specifies the demand of software.This development mode institute There are the following problems for definite software requirement:1st, uniformity is poor, theoretically, the document such as Software Requirement Specification should with it is soft Part version is consistent, but in detailed programs, due to various reasons, developer is difficult to the software requirement that upgrades in time, causes There are larger difference with actual software for software requirement;2nd, software function obtains heavy workload.Graphical user interface software function It is various and complicated, software still either is performed by actual by reading related software document, workload is all very big.
With widely using for the new software development model such as rapid prototype development, software development enters iteratively faster Epoch, developer change the degree of dependence of software requirement, have been no longer required for software requirement clearly detailed first After could start programing work.
In view of this, to fill up the blank of the automatic acquiring technology of the function of existing technical field of software engineering, and it is directed to Graphic user interface obtains technical problem present in software function, it is necessary to provides a kind of new Graphic User Interface software work( Energy acquisition methods and device, can automatically, quickly and accurately obtain function possessed by Graphic User Interface software.
The content of the invention
To solve the above-mentioned problems, a kind of graphical user interface software function acquisition methods and device provided by the invention, It can automatically, quickly and accurately obtain function possessed by Graphic User Interface software.
The present invention provides a kind of graphical user interface software function acquisition methods, including:S1, operated using Windows Microsoft's user mutual automation MS-UIA frames that system provides, analyze the user interface of tested software, obtain main boundary Menu class and dialog class control element in face;S2, the click event by automatic trigger menu and control, obtain secondary dish List or secondary dialog box window, in this way, recurrence are found out in the menu class or dialog class control of all levels of tested software Comprising element;S3, by analyzing menu hierarchy relation or dialog box window call relation, draw the function composition of tested software Structure.
As a kind of embodiment, the step S1 further comprises:Control tree in window is built by current window handle Root node, the TreeWalker classes provided using UIA frames, use extreme saturation algorithm recurrence Construction using current window as root The control tree of node, so as to obtain all controls and its information in window.
As a kind of embodiment, the control for using extreme saturation algorithm recurrence Construction using current window as root node Tree, further comprises:Starting point using the main window parameter rootElement of tested program as traversal;Found first during traversal First child node of rootElement, if the node is menu control, needs to travel through all sub- knots of current node Point, at this moment, first menu is unfolded, and then calls the Invoke control schemes of the child node after expansion, other node types are at this In do not process;The child node control of recursive traversal current node, after having handled child node control, handles the brother of current node Node.
As a kind of embodiment, the hierarchical relationship of the menu or dialog box obtains, and further comprises:Acquire tested soft All controls and its information of part main interface window, the information are shown with tree structure;According to control type ControlType Attribute be obtained by filtration control type as menu or the interface element of dialog box;When control type is menu interface element, Main menu is obtained, by calling invoke control schemes to trigger GUI events, simulates the operation for manually clicking on menu item, recurrence is looked into The Submenu Items of the current set of menu is looked for, and preserves the hierarchical relationship of main menu and submenu;When control type is dialog interface member When plain, main window is obtained, by calling invoke control schemes to trigger GUI events, simulation is manually clicked on the operation of each button, passed Return the child window for searching current window, to obtain the call relation between window, and it is main window that the call relation between window, which is preserved, The hierarchical relationship of mouth and child window.
As a kind of embodiment, the Submenu Items of described recursive lookup the current set of menu, and preserve main menu and submenu Hierarchical relationship, further comprises:Incoming main window node, and obtain first child node;Judge whether the node is empty, if The node is non-NULL, then determines whether the node is menu, if the node is menu, into Invoke control schemes, And recursive traversal child node, if the node is not menu, recursive traversal child node;If the node is not menu, recursive traversal Node;After recurrence, sibling is handled;Terminate if the node is sky.
As a kind of embodiment, the child window of the recursive lookup current window, to obtain the call relation between window, and Call relation between window is saved as to the hierarchical relationship of main window and child window, is further comprised:Incoming main window node;Obtain Take first child node;Judge whether the node is empty, if the node is non-NULL, determine whether the node whether be by Button, if the node is button, into Invoke control schemes, and recursive traversal child node, it is followed by subsequent processing sibling;If should Node is not that button then terminates;Terminate if the node is sky.
As a kind of embodiment, the S3 further comprises:Menu hierarchy call relation chained list and window are called in chained list The functional imperative of software is contained, a function of software, chained list are constituted from the start node of chained list to some termination node All paths constitute function possessed by software;After menu and window and its level call relation is obtained respectively, All child nodes of function are first found, is found by backtracking from the upward funcall relation of the child node, passes through traverse menus Level call relation chained list and window call chained list, and traversing result is respectively converted into text display manner and graphical display side Formula, structure chart is formed to obtain all functions of tested software and function.
Present invention also offers a kind of graphical user interface software function acquisition device, including:Elemental analysis module, is used for The Microsoft user mutual automation MS-UIA frames provided using Windows operating system, to the user interface of tested software into Row analysis, obtains menu class and dialog class control element in main interface;Analytic hierarchy process module, for passing through automatic trigger dish Single and control click event, obtains secondary menu or secondary dialog box window, in this way, recurrence is found out tested software and owned The element included in the menu class or dialog class control of level;Structural generation module, for by analyzing menu hierarchy relation Or dialog box window call relation, show that the function of tested software forms structure.
Method and dress proposed by the invention are used it can be seen from the technical solution provided by embodiments of the invention described above Put, the function designed by software can be extracted directly from software interface, revolutionize the acquisition modes of software function.It is this On the one hand method can reduce the workload of developer, developer can will write the time of software requirement document more Realized for software function, improve software development efficiency;On the other hand the uniformity of software requirement and final software can be ensured. Since software requirement derives from the implementing result interface of final software, developer no longer needs manual frequent updating software requirement Document, fundamentally solves Software functional requirements and realizes inconsistent problem with software.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Attached drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this For the those of ordinary skill of field, without having to pay creative labor, other can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is the flow diagram of the graphical user interface software function acquisition methods of one embodiment of the invention;
Fig. 2 is the acquisition window control of one embodiment of the invention and its flow diagram of information;
Fig. 3 is the flow diagram of the acquisition menu hierarchy call relation of one embodiment of the invention;
Fig. 4 is the flow diagram of the acquisition window call relation of one embodiment of the invention;
Fig. 5 is the flow diagram that function is obtained for menu class software scene of one embodiment of the invention;
Fig. 6 is the structure diagram of the menu class software interface control tree of one embodiment of the invention;
Fig. 7 is the structure diagram of the menu class menu level call relation of one embodiment of the invention;
Fig. 8 is the function composition figure of the Students'Management System software of one embodiment of the invention;
Fig. 9 is the feature path figure of the Students'Management System software of one embodiment of the invention;
Figure 10 is the flow diagram of the graphical user interface software function acquisition methods of one embodiment of the invention.
Embodiment
Embodiments of the present invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning Same or similar element is represented to same or similar label eventually or there is same or like element.Below by ginseng The embodiment for examining attached drawing description is exemplary, and is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " one It is a ", " described " and "the" may also comprise plural form.It is to be further understood that what is used in the specification of the present invention arranges Diction " comprising " refer to there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition One or more other features, integer, step, operation, element, component and/or their groups.It should be understood that when we claim member Part is " connected " or during " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be Intermediary element.In addition, " connection " used herein or " coupling " can include wireless connection or coupling.Wording used herein "and/or" includes any cell of one or more associated list items and all combines.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology Term and scientific terminology) there is the meaning identical with the general understanding of the those of ordinary skill in fields of the present invention.Should also It should be appreciated that those terms such as defined in the general dictionary should be understood that with the context of the prior art The consistent meaning of meaning, and unless defined as here, will not be explained with the implication of idealization or overly formal.
For ease of the understanding to the embodiment of the present invention, done further by taking several specific embodiments as an example below in conjunction with attached drawing Explanation, and each embodiment does not form the restriction to the embodiment of the present invention.
For such case and current aforementioned problem faced, the present invention is proposed to be used by the figure of analysis software The method that family interface obtains software function, mainly solves how quickly and accurately to obtain function technical problem possessed by software.
Graphic user interface class software, its displaying interface mode are broadly divided into two kinds:Based on menu window and based on dialogue The interface of frame window.Although both graphic user interface class software show styles are different, identical method can be used Obtain software function.The Microsoft UI Automation that this programme is mainly provided using Microsoft's Windows operating system (abbreviation UIA) frame, analyzes the user interface of tested software, obtains menu and control element in main interface, then By the click event of automatic trigger menu and control, secondary menu or secondary dialog box window is obtained, in this way, recurrence is looked for Go out all levels of tested software menu or dialog box in the element that includes, by analyzing menu hierarchy relation or dialog box window Call relation, draws the function composition structure of tested software.The main working process of this programme is as shown in Figure 1, by tested software Main interface is divided into menu class software and dialog class software;Main interface menu item is obtained for menu class software, for dialogue Frame class software obtains main interface button control;Obtain menu hierarchy relation and window call relation respectively using recursion method;Root According to menu hierarchy relation and window call relation systematic function and function composition figure.
Microsoft's user mutual automation (Microsoft UI Automation, referred to as " MS-UIA ") frame is MSAA skills One substitute of art:Allow control and application program that there is more preferable accessibility (accessible).Briefly, it is exactly Several dll, there is provided a set of API and Interface, and its corresponding pattern, allow the developer of software to follow the pattern and go reality Now corresponding interface, so that the user of software can preferably use the software.IA has redesigned a set of framework, nothing By being to traditional winform, or new wpf, a set of unified model is defined;The use of its API is also relatively simpler; Meanwhile and .net framework 3.0 together, also have the instrument of a UISpy, everybody can be aided in use UIA.
MS-UIA exactly defines two role:UIA Provider, that is, software is mainly the developer of software in itself Go to realize relevant interface, UIA Client, that is, automatized script and relevant assistive according to corresponding pattern Technology applications, from the angle of tester, mainly call corresponding API to go to realize automation Test script.
UIA Provider:Developer determines control behavior and realizes corresponding UIA control pattern, for For standard control, acquiescence is to support UIA, and for customized control, it is necessary to realize that the behavior of the control corresponds to UIA Defined interface.
UIA Client:In contrast, UIA Client are then simple very much, only relevant UIA API need to be called to have gone Into automatic test script.
The simple relation of the two refers to figure below:
UIA mainly has 4 DLL:UIAutomationProvider.dll, defines the interface of various actions, example Such as, it is assumed that have a customized control, developer thinks that it needs to support Dock behaviors, it is necessary to realizes IDockProvider interfaces.UIAutomaitonClient.dll, defines various control schemes, and some are used for supporting The subsidiary conditions searching class of more preferable orient control.UIAutomationCore.dll be then for support UIA provider and Communication between client.UIAutomationClientssideProviders.dll is then primarily used to support traditional The standard control of winform.Its relation refers to figure below:
The Tree Model of UIA, in UIA, each part of program UI is considered as one AutomationElement classes, they are a tree-shaped structures, and Desktop is considered as each windows based app UIA dendrograms root, from the definition of class, we in an AutomationElement class it can also be seen that have one The RootElement attributes of static.In the structure of the tree, one share 3 in View Model, be respectively Raw View, Control View and Content View.The information that Raw View are provided is most, and the basis of other view, is most close to The programming structure of program in itself;Control View are the subsets of Raw View, it is most close to what end user can perceive UI structures, but it does not include some UI that cannot be interacted with user, such as the header of listview, toolbar etc. Deng.And Content View are then a subsets of Control View, it is only comprising energy and user's direct interaction real information Control, for example receive the Textbox of input through keyboard, select the Combobox of different value;And the control such as lable then will not It is included in.Everybody can open UISpy, for some application, look at that 3 view have what difference, so meeting There is one more intuitively to recognize.
The Control Pattern, UIA of UIA probably defines 38 kinds of pattern altogether, represents common control row For they can also provide some specific functional attributes.For UIA Provider, the thing done is exactly to define The relevant behavior of control, finds the behavior corresponding pattern, and realizes the pattern;For client, that is, access relevant Method and attribute, to realize automation.As some control needs ValuePattern, then provider and client are corresponding Be then:
Clients Provider Description
ValuePattern IValuePattern Set or get value
The Properties of UIA, each property are identified by a numeral and name, provider numeral ID To determine attribute request;And client then obtains the content of specific a certain attribute with AutomationProperty classes.
The Events of UIA, UIA are using subscription model, rather than pervious broadcast event model.Define four kinds of events Type:Property change, Element action, Structure change and Global desktop change.
The relation of several crucial classes, if doing automatic test using UIA, several classes with the most use are exactly AutomatonElement, various Pattern and the Condition of several auxiliary search, they all exist Under the name space of the System.Windows.Automation of UIAutomationClent.dll: In AutomationElement classes, define various common control properties, event and we be initially mentioned RootElement;Each attribute is an AutomationProperty type;And each event is AutomationEvent types, they are all inherited from AutomationIdentifier classes.And for each Pattern, Then define common method and the attribute that the Pattern is supported.
2.1 control informations obtain
Various different types of controls are included in graphic user interface, such as menu, text box, dialog box, list box, from group Into for the angle of software function, only menu control and button control is related with software function, therefore, only need to consider how to obtain Take this two classes control and it includes information, wherein menu class control mainly obtains each menu item in window interface, right Words frame class control mainly obtains the button control in window interface.Reach above-mentioned purpose, it is necessary first to analyzed pattern user circle Noodles software interface element organizational form.Found by analysis, under the UIA frames in Windows operating system, in interface Element arranges all in accordance with tree structure, and the startup interface of software is the root node of the tree structure, these elements can be with The form of AutomationElement objects accesses, and is obtained by Automation ID, Name, ControlType etc. Take more attribute of object.Meanwhile object can be traveled through using TreeWalker/FindAll methods and conditioning is looked into Ask, in this way, for some window, the process for obtaining the control that the window is included actually reforms into traversal with the window For the process of the tree structure of root node.As a kind of embodiment, main flow such as Fig. 2 institutes of acquisition window control and its information Show, input window title, and obtain window handle;Window interface element is obtained according to window handle;From window interface element Obtain first child node;Judge whether the node is empty, if otherwise recursive traversal child node and handling sibling, if Terminate.For example, example one described below is to realize to obtain control and its key code of information in window.
As shown in Fig. 2, the core concept of this method is to obtain the window handle of current window, pass through current window handle structure The root node of control tree in window is built, the TreeWalker classes provided using UIA frames, using extreme saturation algorithm recurrence Construction Control tree using current window as root node, so as to obtain all controls and its information in window.Specific implementation process is:Pass through It is the title of current lookup window to call Windows api functions FindWindow (null, title), wherein parameter title Character string, returns to the window handle of the window;Call UIA framework functions AutomationElement.FromHandle (hwnd), current window handle is passed to function, returns to an elements A utomationElement in UI automation catalogues, It is current window interface element herein;Call in TreeWalker classes TreeWalker.ControlViewWalker.GetFirstChild (rootElement) and TreeWalker.ControlViewWalker.GetNextSibling (elementNode) function, recursive traversal obtain currently The control tree of window, finally obtains whole controls and its set membership that tested software current window is included.Menu class and right Words frame class software is adopted obtains interface control and its relation in a like fashion.
2.2 menu hierarchy Relation acquisitions
When designing menu class software, the menu item of software usually is divided according to the function of tonic chord and subfunction of software, therefore, The hierarchical relationship of menu item directly reflects software function and its composition situation;Although dialog class software is large-scale or commercial soft Seldom occur in part, but since its displaying interface is succinct, operation facility, still adopted extensively in the design of Small Scale Software at present With.For this kind of software, the call relation between window directly reflects the function and its composition situation of software.
Below by taking menu class software as an example, the process for obtaining menu hierarchy call relation is elaborated.Pass through 2.1 section intermediaries The method to continue, can obtain all controls and its information of tested software main interface window, the information is with tree structure exhibition first Show, then carried out that the interface element that control type is menu is obtained by filtration according to control type ControlType attributes.Obtaining , it is necessary to submenu under finding main menu on the basis of the main menu item, and establish the hierarchical relationship of menu.By calling invoke Control scheme triggers GUI events, simulates the operation for manually clicking on menu, the Submenu Items of recursive lookup the current set of menu, and preserve The hierarchical relationship of main menu and submenu.Dialog class software is similar with the acquisition process of menu class software, it with ControlType attributes are clicked on each push-botton operation, are called between acquisition window for the interface element of button as starting point, one by one simulation Relation, so as to obtain the function and its composition of software.As a kind of embodiment, menu hierarchy call relation flow chart is obtained as schemed Shown in 3, main window node is passed to, and obtain first child node;Judge whether the node is empty, if the node is non-NULL, Then determine whether the node is menu, if the node is menu, into Invoke control schemes, and recursive traversal is tied Point, if the node is not menu, recursive traversal child node;If the node is not menu, recursive traversal child node;After recurrence, Handle sibling;Terminate if the node is sky.For example, example two described below is the brief of acquisition menu hierarchy relation Algorithm is described.
The incoming parameter rootElement of the algorithmic function is the main window of tested program, that is, the starting point traveled through.During traversal First child node of rootElement is found first, if the node is menu control, needs to travel through the institute of current node There is child node, at this moment, first menu is unfolded, then call the Invoke control schemes of the child node after expansion (equivalent to click Menu item);Other node types do not process herein.The child node control of recursive traversal current node, has handled child node After control, the sibling of current node is handled.
2.3 window call relations obtain
As a kind of embodiment, window call relation flow chart is obtained as shown in figure 4, incoming main window node;Obtain the One child's node;Judge whether the node is empty, if the node is non-NULL, determines whether the node is button, if The node is button, then into Invoke control schemes, and recursive traversal child node, it is followed by subsequent processing sibling;If the node It is not that button then terminates;Terminate if the node is sky.For example, example three described below is to obtain all child nodes of function Main algorithm code.
2.4 software functions and function composition figure generation
By 2.1 and 2.2 method, menu and window and its level call relation are obtained respectively, on this basis, are led to Cross traverse menus level call relation chained list and window and call chained list, and by traversing result be respectively converted into text display manner and Graphic display mode, you can obtain all functions and function composition structure chart of tested software.
Menu hierarchy call relation chained list and window call the functional imperative that software is contained in chained list, from the starting of chained list Node constitutes a function of software to some termination node, and all paths of chained list constitute function possessed by software, Therefore, the acquisition process of software function is just become to the ergodic process of chained list.Generate tested software funcall routing algorithm All child nodes of function are mainly found first, are found by backtracking from the upward funcall relation of the child node.
Software function composition structure chart in order to obtain, mainly Microsoft Microsoft Automatic are used in of the invention Graph Layout drawing frame generation software function composition figure.In menu hierarchy call relation acquisition process, by acquisition Menu hierarchy call relation is stored in the form of chained list, and the set membership structure of menu item is saved in the chained list, therefore, can By searching loop menu hierarchy call relation chained list, to obtain the set membership of menu item, then, call drawing function Graph.AddEdge (pc.parent, pc.child), draws out father node to the connection relation of child node, so as to generate software Function forms structure chart.Example four described below is the definition of menu hierarchy call relation list structure.
Present invention also offers a kind of graphical user interface software function acquisition device, including:Elemental analysis module, is used for The Microsoft user mutual automation MS-UIA frames provided using Windows operating system, to the user interface of tested software into Row analysis, obtains menu class and dialog class control element in main interface;Analytic hierarchy process module, for passing through automatic trigger dish Single and control click event, obtains secondary menu or secondary dialog box window, in this way, recurrence is found out tested software and owned The element included in the menu class or dialog class control of level;Structural generation module, for by analyzing menu hierarchy relation Or dialog box window call relation, show that the function of tested software forms structure.
The advantages and positive effects of the present invention
Software function is the embodiment of software efficiency, can be directly from software using method and device proposed by the invention The function designed by software is extracted in interface, revolutionizes the acquisition modes of software function.On the one hand this method can subtract The workload of few developer, it is real that the time for writing software requirement document can be more used for software function by developer It is existing, improve software development efficiency;On the other hand the uniformity of software requirement and final software can be ensured.Since software requirement comes The implementing result interface of final software is come from, developer no longer needs manual frequent updating software requirement document, fundamentally Solve Software functional requirements and realize inconsistent problem with software.
It in addition, can intuitively, accurately and rapidly grasp tested soft using method proposed by the present invention, tester The function composition of part, understands the functional requirement of tested software, foundation is provided for Test Sample Design;Software project management personnel's energy Enough intuitively, software size is accurately and rapidly grasped, technical support is provided for software project management.
Scene is embodied
Below by taking the menu class software that Fig. 5 is provided as an example, the specific implementation process for realizing the present invention is described in detail.The software It is the typical management class software for including graphic user interface, possesses the typical case such as newly-built, deletion possessed by management software Function.
4.1 controls obtain
Control acquisition algorithm in being saved using this programme 2.1, by analyzing tested software interface, obtains window interface control tree Type structure is as shown in Figure 6.Software interface window includes the control classes such as menu item, form, toolbar, tree view and title bar Type, wherein form, tree view are data exhibiting class control, and toolbar, title bar are auxiliary operation class control, and menu item control is Software function class control.
4.2 menu hierarchies obtain
According to the menu item content got, using the algorithm in 2.2 sections in this programme, menu hierarchy call relation is obtained As shown in Figure 7.
4.3 software functions and function composition figure generation
According to the menu item content and menu hierarchy relation got, the algorithm in being saved using this programme 2.3 carries out software The drafting of function composition figure and the extraction of feature path.The function composition figure of the Students'Management System software is as shown in figure 8, function Path is as shown in figure 9, wherein, a function of software is correspond to per a line content.
One of ordinary skill in the art will appreciate that:Attached drawing is the schematic diagram of one embodiment, module in attached drawing or Flow is not necessarily implemented necessary to the present invention.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can Realized by the mode of software plus required general hardware platform.Based on such understanding, technical scheme essence On the part that contributes in other words to the prior art can be embodied in the form of software product, the computer software product It can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment (can be personal computer, server, either network equipment etc.) performs some of each embodiment of the present invention or embodiment Method described in part.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Especially for device or For system embodiment, since it is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to method The part explanation of embodiment.Apparatus and system embodiment described above is only schematical, wherein the conduct The unit that separating component illustrates may or may not be it is physically separate, can be as the component that unit is shown or Person may not be physical location, you can with positioned at a place, or can also be distributed in multiple network unit.Can root Factually border needs to select some or all of module therein realize the purpose of this embodiment scheme.Ordinary skill Personnel are without creative efforts, you can to understand and implement.
The foregoing is only a preferred embodiment of the present invention, but protection scope of the present invention be not limited thereto, Any one skilled in the art the invention discloses technical scope in, the change or replacement that can readily occur in, It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims Subject to.
Software code example
Example one, be to realize to obtain control and its main algorithm code of information in window below:
Example two, be the main algorithm code for obtaining menu hierarchy relation below:
Example three, be the main algorithm code for obtaining all child nodes of function below:
The main algorithm code of backtracking funcall relation is described as follows upwards:
Example four, be below menu hierarchy call relation list structure definition:
The main code of software for drawing function composition structure chart is described as follows:

Claims (2)

  1. A kind of 1. graphical user interface software function acquisition methods, it is characterised in that including:
    S1, the Microsoft's user mutual automation MS-UIA frames provided using Windows operating system, by tested software main interface Menu class software and dialog class software are divided into, the user interface of tested software is analyzed, is obtained for menu class software Main interface menu item is taken, main interface button control is obtained for dialog class software;
    S2, the click event by automatic trigger menu item and button control, obtain secondary menu or secondary dialog box window, according to This mode, recurrence find out the element that is included in the menu class and dialog class control of all levels of tested software and using recurrence Method obtains menu hierarchy relation and window call relation respectively;
    S3, by analyzing menu hierarchy relation and dialog box window call relation, draw the function composition structure of tested software, and Systematic function composition figure;
    The step S1 further comprises:
    The root node of control tree in window is built by current window handle, the TreeWalker classes provided using UIA frames, are adopted With control tree of the extreme saturation algorithm recurrence Construction using current window as root node, so as to obtain all controls and its letter in window Breath;
    The control tree that extreme saturation algorithm recurrence Construction is used using current window as root node, further comprises:
    Starting point using the main window parameter rootElement of tested program as traversal;
    First child node of rootElement is found during traversal first, if the node is menu control, needs traversal to work as All child nodes of preceding node, at this moment, first menu is unfolded, and then calls the Invoke control schemes of the child node after expansion, Other node types do not process herein;
    The child node control of recursive traversal current node, after having handled child node control, handles the sibling of current node;
    The hierarchical relationship of the menu or dialog box obtains, and further comprises:
    All controls and its information of tested software main interface window are acquired, which is shown with tree structure;
    Be obtained by filtration control type according to control type ControlType attributes as menu or the interface element of dialog box;
    When control type is menu interface element, main menu is obtained, by calling invoke control schemes to trigger GUI events, The operation of menu item, the Submenu Items of recursive lookup the current set of menu are manually clicked in simulation, and preserve the layer of main menu and submenu Level relation;
    When control type is dialog interface element, main window is obtained, by calling invoke control schemes to trigger GUI things The operation of each button is manually clicked in part, simulation, the child window of recursive lookup current window, to obtain the call relation between window, And the call relation between window is saved as to the hierarchical relationship of main window and child window;
    The Submenu Items of described recursive lookup the current set of menu, and the hierarchical relationship of main menu and submenu is preserved, further comprise:
    Incoming main window node, and obtain first child node;Judge whether the node is empty, if the node is non-NULL, Determine whether the node is menu, if the node is menu, into Invoke control schemes, and recursive traversal is tied Point, if the node is not menu, recursive traversal child node;If the node is not menu, recursive traversal child node;After recurrence, Handle sibling;Terminate if the node is sky;
    The child window of the recursive lookup current window, to obtain the call relation between window, and by the call relation between window The hierarchical relationship of main window and child window is saved as, is further comprised:
    Incoming main window node;Obtain first child node;Judge whether the node is empty, if the node is non-NULL, into one Step judges whether the node is button, if the node is button, into Invoke control schemes, and recursive traversal child node, It is followed by subsequent processing sibling;Terminate if the node is not button;Terminate if the node is sky.
  2. 2. according to the method described in claim 1, it is characterized in that, the S3 further comprises:
    Menu hierarchy call relation chained list and window call the functional imperative that software is contained in chained list, from the start node of chained list A function of software is constituted to some termination node, all paths of chained list constitute function possessed by software;
    After menu and window and its level call relation is obtained respectively, all child nodes of function are first found, by returning Trace back and find from the upward funcall relation of the child node, pass through traverse menus level call relation chained list and window call chain Table, and traversing result is respectively converted into text display manner and graphic display mode, to obtain all functions of tested software Structure chart is formed with function.
CN201510104809.3A 2015-03-10 2015-03-10 Graphical user interface software function acquisition methods and device Active CN104679519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510104809.3A CN104679519B (en) 2015-03-10 2015-03-10 Graphical user interface software function acquisition methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510104809.3A CN104679519B (en) 2015-03-10 2015-03-10 Graphical user interface software function acquisition methods and device

Publications (2)

Publication Number Publication Date
CN104679519A CN104679519A (en) 2015-06-03
CN104679519B true CN104679519B (en) 2018-05-15

Family

ID=53314634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510104809.3A Active CN104679519B (en) 2015-03-10 2015-03-10 Graphical user interface software function acquisition methods and device

Country Status (1)

Country Link
CN (1) CN104679519B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227544B (en) * 2016-07-28 2019-06-18 山东浪潮人工智能研究院有限公司 A kind of interface architecture implementation method based on uboot
CN106294167B (en) * 2016-08-16 2018-08-10 济南大学 The automatic traversal method of Android Application Program Interfaces and system
CN107168692A (en) * 2017-04-01 2017-09-15 山东超越数控电子有限公司 A kind of handheld subscriber interface implementing method and system based on ReWorks operating systems
CN107169323B (en) * 2017-05-11 2020-09-15 南京大学 Android application repacking detection method based on layout cluster map
CN108958847A (en) * 2017-05-24 2018-12-07 广东爱瓦力科技股份有限公司 A kind of Android system simulation click automatic execution method
CN109214165B (en) * 2017-07-04 2021-02-05 武汉安天信息技术有限责任公司 Judgment method and judgment system for validity of permission declaration of pre-installed application program
CN109542553A (en) * 2018-10-26 2019-03-29 北京慧流科技有限公司 The information extraction method and device and storage medium of user interface UI element
CN111142983B (en) * 2018-11-06 2024-04-09 上海摩软通讯技术有限公司 Management method and system of operation interface
CN110457122B (en) * 2019-07-31 2022-02-22 中国工商银行股份有限公司 Task processing method, task processing device and computer system
CN111158746B (en) * 2019-12-31 2024-01-23 中国银行股份有限公司 Method and device for acquiring call relationship
CN111459365B (en) * 2020-04-03 2021-06-25 南方电网科学研究院有限责任公司 Method for managing user-defined consultation help application
CN111530083B (en) * 2020-05-26 2023-09-08 网易(杭州)网络有限公司 Interface inspection method and device
CN112199301A (en) * 2020-11-30 2021-01-08 北京七维视觉科技有限公司 User interface automation test method, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7100150B2 (en) * 2002-06-11 2006-08-29 Sun Microsystems, Inc. Method and apparatus for testing embedded examples in GUI documentation
CN101916225A (en) * 2010-09-02 2010-12-15 于秀山 Graphical user interface software function coverage testing method
CN102135936A (en) * 2010-12-31 2011-07-27 华为技术有限公司 Method and system for generating test case
CN102243586A (en) * 2011-07-22 2011-11-16 于秀山 Method for automatically acquiring software function diagram

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7100150B2 (en) * 2002-06-11 2006-08-29 Sun Microsystems, Inc. Method and apparatus for testing embedded examples in GUI documentation
CN101916225A (en) * 2010-09-02 2010-12-15 于秀山 Graphical user interface software function coverage testing method
CN102135936A (en) * 2010-12-31 2011-07-27 华为技术有限公司 Method and system for generating test case
CN102243586A (en) * 2011-07-22 2011-11-16 于秀山 Method for automatically acquiring software function diagram

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《基于UIA技术的软件自动化测试框架实践》;刘伟;《计算机光盘图案件与应用》;20110930;第57-59页 *
《基于UIA的自动化测试框架的设计与实现》;金京;《中国优秀硕士学位论文全文数据库信息科技辑》;20131215;摘要、第13-28页 *

Also Published As

Publication number Publication date
CN104679519A (en) 2015-06-03

Similar Documents

Publication Publication Date Title
CN104679519B (en) Graphical user interface software function acquisition methods and device
US8806429B2 (en) Dynamic generation of formatted user interfaces in software environments
CA2674659C (en) Synchronous to asynchronous web page conversion
US9754230B2 (en) Deployment of a business intelligence (BI) meta model and a BI report specification for use in presenting data mining and predictive insights using BI tools
Rufiange et al. Animatrix: A matrix-based visualization of software evolution
US20070271521A1 (en) Flexible Management User Interface From Management Models
US20030067481A1 (en) System and method for computer-aided graph-based dependency analysis with integrated documentation
US7926024B2 (en) Method and apparatus for managing complex processes
US20080163159A1 (en) System and method for extracting UML models from legacy applications
US8856747B2 (en) Enterprise JavaBeans explorer
US20150347281A1 (en) Automation testing using descriptive maps
WO2015006785A2 (en) Integrated, configurable, sensitivity, analytical, temporal, visual electronic plan system
CN107168705B (en) Graphic interface semantic description system and establishing method and operation path generating method thereof
EP3296866A1 (en) Method implemented by a computer that presents software-type applications based on design specifications
CN112199086A (en) Automatic programming control system, method, device, electronic device and storage medium
US10067859B2 (en) Constructing test-centric model of application
US11714625B2 (en) Generating applications for versatile platform deployment
US20120060141A1 (en) Integrated environment for software design and implementation
Mushtaq et al. Multilingual source code analysis: State of the art and challenges
Sboui et al. A UI-DSPL approach for the development of context-adaptable user interfaces
CN107608890A (en) A kind of method of the event handling function model generation gui software test case based on Weight
CN110162731B (en) Method for displaying IFC model component space information on Web
Danenas et al. Domain driven development and feature driven development for development of decision support systems
Elsaka et al. Using methods & measures from network analysis for gui testing
Chua et al. A visualization framework for Web service discovery and selection based on quality of service

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230327

Address after: No. 66, Zizhuyuan Road, Haidian District, Beijing 100048

Patentee after: China Software Evaluation Center

Address before: 100036 Courtyard 6, Wanshou Road, Haidian District, Beijing

Patentee before: Yu Xiushan