WO2007014522A1 - A program logic structure graphical representation method and a program path statistic method - Google Patents

A program logic structure graphical representation method and a program path statistic method Download PDF

Info

Publication number
WO2007014522A1
WO2007014522A1 PCT/CN2006/001900 CN2006001900W WO2007014522A1 WO 2007014522 A1 WO2007014522 A1 WO 2007014522A1 CN 2006001900 W CN2006001900 W CN 2006001900W WO 2007014522 A1 WO2007014522 A1 WO 2007014522A1
Authority
WO
WIPO (PCT)
Prior art keywords
branch
height
path
tree
sub
Prior art date
Application number
PCT/CN2006/001900
Other languages
French (fr)
Chinese (zh)
Inventor
Tong Wang
Original Assignee
Tong Wang
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 Tong Wang filed Critical Tong Wang
Publication of WO2007014522A1 publication Critical patent/WO2007014522A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Definitions

  • the software development team is involved in the detailed design and re-examination of the field of software development, and more specifically relates to the detailed structure and the logical structure diagram method in the field of testing, and the method of each method in the field of retesting. . Background
  • the commonly used program logic structure diagram method is to draw a program logic structure diagram by using drawing tool software and using the graphic symbols of the logic structure diagram.
  • There are three commonly used logical structure diagrams, » flowcharts, box diagrams (N-S diagrams), PAD diagrams, and their commonly used partial diagrams will be as shown in Figure 2, where Figure 2A is part of the graphical symbol of the f ⁇ flowchart 201 is a selection (branch), 202 is a process, 203 is a start or stop, 204 is a predefined process, 205 is an input and output, 206 is a control flow; FIG. 2B is a partial graphical symbol of the box diagram, and 211 is a sequence.
  • 212 is a condition, 213 is a loop, 214 is a call subroutine A;
  • Fig. 2C is a partial graph 1 symbol of the PAD graph, 221 is a sequence, 222 is a loop (WHILB C DO P), and 223 is a select 3 ⁇ 4 ⁇ . 111 ⁇ ? 1 518 £ 2), 224 is the definition.
  • Figure 3 is a flow chart of the sample code of Figure 1A. »Ber's mapping is a long-standing, arbitrarily described »process tool that has disadvantages that are not conducive to the gradual unfavorable shield structure design, and the structure is not easy to structure.
  • Figure 4 is a box diagram of the sample code of Figure 1A. Box graphs have clear functional domains, can be arbitrarily transferred, easy to determine local and ⁇ [5 Sa's scope, easy to represent nested relationships and levy hierarchy, but when the structure is shorter, the box graph is more difficult.
  • FIG. 5 shows the PAD diagram of the sample code in Figure 1A.
  • PAD is the English abbreviation of the problem analysis diagram. It uses the control structure of the two-dimensional tree structure diagram. It is easier to translate this picture into a code, and the structure is clear, easy to read and understand.
  • - 3 ⁇ 4's logic structure diagram 3 ⁇ 4 ⁇ 3 ⁇ 4 ⁇ 3 ⁇ 4 ⁇ draw the logic ⁇ I diagram, low efficiency, especially when » logic « « money, it takes a long drawing time, modify the logical structure diagram Also annoying than cranes.
  • the obtained logical structure diagram is flawed in the test, it is difficult to describe the » path, «automatically itfM ⁇ path.
  • the control flow graph is generally drawn, which increases the workload.
  • the control flow graph is not enough to describe the path, and it is not convenient to automatically count the path.
  • the white box test is a detailed example of the internal logic design of the code.
  • the side logic M is used to measure the amount of i3 ⁇ 4®, and the logic cover is covered with a statement, a decision cover, a cover, and a decision path.
  • Different logical MMs have different test integrity, and path coverage is the most classic problem in white box testing, with good measurement integrity. Since the » contains a loop structure, a very simple one can generate a large number of paths. The complete path is not practical in the actual test work. Therefore, the actual number of loops is generally not considered when counting the paths. In the case of the shield ring body and the non-figure shield ring body, this simplified path is called the z path ⁇ . Since the complete path is not practical, the path am we mean is a difficult path.
  • Path coverage has a good measurement, but it is rarely in the actual test. The main reason is that the cost of the test is too high. The reason for the high cost of the game is two main points: the lack of automatic statistical path methods and tools; ⁇ The branching river can multiply the number of paths, and the number of paths is huge when the program is redundant.
  • the technical problem to be solved by the present invention is to address the deficiencies of the above-described program logic structure diagram method, and propose a new program logic structure diagram method.
  • Another technical problem to be solved by the present invention is to propose a path automatic statistical method.
  • the program structure diagram method proposed by the invention uses the structure X sample as a drawing unit, and the structure object can be stacked to construct a logical structure diagram, and the size and position of the sadness are automatically calculated, and the logical structure diagram can be quickly designed, and the logical structure diagram is convenient. Modified, and the code can be generated in both directions.
  • the logical structure diagram can visually represent the execution path of the Sff, and the US is used to count the ⁇ path. ⁇ The test does not need to draw another icon, which reduces the workload.
  • the program path statistical method proposed by the invention automatically counts the path of the path, and the path coverage test case can be designed according to the statistical result.
  • FIG. 1 is a schematic diagram of a structure division and a code slice division of an example code and an example code, wherein FIG. 1A is a sample code, FIG. 1B is a schematic diagram of a structure division of the example code, and FIG. 1C is a schematic diagram of a code slice division of the example code.
  • FIG. 2 is a partial apostrophe of a logical structure diagram of the background art.
  • FIG. 2A is a ®f, part of the flowchart of FIG Jian ⁇ : Number
  • FIG. 2B is a partial graphical symbols of FIG cartridge
  • FIG. 2C is a partial graphical symbol PAD of FIG.
  • Figure 3 is the flow chart of the sample code of Figure 1A.
  • Figure 4 3 ⁇ 4 ⁇ 4 is a box diagram of the example code shown in Figure 1A.
  • Figure 5 is a PAD diagram of the example code shown in Figure 1A.
  • Figure 6 is a general diagram of one embodiment of the present invention.
  • Fig. 7 is a schematic view showing the internal structure of the image and the structure image tree in an embodiment of the present invention, wherein Fig. 7A is a schematic diagram of the internal structure of the image: Fig. 7B is a branch tree; »Structural diagram, Fig. 7C is a schematic diagram of the internal «shaping of the hemisphere, and Fig. 7D is a diagram of the structure 3 ⁇ 4] ⁇ 3 ⁇ 4 ⁇ 4.
  • Figure S is a schematic diagram of an illustration of each structure in an embodiment of the present invention, wherein Figure SA is a schematic diagram of a sub-graph, and Figure 8B is a schematic diagram of another diagram, Figure 8C, Figure 8D, FIG. 8E, FIG. 8F, FIG. 8G, and FIG. 8H are diagrams of the branch tree X image.
  • Schematic, diagram SI is a schematic diagram of a diagram of a statement: ⁇ .
  • Figure 9 is a diagram showing the process of drawing a logical structure diagram in the embodiment of the present invention, and Figures 9A to 9D show the steps of drawing a logical structure diagram corresponding to the Figure 1B.
  • Figure 10 is a schematic illustration of the dimensions and basic dimensions of each of the embodiments of the present invention.
  • Figure 11 is a flow chart for calculating the width and height of each of the three images in an example of the present invention, wherein Figure 11A is a schematic diagram for calculating the width and height of the sample, and Figure 11B is for calculating the width and height of the rubber. Flow intent, Figure 11C is a flow diagram for calculating the width and height of a branch tree.
  • Figure 12 is a flow chart for calculating the height of each of the «high branching tree X-like inlet lines in one embodiment of the present invention, wherein Figure 12A is a flow chart for calculating the statement: lfe rubber height, and Figure 12B is a flow chart for calculating the height of the branch. Schematic diagram, Fig. 12C is a flow chart for calculating the height of the branch tree oak, and Fig. 12D is a flow chart for calculating the branch line height of the branch line.
  • Figure 13 is a schematic view showing an X-shaped illustration in an example of the present invention, wherein Figure 13A is a schematic diagram showing a division, and Figure 13B is a schematic diagram showing another sub-illustration. The branch label is added, FIG. 13C is a schematic diagram showing a branch tree X image, and FIG. 13D is a schematic diagram showing an i-sample illustration.
  • Figure 14 is a schematic illustration of a partially illustrated modification of a hidden image in accordance with one embodiment of the present invention.
  • Figure 15 is a schematic illustration of a 3 ⁇ 4f3 ⁇ 4 chip of ⁇ in another embodiment of the present invention.
  • FIG. 16 is a schematic flow chart of a system path in another embodiment of the present invention, wherein FIG. 16A is a schematic flowchart of a statistical path when the rubber is a block, and FIG. 16B is a flow chart of the statistical path when the object is a branch. 16C is a schematic flow chart of the statistical path when the object is a branch tree. .
  • Figure 17 is a schematic diagram showing the iiff path.
  • the bi structure corresponds to a sequence of ⁇ . In this sequence, if the first statement is executed, then if there is no exception and no return is returned in advance, the 4th statement will be executed. All consecutive statements of a condition should be considered to belong to the same sequential structure and cannot be split, that is, one part of + cannot be regarded as belonging to one), and the other part is regarded as belonging to another structure.
  • the structure has an entry point and an exit point, the entry point is the first statement in the structure, and the exit point is the last statement in the structure, but a statement in the structure of the chrysanthemum is a return statement (such as
  • the branch structure corresponds to the sequence of the sentence. In this "i-my sentence sequence, there are functions of judgment and/or hopping. ⁇ , under different conditions, some of them may or may not be executed or repeatedly executed ⁇
  • the most typical branch structure; 3 ⁇ 4 select structure, the loop structure also belongs to the branch structure. Because the branch structure will execute or not execute some statements under different conditions, the branch structure has two possibilities.
  • the execution route, the 3 ⁇ 43 ⁇ 43 ⁇ 4 line is called the 4 branch, that is, a ⁇ 3 ⁇ 4 structure contains at least two branches.
  • the loop structure is considered to have two branches of the loop body and the non-ax loop body, regardless of the loop.
  • the more common selection structures are:
  • SWITCH structure such as C/C++/Java switoh(..., Pascal case...of..., Basic SELECT CASE...
  • this structure can contain multiple CASE branches, which can contain It is also possible to exclude the DEFAULT branch.
  • the more common loop structures are:
  • FOR structure For example, C/C"HVJ ava for(..., Pascal for...do..., Basic ⁇ ) ⁇ .. ⁇ and FOREACH.._ ECT.
  • WHILE structure such as C/C++/Java while(..., Pascal's wMe ⁇ do..., Basic's DO WHILE.. ⁇ OOP, DO UNTtL..LOOP.
  • WHILE structure such as C/C++/Java do-while((7), Basic DO....LOOP WHILE..., DCL.
  • LOOP UNTIL. the structure executes the loop body at least once.
  • branching structures and programming languages are not exhaustive, and any code structure having two or more execution routes is considered a branching structure.
  • the loop structure is considered to have two branches of 3 ⁇ 4 loop body and not loop body, regardless of the loop», and the DO...WHILE loop structure at least one body of the shield ring, therefore, its branch without loop body It is Kodak.
  • the branch structure also has an entry point and an exit point, regardless of its internal execution route, in the absence of an exception, the structure is always ax by the entry point, and the exit point leaves the structure, 3 ⁇ 4a has ⁇ If the structure contains a return statement, the function returns when the statement is executed, and does not branch off from the exit point.
  • the 3 ⁇ 4 ⁇ branch of 3 ⁇ 4 ⁇ is implicit, such as the IF structure. If there is no ELSE branch afterwards, the shell contains an implicit branch, even if it contains an ELSE IF branch.
  • the execution of this implicit branch is The route is: When the IF and all ELSE IF decisions are false, jump directly to the exit point of the structure.
  • the case with implicit branches is also: The loop structure does not enter the loop body branch, the execution conditions and lines of the branch Structure, when there is no DEFAULT branch, 7 also contains an implicit branch.
  • the execution route is: all the cakes of the CASE branch are not satisfied, the CASE branch is not executed, and the exit point of ⁇ I is directly jumped.
  • the branch structure consists of at least two branches. It can be said that the branch structure is composed of branches.
  • the branch contains two aspects: branch decision and branch, the calculation result of branch decision generally has only two values: true and false. When the judgment is true, the branch is executed, otherwise the branch is not executed.
  • the branch decisions and branches of the implicit branch are empty. For a certain point, its branch occasionally has a certain range, called scope, and the specific symbol of i3 ⁇ 4J3 ⁇ 4 defines the beginning and end of the scope, for example: C/C++ with curly braces ( ⁇ )' PASCAL Begin and end specify the start and end of the scope.
  • the branch of a branch can contain one or more 11-order structure, or can contain one or more branch structures, we Called a substructure, the substructure can in turn contain its own substructure.
  • the embodiment divides the logical structure into a branch structure and a sequence structure.
  • the branch structure includes at least two branches. Each branch may further include a structure and/or a branch structure. There are no restrictions on the number of nested levels and numbers.
  • Both the branch structure and the sequence structure have an entry point and an exit point. When the ®m line is to any structure, the structure is always removed from the entry point without leaving an exception, and the structure is removed from the exit point, unless Execute to return and return early.
  • This embodiment uses a structure 3 ⁇ 4 ⁇ 4* (the structure should be described as follows: a branch tree is used to describe the branch structure, and a branch is used to describe a branch in the branch node, using the statement: ⁇ rubber structure.
  • the branch tree (The oak nests at least two points 53 ⁇ 4, the points 3 ⁇ 43 ⁇ 4 ⁇ can be nested in any number of branch trees 2 / or statement: ⁇ rubber, the amount of sugar and the number of sugar is not limited, the statement rubber is not embedded.
  • this embodiment The purpose of the logical structure to be shown is hard to be regarded as a branch, called the top branch, which is described by a top-level rubber.
  • the top layer is 3 ⁇ 4 (the oak is different from the other 3 ⁇ 4 rubbers, 'it is not embedded* ⁇ 3 ⁇ 4.
  • the latter leg "divided oak", including the other levels of the top tiered guard, 3 ⁇ 43 ⁇ 4 ⁇ we put the branch tree) (he, the oak, the statement: 3 ⁇ 43 ⁇ 4tm ⁇ called the structure pulse
  • Mm A nested X Yu B, and our Oak A is called the Eagle B.
  • the X-Blane B is called the earner A.
  • the top layer of the rubber is not like the image.
  • (Acorn A (like) nested) Oak B (Zi is indeed, is to withdraw the Oak A to save the Carving B itself.
  • Fig. 7 is a schematic view showing the internal structure of each structure in the present embodiment, wherein Fig. 7A is a schematic diagram of the internal structure of the statement: Fig. 7B is a schematic diagram of the internal surface of the branch tree, Fig. 7C. It is a schematic diagram of the internal turning of the image.
  • the solid line shows a fixed component, and the dotted line shows an optional and unlimited number of components.
  • FIG. 7D is a diagram. ⁇ " Schematic, corresponding to the » ⁇ code as shown in Figure 1A.
  • Figure 7 ⁇ is a schematic diagram of the internal surface of the statement ⁇ 33 ⁇ 4 image, as shown in Figure 7, the image has a ⁇ code field, which is used to store its corresponding » (weight, and has a name field for identifying different statements) ⁇ fine image, the name can be letters, such as ', V,
  • V. '- Figure 7B is a schematic diagram of the internal structure of the branch tree image.
  • the branch tree is nested with at least two sub-S3 images. Take more points and divide.
  • Each branch of 5 ⁇ 3 ⁇ 4 is actually a component of the partition of the branch structure.
  • the branch is treated separately as a single, just for the convenience of description and realism. At the same time, it is more in line with the idea of orientation.
  • Fig. 7C is a schematic diagram of the internal surface of the image. As shown in Fig. 7C, the sub-word is deleted and the corresponding branch decision is saved. The top branch has no corresponding branch decision, so the field is empty.
  • the scale image can be nested with any number of branch trees Liu / i. If there is no nested branch tree statement: ⁇ like, then the branch is called an empty sample. Like the oak, the branch has a name field. For different branches 3 ⁇ 4m, the names can be represented by letters, such as V, V, V.
  • Figure 7D is a schematic diagram of the structure pair corresponding to the code shown in Figure 1. As shown in Figure 7 ⁇ , all the structures describing the logical structure of a program are turned into a tree, which we call a tree.
  • the posterior cerebral drawing refers to: Calculate from the top layer 3 ⁇ 4 rubber, calculate each rubber for each gland, calculate the sub-carving and calculate The X rubber itself, since the ⁇ image and the space division 3 ⁇ 43 ⁇ 41 ⁇ have no children ⁇ , calculate them directly when calculating themselves, so they are terminated.
  • the first difference is that compared to the post-drawing, the only difference is that for each, the former ⁇ 3 ⁇ 4 describes itself, and then recursively computes the sub-d.
  • the structure Pan has an internal flip and also has a corresponding external display that is displayed on the screen to save his visual media.
  • the combination of the 3 ⁇ 4 ⁇ icons constitutes the logic of »! Figure.
  • Figure 8 is a schematic view of the structure of the present embodiment (the illustration of the rubber. 3 ⁇ 4 ⁇ illustrated i3 ⁇ 4i for the convenience of description and invention, its magic, characters, colors 3 ⁇ 43 ⁇ 4 his components are not 3 ⁇ 4 ⁇ 4 to the present invention rights *3 ⁇ 4 real » "The definition of the formula, the text and color of these illustrations can be modified as needed when implementing the invention.
  • the figure is a schematic diagram of a sub-graph, as shown in FIG. 8A, 811 is an execution route of a branch, and a branch tree or a statement block 3 ⁇ 4# can be added on this line, and the branch point, the entry point S12, and the exit point S13 are executed. Both ends of the route.
  • the entry point of the top branch is the entry point of Wo
  • the exit point of the top branch is the exit point of Wo.
  • - Figure 8B is a schematic diagram of another diagram of the division, and the branch annotation is added on the basis of Figure 8A.
  • 822 is a branch note
  • 823 is a branch mark. Branches are displayed in the branch decision or other explanatory text.
  • the width of the branch label is the same as or slightly shorter than the width of the branch.
  • the branch range can be seen from the branch label, so another function of the branch label;
  • the branch decision is used as the main character of the branch, and the syntax of the language is 3 ⁇ 4 ⁇ 4C or C++, and different programming languages can be finely corresponding to the syntax.
  • the sub-sum is generally not a worm, but is a component of a branch tree ⁇ , as shown in Figure SC.
  • Fig. 8C. is a schematic diagram of a branch tree object, as shown in Fig. 8C, S31 is an entry line, and 832 is an exit line.
  • the branch tree object contains at least two points ( ⁇ , which is part of the branch tree sculpture, and the dotted line box 833 and the dotted line box 834 are the two points of the branch tree image « ⁇ . 53 ⁇ 4.
  • the execution line is: from the entry line 3 ⁇ 4, executing a branch, reaching the exit line and leaving the branch tree object.
  • Figure 8D shows the entry and exit points of the branch tree, the entry point 835 and the exit point 836 are respectively located at the entrance The midpoint of the line and the midpoint of the exit line.
  • Figure 8A, Figure 8F, Figure 8G Figure 8H ⁇ is a schematic diagram of the branch tree. Since there are many branch structures, different types of branch structures have different numbers of branches, and the branch decisions are different. According to the language used by the editor, the branch that is commonly used in each language - a corresponding branch tree X rubber, for example, can be C++: for, while, if, e, if/else if/else
  • the switch ⁇ branch tree ⁇ is called “for branch tree", "while branch tree”, "if branch tree”, “if/else branch tree”, “if/else if/else branch tree”, “switch branch” Tree".
  • the various sub-branched tree oaks differ only in the branch of the component and the branch.
  • the branch tree that should be spoofed in SWITCH has peripheral code.
  • the peripheral code of SWITCH in C++ is switoh((7) ⁇ ... ⁇ .
  • This 3 ⁇ 43 ⁇ 4 example adds a "f stay" to the branch tree corresponding to the SWITCH structure; the field of the code is called the peripheral code field, and the peripheral code of staying » is used for switeh(...);
  • the class and terminator, the branch tree we should be in the SWITCH structure is called the medical branch tree.
  • Figure S is a diagram of the 3 ⁇ 43 ⁇ 4 diagram of Figure ,, as shown in Figure 81, 843 is the range rectangle of the statement ⁇ ⁇ , statement ⁇ (sample entry point 841 and exit point 842 are located on the left 3 ⁇ 4 ⁇ 3 ⁇ 4" direction of the center line and the range rectangle The intersection of the vertical lines at both ends.
  • step A generates a top-level partition, which is the top-level x, and the other steps are directly or indirectly nested in the top-level 3 ⁇ 4m.
  • Figure 6 household; ⁇ , step B at any level of the branch ⁇ (like nesting branch tree or statement first, you can nest branch tree 3 ⁇ 4mn / or statement in the top layer of rubber as needed: ⁇ inch image, by «- The branch tree) image contains at least two partial images, so Generated other levels of points ⁇ ! Oak '3 ⁇ 43 ⁇ 4 rubber can be 3 ⁇ 4 ⁇ frequency set branch tree X Royal / or 3 ⁇ 4 (Oak.
  • the present invention can be used to calculate a logical structure diagram (for example, for detailed design), and can also be used to generate a logic map according to an existing » (for example, for a test phase).
  • This male example is used to set up the logical structure diagram, the difficult branch tree in step 8 (the ⁇ : ⁇ is specified by the user, the branch tree is paired with ⁇ 3 ⁇ 4/ or the statement And nested on the ⁇ ⁇ 3 ⁇ 4 of ⁇ S, you can " ⁇ ⁇ "" to the logical structure diagram, the number of the number and the level of «3 ⁇ 4 is not limited.
  • the following is an example of the process of drawing the »logical structure diagram with m, detailing step B of the cost example:
  • Figure 9 is a schematic diagram of the process of drawing a logical structure diagram
  • Figures 9A to 9D show the steps of drawing a logical structure diagram corresponding to the code shown in Figure 1B, which are composed of two parts: Above is the external 3 ⁇ 43 ⁇ 4 ⁇ of the logic ⁇ diagram, the right side is the phase
  • the embodiment also provides a 3 ⁇ 4*3 ⁇ 4 selection interface, which switches the programming language, and displays an icon corresponding to various branch structures (ie, a refined branch tree object) and corresponding to each language.
  • the icon of the jl sequence structure (that is, the statement block is for the user to select.
  • a certain branch tree such as a while branch tree, an ififelse branch Tree
  • the user selects the icon corresponding to the jl structure we call it the query block, and the 3 ⁇ 4 « is called the selection ⁇ ⁇ carving. '- .
  • FIG. 9A the user selects the while branch tree and clicks on the icon of the top-level branch, which corresponds to the code shown in dashed line 101 in Figure 1B.
  • 901 is a schematic diagram of the inner surface of the top layer X, and in the top of the top, the ⁇ while branch tree image 902 is redrawn, and the logical structure diagram of the left side of Fig. 9B is obtained.
  • the user selects the if/else branch tree and clicks on the first branch of the while branch tree, which corresponds to the code of the dashed box 102 in Figure 1B.
  • step C calculates the size and health of each 5! and draws the icon.
  • the rear M "repainting” or “repainting logic” refers to the heavy surface Co step C includes three aspects. : Calculate the size of each X image, the cost of the shed and the height of the shed (the size of the image, because the calculation of the height of the branch line of the branch tree is more than »), therefore, the height of the ⁇ line is also used as the size of the branch tree sculpt in this embodiment. ; Calculate the position of each object, this 3 ⁇ 4 ⁇ 2 case uses the coordinates of the entry point to 3 ⁇ 4 ⁇ the position of each object; draw a diagram of each object.
  • Fig. 10 is a view showing the size, the health and the basic size of each X image in the present embodiment.
  • the width and height of the eagle are as good as the width and height of the rectangular shape of the rectangle (called the shape of the rectangle).
  • the rectangle 1001 drawn by the dashed line is the range rectangle of the top branch
  • the rectangle 1002 drawn by the dashed line is the range rectangle of the if/else branch tree
  • the rectangle 1003 drawn by the dashed line is the first branch of the while branch tree.
  • the rectangle of the range, the rectangle 1004 drawn by the dashed line is the range rectangle of the first branch of the if/dse branch tree
  • the rectangle 1005 drawn by the solid line is an i query ⁇ 5 (the range rectangle of the oak).
  • E1 is the entry line height of the while branch tree object
  • E2 is the entry line height of the if/else branch tree object.
  • 1011 is the entry point of the top-level rubber
  • 1012 is the branch tree (the entrance point of the oak
  • 1013 is the entry point of the first branch of the while branch tree
  • 1014 is the entry point of the oak
  • the coordinates are the coordinates of the entry point of the phase i3 ⁇ 4 rubber.
  • the beginning of the letter S in Figure 10 is 3 ⁇ 43 ⁇ 43 ⁇ 4 in size, including:
  • the distance between the two 3 ⁇ 4 ⁇ of the left 3 ⁇ 4 ⁇ direction is S6.
  • the size varies regardless of the addition and deletion of the sample, but the size of the ship can be scaled.
  • step C The following is a detailed description of step C.
  • each carving includes: X width and height of each spoon, calculate each) (The steps of width and height of the oak are: starting from the top 3 ⁇ 43 ⁇ 4, for each carving, recursively calculate each child ( ⁇ width) And height, calculate the width and height of the 3 ⁇ 43 ⁇ 4 width and height.
  • Figure 11 is a flow diagram of the width and height of each X image in the present embodiment, wherein Figure 11A is a flow chart for calculating the width of the image: ⁇ (the width and height of the image, and Figure 11B is the width and height of the calculated score! Schematic, FIG. 11C is a schematic diagram of calculating the width and height of the image of the branch tree 3.
  • Width S1 ;
  • Width ⁇ W + (N+1)*S6 (N>0);
  • N is the number of sub-objects of the division 3 ⁇ 4m
  • SI is the width of the statement: ⁇ image
  • S6 is the distance between the two 3 ⁇ 4 ⁇ of the left 3 ⁇ 4 direction
  • ⁇ W is the sum of the widths of all the sub-s
  • S3 is the branch note.
  • the height of S4 is the distance between the branch and the branch
  • Hm is the height of the sub-carving with the highest height.
  • Width Wm
  • Wm is the width of the largest sub-object
  • is the sum of the heights of all sub-objects
  • N is the number of sub-objects
  • S5 is the distance between the two branches.
  • Fig. 110 the scan is X
  • Fig. 11B the calculation shown in Fig. 11B is performed recursively, ⁇ finds the branch with the largest width, and then calculates according to the formula Its own width and height.
  • each carving can also be entered into.
  • the height of the seat is the distance from the mouth of the 3 ⁇ 41 elephant to the bottom edge of the range rectangle, each with its own / height, and the height of ⁇ is also the basis for calculating the coordinates of the entry point.
  • the ff3 ⁇ 4 method is used to calculate the height of each test, starting from the top layer, the height of each sub-sample is recursively calculated for each pulse, and the height of the vine is calculated according to the height of each sub-carving.
  • N is the number of sub-X rubbers, Bm is; ⁇ is the height of the child X image; height.
  • the formula calculates the male height, otherwise the scan, if the child is a statement block, recursively performs the calculation of the graph i2A Bi3 ⁇ 4, otherwise recursively Perform the calculation shown in Figure 12C, After the calculation is completed, the child height is the highest.
  • Hertz height [ ⁇ + ( ⁇ - ⁇ ) + ⁇ ( ⁇ 2.. ⁇ - ⁇ ) + (N-1)*S5] / 2 + Bn;
  • Fig. 12C The specific calculation process is shown in Fig. 12C. Scanning the image, for the ⁇ 3 oak, recursively performs the calculation of Fig. 12B, and all the subsamples are calculated; the shed di formula calculates its own female height.
  • the branch tree ⁇ entry line height is calculated according to the following formula:
  • Entrance line height ⁇ + ( ⁇ - ⁇ ) + ⁇ ( ⁇ 2... ⁇ - ⁇ ) + ( - 1)*S5;
  • Bi is the first oak) 3 ⁇ 43 ⁇ 43 ⁇ 4 degrees
  • is « ⁇ 5!
  • Bn is the height of the scorpion
  • ⁇ (H2..JHn-1) is the sum of the heights of the other 3 ⁇ 4m except for the last and last
  • N is the distance between the two S5.
  • each rubber's Zhao includes: the coordinates of each rubber entry point.
  • the steps for calculating the coordinates of each 3 ⁇ 4# entry point are as follows: Starting from the top level, acupuncture is sculpted, the coordinates of the entry point of M are calculated first, and the coordinates of the entry points of each sub-port are calculated recursively according to the position of the fiber.
  • the present embodiment uses the following coordinate system: «I coordinate is positive to the right, positive is positive to the bottom, and the origin is the top ⁇ branch of the rectangle of the engraving range. ' .
  • Yn Yi; - where ⁇ is the sub-oil « ⁇ number from 1 ,, 3 ⁇ 41 is the horizontal mark of the entry point of the ⁇ ⁇ rubber, positive to the right, ⁇ (Wi...Wn-i) is 3 ⁇ 4 ⁇ ⁇ 3 ⁇ 4 ⁇
  • S6 is the distance between the left X ⁇ 4 ⁇ 3 ⁇ 4 "to the two Xifes, Yn is the 3 ⁇ 4 ⁇ of the entry point of the household 3 ⁇ 4 ⁇ , and the direction is positive, ⁇ is the minute ⁇ ⁇ entry point «mark.
  • N is the child starting from 1)
  • is 3 ⁇ 43 ⁇ 4 N " ⁇ X image of the entry point of the abscissa, right is positive
  • is the branch tree (like the entry point abscissa, ⁇ 3 ⁇ 4 ⁇ ⁇
  • the mark of the entry point of 3 ⁇ 43 ⁇ 4 is positive
  • Yn-i is the front entry point
  • Bn-i is the ⁇ height of the front D rubber
  • is the height of the 3 ⁇ 43 ⁇ 4 ⁇ ⁇ image
  • Bn is the weave N ⁇ Height
  • S5 is the distance between the two.
  • Fig. 13 is a schematic view showing each of the drawings (Fig. 13A is a schematic diagram showing a division, and Fig. 13B is a schematic diagram showing another divisional diagram, adding a branch feft Fig. 13C is a schematic diagram showing a branch tree diagram, and Fig. 13D is a diagram showing a ⁇ 3 ⁇ 41* diagram.
  • Execution line 811 The method of drawing the execution line 811 is to draw a line segment between the entry point 1311 and the exit point 1312.
  • the illustration of another branch image further includes: a branch label 822 and a branch label text 823.
  • Xi is the abscissa of the entry point of the branch
  • S6 is the distance between the two directions of the left direction
  • Yi is the entry point of the branch
  • H is the height of the branch
  • B is the height of the branch
  • S3 is the branch mark Height
  • S4 is the distance between the branch and the branch.
  • the width and height of the fractal are:
  • Width W- S6*2
  • W is the branch width
  • S6 is the left
  • ⁇ ⁇ is the distance between the two 3 ⁇ 4 ⁇ connections
  • S3 is the height of the branch note.
  • the branch label is not drawn with a border, and only a gray background is drawn.
  • the illustration of the branch tree includes: an entry line 831 and an exit line 832, the drawing is:
  • YI ⁇ - ⁇ /2; where 3 ⁇ 4 is the ordinate of the entry point and ⁇ is the height of the entry line;
  • ⁇ 2 YI + ⁇ ;.
  • Y1 is the upper endpoint of the entry line S ⁇
  • is the entry line height.
  • i is the horizontal coordinate of the entry point of the statement block
  • Yi is the ordinate of the entry point of the statement block
  • S2 is the height of the statement block object.
  • the obtained graphics are the logical structure diagrams.
  • the following steps can be added in this embodiment:
  • the step of adding a branch to the branch tree image specifically includes:
  • the hit test is the method of judging whether the user has selected a 3 ⁇ 43 ⁇ 4 ⁇ 4 mouse to stay on a certain location from the position of the mouse or the cursor.
  • the hit test method is used to perform the hit test: starting from the top-level scoring, each sub-recursive test is performed for each recursion, and the column test is performed, and the test is ended when a certain engraving is hit, and the method for judging the hit is: The mouse or cursor position is within the bounding rectangle of the gallbladder and hits, otherwise republic ' ⁇
  • the step of deleting the selected branch in the branch tree specifically includes: 1) ffl
  • the above-mentioned hit test method determines which branch the user has selected 3 ⁇ 43 ⁇ 4 ⁇ ;
  • the step specifically includes:
  • the step of invoking the in-laws as a truncation code specifically includes:
  • FIG. 14 is a diagram showing an illustration of a partially illustrated hidden object, as shown in Figure 14, if the hidden image is a branch tree or a statement block, a small rectangle 1405 (referred to as an alternative rectangle) is drawn. The small rectangle of 3 ⁇ can select the object and resume normal display. If the hidden object is a branch, draw a dotted line 1406.
  • Hidden difficulty a steel -, direct or indirect sub-carving while hiding. This step specifically includes:
  • Each field that adds a record status the field is "normal” and “hidden”, the default value is "normal”; to hide a certain biliary, set its state to "hidden”, and redraw the logic ⁇ I Figure.
  • the branch tree and ⁇ ⁇ [the width and height of the image, check its state, if the state is "hidden”, then its width and height are the width sio and height sii of the giant shape, and the sub is ignored.
  • Calculate the branch - the width and height of the bribe check its state, if the state is "hidden”, ignore the child as the empty rubber to calculate the width and height.
  • drawing an X image If the state is "hidden”, then only one cut giant is drawn, and the subimage is ignored.
  • the branch draws , ignore the child.
  • the step for generating a vine Mm code by a logic ,3 ⁇ 4 ⁇ specifically includes:
  • ⁇ A special branch tree of an embodiment»M such as the sw itch branch tree of C++
  • the peripheral code such as switch(- - -) i starts with " ⁇ ”, scans each sub-part, and finally outputs the function.
  • the end of the field is like " ⁇ "; if there is no branching tree, it will be 3 straight lines 3 ⁇ 43 ⁇ 4 ⁇ 3 ⁇ 4.
  • each steel has a vine level, such as the level of the top layer image is ⁇ , and the top layer is 3 ⁇ 4.
  • the straight level is 1, m, which can be indented according to the « ⁇ under calculation code. And add a space to
  • hemp can be added to the left end of the top layer, and the drunk entry icon 1401 is added, the width and height are S7, and the right end is shown by the outlet icon 1402, which has a diameter of S8.
  • the origin is shifted to the right by S7, leaving the health of the entrance icon.
  • the branch line 3 ⁇ 43 ⁇ 4 rectangle 1403 of the branch tree may also be referred to as an entrance rectangle, and the entrance rectangle is added to make the structure of the logical structure clear.
  • the width of the entrance rectangle on the force port S9 In the calculation of the coordinates of the entry point of the ⁇ branch, the offset of the abscissa of the giant shape i ⁇ is also added.
  • the entry line is drawn as a rectangle.
  • the icon of the block object can be drawn as shown in FIG. 140, that is, a diameter of S10 is added at the right end.
  • the round, 3 ⁇ 43 ⁇ 43 ⁇ 43 ⁇ 4 is also an exit for Faculty
  • the present invention can be used to design a drunk logic map (for example for detailed design), and can also be used to generate a logical structure map (for example for a tender section) from existing flaws.
  • a logic structure is generated according to the existing method, and the step 8 of the ship branch tree or the statement according to the Mm code «.
  • step B specifically includes: a logical structure of the code, the branch structure of the core code generates a corresponding branch tree size, and the i ⁇ block according to the structure of the heir code
  • the branch tree X Weikou leg inquiries: ⁇ Yu embedded «W should be level 3 ⁇ 4X rubber into the" ⁇ is described as follows:
  • the fiber code piece refers to the code unit of the structure, and the code piece categories are: judgment, daring number, ⁇ block, and the number is divided into domain start and domain end.
  • a decision is a piece of code that contains a judgment S3 ⁇ 4S megabyte, which is used to control the execution or non-execution of its query, such as C++ if (...; ), dse 3 ⁇ 4.. ⁇ ), else, while( 7), switoh(%), caseN; Basic IF..., ELSE IF..., ELSE, DOWHILE ⁇ . The decision must be complete.
  • C++'s if((7) is a complete decision, no matter how long it is in the parentheses, it is part of the decision and cannot be split.
  • the domain symbol is the code of the scope of the decision, the domain begins with the decision, the start of the scope of the specified decision, and the end of the domain is used to specify the end of the scope of the decision.
  • the typical domain 3 ⁇ 4n c++ " ⁇ " and “" ⁇ ", “begin” and "end” of PASCAL; Statement: ⁇ refers to the code sequence of jl drunk corresponding to the former user M, which cannot contain the judgment. Comments that are within a code slice can be ignored or used as part of the code slice. Comments outside the code slice can be ignored or attributed to subsequent code slices.
  • 1C is an example of code slice classification, as shown in FIG. 1C, the code slices corresponding to codes 111, 113, and 11 are determined; the code slices corresponding to codes 112 and 117 are 3 ⁇ 4 ⁇ , and the code slice corresponding to code 112 is 3 ⁇ 4.
  • the code slice corresponding to the code 117 is the end of the field; the code piece corresponding to the code 114, 116, and 118 is the statement block. ⁇
  • This male example deletes the code structure, the 'mi additional number U three fields of the face structure to store the code piece, the code piece guarantees such as the linked list
  • the 3 ⁇ 4ff number is omitted as 'M" + "code.
  • the Shan number can be omitted.
  • the scope of the statement after the same line, ⁇ is: I3 start, domain end omitted; IF...THEN...END IF structure, ⁇ and END IF are: start and domain end, and IF ...THEN...ELSE IR..THEN...ELSE...END
  • the end of the field is omitted before ELSEIF, and the end of the field is omitted before ELSE.
  • the code is decomposed, it is guaranteed to have a matching start and end of the field after each decision. If ⁇ is omitted, the corresponding biliary code should be added, and the code is empty.
  • the code also considers the implicit branch.
  • the IF structure lacks the ELSE branch
  • the SWITCH structure lacks the DEFAULT branch
  • the loop structure that is considered to be a winged hook it contains implicit branches.
  • Three pieces of code should be added to the implicit branch: one decision, one field starts, one field ends, and their code is empty.
  • FIG. 15 is a schematic diagram of the flow of the Chengji film as a structure script in the embodiment.
  • 1501 is the input parent object, and the branch tree generated in the flow is # ft ⁇ J: ⁇ 3 ⁇ 43 ⁇ 4ft3 ⁇ 4TO (in the image, The parent X ship can be a branch.
  • 1502 is a code slice queue, the thief chip is intoxicated by the code, and is stored in a first-in-first-out queue, called a code slice queue.
  • the "pop-up code slice” of the latter user refers to The first piece of code is taken from the code slice queue, and the code piece is deleted from the code slice queue; the "code piece” described later, when not limited, is a new piece of code that pops up;
  • the HA temporary queue means that the ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA
  • Step 1503 determines whether the code slice is empty. If it is empty, it ends. Otherwise, step 1504 is executed. Step 1504 pops up the code slice. In step 1505, the number of the code slice is determined. If the number U is a statement block, step 1511 ' If the number lj is a decision, go to step 1521, such as the number (J is the number, because the 3 ⁇ 4 number should not appear at this time), perform step 1590, step 1590 reports! ⁇ Wu and exit.
  • Step 1511 generates a sentence: ⁇ yu' and embedded in the middle, this embodiment is an auto-incrementing character in the oak shed» as the name of each sentence: ⁇ rubber, such as V, V, V.
  • Step 1521 generates a branch tree 3 ⁇ 4tm, and «to, in step 1522, according to the additional category of the code slice, the branch tree is a branch tree, if the branch tree, step 1531, otherwise step 1541.
  • Step 1531 protects the code and copies the code content of the code slice to the peripheral code field of the special branch tree.
  • Step 1532 determines whether the code slice queue is empty.
  • step 1590 If it is empty, then the terminal 1590 reports an error and exits, if no, the tracker ⁇ « 1533 pops up the code slice, and in step 1534, the number of the code slice is 1", if the class J is In the case of Gangtai, return to the operation of step 1532 (the beginning of the code is the beginning of the code, step 1572 ignores the domain of the peripheral code, if the number is deleted, then step 1541, if the category is not the beginning or the judgment, then step 1590 is reported and drop out.
  • Step 1541 generates a split, in the branch tree sculpture generated in step 1521, the instance is in the form of an auto-incrementing word ⁇ as a name of the « ⁇ rubber, such as 'a', V, V.
  • Step 1542 saves the branch decision, and the code content of the weight chip is copied to the branch decision field of the sample.
  • Step 1543 determines whether the code slice is empty. If it is empty, step 1590 is reported and exits. Otherwise, the code piece is popped up in step 1545, and in step 1546, the class of the code slice is determined. If the number ij is i3 ⁇ 4T, the shell 1 "Fix step 1547, otherwise step 1590 is reported and exits.
  • Step 1547 «- is used to determine whether the 3 ⁇ 4 number matches »: ⁇ and the value is assigned to a 3 ⁇ 45T.
  • Step 1551 determines whether the code slice queue is empty. If it is empty, the IJ executes the error 1590 and exits. Otherwise, the execution is terminated.
  • 1552 pops up the code slice, and determines the number ij of the code slice in step 1553. If the number U is: 3 ⁇ 4JF, then N is incremented by 1. If the domain is over, N is decremented by 1, and then it is judged whether the value of N is 0 or not. If it is 0, it indicates that the corresponding domain end has been popped up, domain matching is implemented, and step 1562 is performed.
  • step 1554 the chip is pushed into the temporary queue, and the process returns to step 1551 to process the next code slice.
  • Step 1562 Process the branch code, use the split generated by step 1541' as 5i3 ⁇ 4, use the temporary queue as the code slice queue, enter the «call, and then clear the temporary queue.
  • Step 1563 determines whether the queue is empty. If it is empty, it ends. Otherwise, the code slice is popped up in step 1571, and the number ij of the code slice is judged in step 1572. If the category is the end of the domain, the process returns to step 1571, if the category is determined. Step 1573 executes step 1573, otherwise returns to step 1505 to process the subsequent code slice until the end. Step 1573 determines whether the code slice belongs to a subsequent branch of the previous branch according to the dependency 1" of the code slice, and if so, executes step 1541; otherwise, the current branch tree has been processed, and returns to the processing chip 1505 to process the subsequent code piece until End.
  • step B of Fig. 6 3 ⁇ 4 ⁇ 4 is described in detail above.
  • This example uses the Mlift code to generate a picture, which can be used to synchronize the structure of the bare ship with the code when writing the code. It can also be used to generate the logic structure chart during the test.
  • the embodiment for the statistic » path is described in detail below, and based on the above-mentioned masculine case, includes a step for immersing the path.
  • the logical structure diagram of Hertz may not be drawn, that is, the steps of calculating the size and structure of each structure and drawing the illustration may be omitted.
  • the path is the execution route, and the cost of the boat is the same: ⁇ Combination and domain division are combined, and the elimination is said to use ⁇ combination and/or branch combination to trace the path.
  • the branch combination can be used to count the branches of the path.
  • the statement combination refers to the sequence of the i ⁇ block executed by the path, which consists of the statement block name according to the execution of the path;
  • the branch combination refers to the sequence of the branch experienced by the path, which is composed of the branch name according to the path experience; 3 ⁇ 4 means , the statement group ⁇ own line of the statement, the branch group ⁇ recorded path experienced branch.
  • the path is divided into two categories: normal and return, the number U is the return of a statement block with a return statement, so it ends early; the normal path is terminated at the end of Certified When the path is counted, the default class of the path is normal. When a block has a statement block that returns a statement, the class of the path is set to return, and the path ends.
  • the steps of the path ii ⁇ specifically include: the structure X rubber described later, for each input path set as the initial data, the input path of the path statistics top-level image division *K contains a path; for the statement image, in the input path set The name of the statement block is recorded in each path; for each point, the branch name is recorded in each path of the input path set, the output path of the previous ⁇ @ is used as the output of the next child; for the branch tree The copy of the AS set is used as the set of transmissions for each image.
  • FIG. 16 is a schematic flow chart of the statistical path in the embodiment, wherein FIG. 16A is a flow chart of the statistical path when the sample block is a sample block, and FIG. 16B is a flow chart of the statistical path when the branch is a branch, and FIG. 16C is a flow chart. Schematic diagram of the statistical path of a branch tree.
  • Fig. 16A is a flow chart showing the statistical path when the block is a statement block.
  • step 1603 scans the path set, that is, scans the f-in path set 1601, and each path is determined.
  • step 160 its IJ is judged. If the category is returned, the leg returns to step 1603.
  • Step 1607 otherwise, the straight g3 ⁇ 4 line is step 1607, and the step 1607 is recorded as the name of the block, that is, the block name is added at the end of the combination of the paths.
  • the output path set 1602 is obtained, and the number of paths in the output path is consistent with the input path set D.
  • Fig. 16B is a flow chart of the statistical path when the rubber is a branch.
  • the rubber X rubber is calculated in turn, and the Itr-? ⁇ calculated output path set is taken as the lower
  • the output path of the sub-sum is the output path of the sub-picture.
  • step 1611 records the branch, and the branch of each path of the 3 ⁇ 4SrA path set is added to the branch at the end.
  • Step 1612 If the scan is completed or there is no sub-carving, then step 1613 is performed.
  • Step 1613 is to determine the 3 ⁇ 4 sub-segment (if it is not a statement block, if yes, then step 1614, otherwise step 1615, step 1614 recursively perform Figure 16A
  • Figure 16C is a flow chart showing the statistical path when X is married as a branch tree.
  • the path is deleted: the path IJ of the input path set 1621 is copied to the output path 1622, and deleted from the AS path set 1621.
  • Step 1624 scans the sub-pairs (divided, after a branch is broken, step 1625 takes the input path as a set of input paths for the branch.
  • Step 1626 performs the calculation shown in FIG. 16B for the part, and then returns to the step. After 1624 processing, all branches are calculated.
  • the output path of each branch is totaled in the output path 1622 of the pin branch tree, and the calculation ends.
  • the input path of the layer 3 ⁇ 43 ⁇ 4 ⁇ contains only one empty path, which is the path of the combination of the sentence and the division and the combination of the paths; the top-level output router is the set of paths.
  • Each path in the path set records the statement executed by the path: the sequence of the image and the sequence of the Luna calendar.
  • Figure 17 is a schematic diagram showing the path of the process.
  • the combination of sentences is: ac, bc, c; as shown in the logical structure diagram shown in FIG. 17B, there are six paths, and the combination of sentences is: adc, Bdc, dc, aec, bec, ec ; as shown in the logic diagram of Figure 17C, there are 8 paths whose statement combinations are: adc, bdc, fdc, g dc, aec, bee. fee. gec.
  • the example also includes the steps of drawing a path of the ® ⁇ , drawing an illustration of a path at a time, the steps specifically including:
  • each branch of the needle in this embodiment, the entry point of the sub-rubber, the sub-X rubber, and the exit point are connected by a thick line segment, that is, the entry point of the connection entry point and the first sub-point, ⁇ T Henan exit point - the entry point of the second child object, ..., the exit point of the last child object and the exit point of the branch.
  • FIG. 17A and 17B show the present embodiment in which a path is drawn, Fig. 17A shows the path be, and Fig. 17B shows the path ec.
  • the method of the logical structure diagram proposed by the present invention can be designed in a fast ship, and can be bidirectionally converted between the code and the logical structure diagram, which can be used to count and show the program path.
  • the program path statistical method proposed by the present invention can automatically count the Heheng path and draw a schematic diagram of the path.

Abstract

The program logic structure graphical representation method includes the steps: A. generating a top layer object; B. nesting the branch tree object /statement block object into the branch object of arbitrary layer; C. calculating the size and position of objects in the whole program to draw the graphical representation. The program path statistics method is that the said step C is replaced with program path statistics. The invention may use structural object as plot unit and the size and position of object is automatically calculated, so it is possible to rapidly draw program logic structure graph. The logic structure graph can intuitively represent execution path of program. The program logic structure graphical representation method provided by the invention can automatically perform program path statistics and can design path coverage-based test case according to the statistical result.

Description

»逻¾¾图示方法及辦路纖计旅 领域  »Logo 3⁄43⁄4 Graphic Method and Road Fiber Travel Brigade
本发嚇及软件开发领 具体地说, 涉及软件开发领域的详细设计和翻则试领域, 更具体 涉及 详细设计和»测试领域的 逻辑结构图示方法, 以及翻则试领域的 各機计方法。 背景穌  Specifically, the software development team is involved in the detailed design and re-examination of the field of software development, and more specifically relates to the detailed structure and the logical structure diagram method in the field of testing, and the method of each method in the field of retesting. . Background
详细设计和 软件开 程的两个重要阶段。详细设计针对目标系 «行比 g 细的说明; 程 序测试一般分为黑: 白盒测试, 其中白盒测试 ® ^的内部逻辑结构设计测 i細例进行测试。 虽然 目前很多软件从总体上来说是面向) (樣的, 但其局部代码还是结构化的, 详细设计和白盒测试常常需要画出 局 的逻辑 勾的图示。  Two important stages of detailed design and software development. Detailed design for the target system «line ratio g fine description; program test is generally divided into black: white box test, which white box test ® ^ internal logic structure design test i test. Although a lot of software is currently oriented (like the whole, but its local code is still structured, detailed design and white-box testing often need to draw a graphical representation of the local logic.
目前常用的程序逻辑结构图示方法是利用绘图工具软件, 使用逻辑结构图的图形符号, 画出程序逻辑结 构图。常用的逻辑结构图有三种, »流程图、盒图 (N- S图)、 PAD图,它们常用的部分图將^ "如图 2所示, 其中图 2A是 f ^流程图的部分图形符号, 201为选择 (分支), 202为处理, 203为开始或停止, 204为预先定 义的处理, 205为输入输出, 206为控制流; 图 2B帝是盒图的部分图形符号, 211为顺序, 212为条件, 213为 循环, 214为调用子程序 A; 图 2C是 PAD图的部分图形 1认符号, 221为顺序, 222为循环 (WHILB C DO P), 223 为选¾^。111^?1 518£?2), 224为定义。  At present, the commonly used program logic structure diagram method is to draw a program logic structure diagram by using drawing tool software and using the graphic symbols of the logic structure diagram. There are three commonly used logical structure diagrams, » flowcharts, box diagrams (N-S diagrams), PAD diagrams, and their commonly used partial diagrams will be as shown in Figure 2, where Figure 2A is part of the graphical symbol of the f ^ flowchart 201 is a selection (branch), 202 is a process, 203 is a start or stop, 204 is a predefined process, 205 is an input and output, 206 is a control flow; FIG. 2B is a partial graphical symbol of the box diagram, and 211 is a sequence. 212 is a condition, 213 is a loop, 214 is a call subroutine A; Fig. 2C is a partial graph 1 symbol of the PAD graph, 221 is a sequence, 222 is a loop (WHILB C DO P), and 223 is a select 3⁄4^. 111^? 1 518 £ 2), 224 is the definition.
图 3 寸应于图 1A麻的示例代码的辦流程图。 »本爾呈图是历史通久、删 ar泛的描述 »过 程的工具, 具有不利于逐步 不利 盾结构辦设计的精神、不易転 结构等缺点。  Figure 3 is a flow chart of the sample code of Figure 1A. »Ber's mapping is a long-standing, arbitrarily described »process tool that has disadvantages that are not conducive to the gradual unfavorable shield structure design, and the structure is not easy to structure.
图 4 寸应于图 1 A麻的示例代码的盒图。盒图具有功能域明确、 能任意转移控制、容易确定局部 和^ [5薩的作用域、 容易表现嵌套关系和徵夬的层次绪构 点, 但当 »结构较 时, 盒图的 吡 较困难。  Figure 4 is a box diagram of the sample code of Figure 1A. Box graphs have clear functional domains, can be arbitrarily transferred, easy to determine local and ^ [5 Sa's scope, easy to represent nested relationships and levy hierarchy, but when the structure is shorter, the box graph is more difficult.
图 5 寸应于图 1A麻的示例代码的 PAD图。 PAD是问题分析图 (problem analysis diagram)的英文缩写, 它用二维树形结构的图 的控制结构, 将这种图翻译成禾^弋码比较容易, 并且结构清晰、 易读易 懂易.记, 支持自顶向下、逐步 的设计方法。 - ¾的禾游逻辑结构图示方 ¾{©¾图¾ ^画出辦逻辑^ I图, 效報低, 尤其是»逻««錢时, 需要花费较长的绘图时间, 修改逻辑结构图也比鶴烦。 另一方面, 所获得的逻辑结构图棚于 测试时 有 缺陷, 都难于描述»路径, «于自动统 itfM^路径。 目前的测试工作中, 当要分 路径时, 一般要另外画出控制流图, 增加了工作量。另外, 控制流图在描 路径时也不够麵, 并且不便于自动 统计路径。  Figure 5 shows the PAD diagram of the sample code in Figure 1A. PAD is the English abbreviation of the problem analysis diagram. It uses the control structure of the two-dimensional tree structure diagram. It is easier to translate this picture into a code, and the structure is clear, easy to read and understand. Remember, support top-down, step-by-step design approach. - 3⁄4's logic structure diagram 3⁄4{©3⁄4图3⁄4 ^ draw the logic ^ I diagram, low efficiency, especially when » logic «« money, it takes a long drawing time, modify the logical structure diagram Also annoying than cranes. On the other hand, the obtained logical structure diagram is flawed in the test, it is difficult to describe the » path, «automatically itfM^ path. In the current test work, when the path is to be divided, the control flow graph is generally drawn, which increases the workload. In addition, the control flow graph is not enough to describe the path, and it is not convenient to automatically count the path.
. 白盒测 游卜对代码的内部逻辑 设计测 i細例, 侧逻 M 作为测 i¾®量, 逻優盖有语句覆 盖、判定覆盖、 条 盖、 判定条 路径覆盖等。不同的逻 MM具有不同的测试完整性, 其中路径 覆盖是白盒测试最为经典的问题, 具有很好的测 i貌整性。 由于 »中含有循环结构时, 一个很简单的禾!^ 者阿能产生大量的路径, 完全的路径 在实际的测试工作中不具实用性, 因此, 统计路径时一般不考虑循 环的实际次数, 只考 盾环体和不执 fi!盾环体两种情况, 这种简化的路径 叫 z路径 β, 由于完 全的路径 不具实用性, 我们所说的路径 am是指 ζ路径難。  The white box test is a detailed example of the internal logic design of the code. The side logic M is used to measure the amount of i3⁄4®, and the logic cover is covered with a statement, a decision cover, a cover, and a decision path. Different logical MMs have different test integrity, and path coverage is the most classic problem in white box testing, with good measurement integrity. Since the » contains a loop structure, a very simple one can generate a large number of paths. The complete path is not practical in the actual test work. Therefore, the actual number of loops is generally not considered when counting the paths. In the case of the shield ring body and the non-figure shield ring body, this simplified path is called the z path β. Since the complete path is not practical, the path am we mean is a difficult path.
路径覆盖具有很好的测¾¾性, 但在实际测试中却很少侧, 主要原因是测试成本太高, 造戯式成 本高的原因主 两点: 缺少自动统计路径的方法和工具; 由于^ {可分支 河能使路径数量倍增, 当程序较 餘时路径的数量巨大。  Path coverage has a good measurement, but it is rarely in the actual test. The main reason is that the cost of the test is too high. The reason for the high cost of the game is two main points: the lack of automatic statistical path methods and tools; {The branching river can multiply the number of paths, and the number of paths is huge when the program is redundant.
关于路 充计, 《软件测 仑》(39-40页,上海艾微软 有限公司主编,清华大学出版社出版, 2004年 4月第一版)一书中 种统计方法: 用路径树 ¾¾¾ ^的所有路径, 然后从根结点幵始,一 历, 再回到根结点后, 经历的叶结点名排列絲, 衡尋到一个路径, 如果设法遍历了所有的叶结点, 就 得到了所有的路径。该书未详细说明具体的实施步骤。 路径树常用于在网络技术中计算路由, 例如描述!^ 包在网络中的树形转发路径。 依据该书戶; ¾的方法, Λ 画出路径树, 并设法用 A 计算路径, 可能是可行 的, 但工作量较大。我们未检索到依据禾 弋码自动生成路径树的方法, 目 «件市场上«发现依据游 代码自动生成路径树的工具, 也没有检索到进一步自动统计辦路径的方法, 也未在软件市场上发现自动统 计禾薪路径的工具。 On the road filling, "Software Measurement" (39-40 pages, edited by Shanghai Ai Microsoft Co., Ltd., published by Tsinghua University Press, first edition in April 2004), a statistical method: using the path tree 3⁄43⁄43⁄4 ^ All paths, then start from the root node, one calendar, then back to the root node, the leaf node names that are experienced are arranged in a line, and the path is found. If you try to traverse all the leaf nodes, you get all path of. The book does not detail the specific implementation steps. The path tree is often used to calculate routes in network technology, such as the description!^ The tree-shaped forwarding path of the packet in the network. According to the book; 3⁄4 method, 画 draw the path tree, and try to calculate the path with A, it may be feasible, but the workload is large. We have not retrieved the method of automatically generating the path tree based on the code, and found the tool to automatically generate the path tree based on the game code, and did not retrieve the method of further automatic statistics, nor in the software market. Automatic system A tool for calculating the pay path.
关于辦 ¾g¾时路径難巨大, 导¾£各径驗隹于实施的问题, 现有技术中没有嶽子的解决滅。 如上所述, 目前的 逻辑结构图示方法效 低, 所得到的逻辑^ 1图在用于»测试时具有 ¾^缺 陷。 目前路径 测试缺少自动统计路径的方法, 也 ¾当^较 «¾时路径数 «1大的问题。 发明内容  Regarding the operation of the 3⁄4g3⁄4, the path is very difficult, and the guides are inspected for implementation problems. In the prior art, there is no solution for Yuezi. As mentioned above, the current logic structure diagram method is inefficient, and the resulting logic map has a 3⁄4^ defect when used for »testing. At present, the path test lacks the method of automatic statistical path, and it is also a problem when the number of paths is «1. Summary of the invention
本发明要解决的技术问题是针对上述的程序逻辑结构图示方法的不足之处, 提出一种新的程序逻辑结构 图示方法。  The technical problem to be solved by the present invention is to address the deficiencies of the above-described program logic structure diagram method, and propose a new program logic structure diagram method.
本发明要解决的另一个技术问题是提出一 路径自动统计方法。  Another technical problem to be solved by the present invention is to propose a path automatic statistical method.
为了解« ^—个技术问题, 本发明提出了如下技术方案:  In order to understand the technical problems of the following, the present invention proposes the following technical solutions:
一种 »逻辑结构图示方法, 難正在于' 包 骤:  A » logical structure diagram method, difficult to be in the 'package:
A. «—个顶层分 橡;  A. «—a top layer of rubber;
B.在任意层次的分 ¾x嫁中嵌套分支树衞口 /或语句: t i ; B. nesting branch tree suffixes or statements in any level of 3⁄4x marry: ti ;
c.计算 ±¾各 的尺寸及 ί¾ϊ并画出其图示。  c. Calculate the size of each of ±3⁄4 and ί3⁄4ϊ and draw the illustration.
还可以进一步包括:  It can further include:
用于在分支树 中添加分支的步骤;  a step for adding a branch to a branch tree;
用于在分支树雕中删難定分支的步骤;  a step for deleting a difficult branch in a branch tree sculpture;
用于修改分支判定的步骤;  a step for modifying a branch decision;
用于编 $t吾句 橡的代码的步骤;  The steps for compiling the code of the $t.
用于隐藏 5?攝口 示 X橡的步骤; . .  Used to hide the 5? camera port to show the X rubber step; .
用于由逻辑^图生 码的步骤。  The step used to generate a code from a logic map.
为了解 另一个技术问题, 本发明提出了如下技术方案:  In order to understand another technical problem, the present invention proposes the following technical solutions:
一种统 ii»路径的方法, 其 ί)#ΪΕ在于, 用统 i十 路径的歩骤代替 术方案中的步骤  A method of unifying the path of ii», ί) ΪΕ , , , 用 代替 代替 代替 代替 代替 代替 代替 代替 代替 代替 代替 代替 代替
本发明提出的程序结构图示方法, 使用结构 X樣作为绘图单位, 添加结构对象即可以堆砌出逻辑结 构图, 悲的尺寸和位置自动计算, 可以快速设计出 »逻辑结构图, 逻辑结构图便于修改, 并与代码可以 双向生成。该逻辑结构图可以直观表现 Sff的执行路径, 还 US接用于统计^路径, »测试时无须另画 其他图示, 减少了工作量。  The program structure diagram method proposed by the invention uses the structure X sample as a drawing unit, and the structure object can be stacked to construct a logical structure diagram, and the size and position of the sadness are automatically calculated, and the logical structure diagram can be quickly designed, and the logical structure diagram is convenient. Modified, and the code can be generated in both directions. The logical structure diagram can visually represent the execution path of the Sff, and the US is used to count the ^ path. ● The test does not need to draw another icon, which reduces the workload.
本发明提出的程序路径统计方法, 自动统计禾 Μ)Ϋ路径, 依据统计结果即可设计路径覆盖测试用例。 当程 序较錢时, 可以隐藏部分 (豫, 统计路径时忽略已隐藏的像, 以压缩路径 §*, 提高路径 S 测试的实 用性。 . ' 附图说明  The program path statistical method proposed by the invention automatically counts the path of the path, and the path coverage test case can be designed according to the statistical result. When the program is more expensive, you can hide the part (hes, ignore the hidden image when counting the path, to compress the path §*, improve the usability of the path S test. .
下面结合附图对本发明的具体^ 式作进 ~·έ^ 细的说明:  The following is a detailed description of the specific method of the present invention with reference to the accompanying drawings:
图 1是示例代码及示例代码的结构划分示意图和代码片划分示意图, 其中图 1A是示例代码, 图 1B是示 例代码的结构划分示意图, 图 1C是示例代码的代码片划分示意图。  1 is a schematic diagram of a structure division and a code slice division of an example code and an example code, wherein FIG. 1A is a sample code, FIG. 1B is a schematic diagram of a structure division of the example code, and FIG. 1C is a schematic diagram of a code slice division of the example code.
图 2是背景技术中 ¾H种逻辑结构图的部分图幵 号。其中图 2A是 ®f,流程图的部分图幵^ :号; 图 2B是盒图的部分图形符号; 图 2C是 PAD图的部分图形符号。 2 is a partial apostrophe of a logical structure diagram of the background art. Wherein FIG. 2A is a ®f, part of the flowchart of FIG Jian ^: Number; FIG. 2B is a partial graphical symbols of FIG cartridge; FIG. 2C is a partial graphical symbol PAD of FIG.
图 3 寸应于图 1A麻的示例代码的»流程图。  Figure 3 is the flow chart of the sample code of Figure 1A.
图 4 ¾¾应于图 1A所示的示例代码的盒图。  Figure 4 3⁄4⁄4 is a box diagram of the example code shown in Figure 1A.
图 5 应于图 1A所示的示例代码的 PAD图。  Figure 5 is a PAD diagram of the example code shown in Figure 1A.
图 6是本发明的一个实施例的总#¾程图。  Figure 6 is a general diagram of one embodiment of the present invention.
图 7是在本发明的一个实施例,各结构 (像的内部画构成示意图及结构像树示意图,其中图 7A是语 句:^像的内部観构成示意图' 图 7B是分支树)!樣的内部»构成示意图, 图 7C是分 豫的内部« 构成示意图, 图 7D是结构 ¾]^树¾¾图。  Fig. 7 is a schematic view showing the internal structure of the image and the structure image tree in an embodiment of the present invention, wherein Fig. 7A is a schematic diagram of the internal structure of the image: Fig. 7B is a branch tree; »Structural diagram, Fig. 7C is a schematic diagram of the internal «shaping of the hemisphere, and Fig. 7D is a diagram of the structure 3⁄4]^3⁄4⁄4.
图 S是在本发明的一个实施例,各结构樣的图示的示意图,其中图 SA是分 的图示的示意图, 图 8B是另一种分 ¾豫的图示的示意图, 图 8C、 图 8D、 图 8E、 图 8F、 图 8G、 图 8H是分支树 X像的图示的 示意图, 图 SI是语句:^樣的图示的示意图。 Figure S is a schematic diagram of an illustration of each structure in an embodiment of the present invention, wherein Figure SA is a schematic diagram of a sub-graph, and Figure 8B is a schematic diagram of another diagram, Figure 8C, Figure 8D, FIG. 8E, FIG. 8F, FIG. 8G, and FIG. 8H are diagrams of the branch tree X image. Schematic, diagram SI is a schematic diagram of a diagram of a statement: ^.
图 9是在本发明的 ~ ^实施例, 画出 »逻辑结构图的过程的示意图, 图 9A至图 9D示出了画出对应于 图 1B戶 ¾ ^弋码的逻辑结构图的各步骤。  Figure 9 is a diagram showing the process of drawing a logical structure diagram in the embodiment of the present invention, and Figures 9A to 9D show the steps of drawing a logical structure diagram corresponding to the Figure 1B.
图 10是在本发明的一个实施例, 各 ¾^的尺寸、 和基本尺寸的示意图。  Figure 10 is a schematic illustration of the dimensions and basic dimensions of each of the embodiments of the present invention.
图 11是在本发明的一个 例,计算各 3像的宽度和高度的流程示意图,其中图 11A是计算 i詢:^樣 的宽度和高度的 呈示意图, 图 11B是计算分 橡的宽度和高度的流 意图, 图 11C是计算分支树 的宽度和高度的流程示意图。  Figure 11 is a flow chart for calculating the width and height of each of the three images in an example of the present invention, wherein Figure 11A is a schematic diagram for calculating the width and height of the sample, and Figure 11B is for calculating the width and height of the rubber. Flow intent, Figure 11C is a flow diagram for calculating the width and height of a branch tree.
图 12是在本发明的一个实施例,计算各 «高 分支树 X樣入口线高度的流程 图,其中图 12A 是计算语句: lfe橡 高度的流程示意图, 图 12B是计算分5¾ 藤高度的流程示意图, 图 12C是计算分 支树橡赫高度的流程示意图, 图 12D是计算分支树 (橡的入口线高度的流程^ ¾图。  Figure 12 is a flow chart for calculating the height of each of the «high branching tree X-like inlet lines in one embodiment of the present invention, wherein Figure 12A is a flow chart for calculating the statement: lfe rubber height, and Figure 12B is a flow chart for calculating the height of the branch. Schematic diagram, Fig. 12C is a flow chart for calculating the height of the branch tree oak, and Fig. 12D is a flow chart for calculating the branch line height of the branch line.
图 13是在本发明的一个«例, 画出各 X樣图示的示意图, 其中图 13A是画出分¾ (豫图示的示意图, 图 13B是画出另一种分 图示的示意图, 增加了分支标注, 图 13C是画出分支树 X像图示的示意图, 图 13D是画出 i詢 樣图示的示意图。  Figure 13 is a schematic view showing an X-shaped illustration in an example of the present invention, wherein Figure 13A is a schematic diagram showing a division, and Figure 13B is a schematic diagram showing another sub-illustration. The branch label is added, FIG. 13C is a schematic diagram showing a branch tree X image, and FIG. 13D is a schematic diagram showing an i-sample illustration.
图 14是在本发明的一个实施例, 对部分图示的改 ¾¾画出隐藏像的图示的示意图。  Figure 14 is a schematic illustration of a partially illustrated modification of a hidden image in accordance with one embodiment of the present invention.
图 15是在本发明的另 实施例, ¾f¾码片 为^ 的 ¾¾示意图。  Figure 15 is a schematic illustration of a 3⁄4f3⁄4 chip of ^ in another embodiment of the present invention.
图 16是在本发明的再一个实施例, 统 路径的流程示意图,其中, 图 16A是当橡为駒块时统计 路径的流程示意图, 图 16B是当对象为分支时统计路径的流程示意图, 图 16C是当对象为分支树时统计路径 的流程示意图。 .  16 is a schematic flow chart of a system path in another embodiment of the present invention, wherein FIG. 16A is a schematic flowchart of a statistical path when the rubber is a block, and FIG. 16B is a flow chart of the statistical path when the object is a branch. 16C is a schematic flow chart of the statistical path when the object is a branch tree. .
图 17 ^辑结构图示出 iiff路径的示意图。  Figure 17 is a schematic diagram showing the iiff path.
Figure imgf000005_0001
Figure imgf000005_0001
细描述。 Detailed description.
本雄例把禾醉逻辑结构分为两种: 顺序结构和分 构。 碧结构对应于一个駒序列, 在这 句 序列中, 如果第一条语句执行了, 那么在没有发生异常, 也未因返回 ί詢提前返回的情况下, 其 4術有语句 也会执行, 符^ ¾一条件的所有连续的语句应视为属于同一个顺序结构而不能分拆, 即不能把其中的一部分 +视为属于一个 )1赃结构, 把另一部分视为属于另一„结构。 绪构具有一个入口点和一个出口点, 其 入口点为结构中的第一条语句,出口点为结构中的最后一条语句,但如菊 1»结构中的某条语句是返回语句 (如 This male case divides the logic structure of the drunk into two types: sequential structure and structure. The bi structure corresponds to a sequence of 驹. In this sequence, if the first statement is executed, then if there is no exception and no return is returned in advance, the 4th statement will be executed. All consecutive statements of a condition should be considered to belong to the same sequential structure and cannot be split, that is, one part of + cannot be regarded as belonging to one), and the other part is regarded as belonging to another structure. The structure has an entry point and an exit point, the entry point is the first statement in the structure, and the exit point is the last statement in the structure, but a statement in the structure of the chrysanthemum is a return statement (such as
C++的 return语 , 执行到该语句时函数即返回, 后面的语句不会执行, 实际上, 后面的駒是无效的, 因 此, 该语句是¾«*结构的实际出口点。 由于 GOTO语句 (如 C++的 goto 破坏了结构化设计并且在当今 的开发中棚 少, 因此, 本 例不考虑 GOTO语句。 The return language of C++, the function returns when the statement is executed, and the following statement will not be executed. In fact, the following 驹 is invalid, so the statement is the actual exit point of the 3⁄4«* structure. Because GOTO statements (such as C++'s goto breaks down the structural design and are less common in today's development, this example does not consider GOTO statements.
分支结构对应 吾句序列, 在这 " i吾句序列中, 含有判断和 /或跳 吾句^ ^似功能的 , 在不同 的^ 下, 可能会执行或不执行或重复执行其中的某些^。 最典型的分支绪构; ¾择结构, 循环结构也属 于分支结构。 由于分支结构在不同的^ ί牛下会执行或不执行 ¾复执行某些语句, 所以, 分支结构至 含 两种可能的执行路线, ¾¾¾行路线叫 4故分支, 也就是说, 一个^ ¾构至少包含两个分支。为了简化问题, 循环结构视为具有 循环体和不 ax循环体两个分支, 不考虑循环的  The branch structure corresponds to the sequence of the sentence. In this "i-my sentence sequence, there are functions of judgment and/or hopping. ^^, under different conditions, some of them may or may not be executed or repeatedly executed ^ The most typical branch structure; 3⁄4 select structure, the loop structure also belongs to the branch structure. Because the branch structure will execute or not execute some statements under different conditions, the branch structure has two possibilities. The execution route, the 3⁄43⁄43⁄4 line is called the 4 branch, that is, a ^3⁄4 structure contains at least two branches. To simplify the problem, the loop structure is considered to have two branches of the loop body and the non-ax loop body, regardless of the loop.
比较常用的选择结构有:  The more common selection structures are:
正结构,如 C/C"HVJava的 if(...).Jelse...; Pascal的 if... then—else...; Basic的 IF...THE ...END IF; 该结构可 含或不含 ELSE分支, ELSE分¾1前可增加不限数量的 ELSE IF分支。  Positive structure, such as C/C "HVJava if(...).Jelse...; Pascal's if... then-else...; Basic IF...THE ...END IF; This structure ELSE branches can be included or not, and an unlimited number of ELSE IF branches can be added before the ELSE is divided into 3⁄41.
SWITCH结构, 如 C/C++/Java的 switoh(...)..., Pascal的 case...of..., Basic的 SELECT CASE..., 该结构可 含多个 CASE分支, 可含也可不含 DEFAULT分支。  SWITCH structure, such as C/C++/Java switoh(...)..., Pascal case...of..., Basic SELECT CASE..., this structure can contain multiple CASE branches, which can contain It is also possible to exclude the DEFAULT branch.
比较常用的循环结构有:  The more common loop structures are:
FOR结构: 如 C/C"HVJava的 for(...)..., Pascal的 for...do..., Basic的 Κ)Ι ..·ΜΒΧΤ和 FOREACH.._ ECT。 WHILE结构: 如 C/C++/Java的 while(...)..., Pascal的 wMe〜do..., Basic的 DO WHILE..丄 OOP, DO UNTtL..LOOP。 FOR structure: For example, C/C"HVJ ava for(...)..., Pascal for...do..., Basic Κ)Ι..·ΜΒΧΤ and FOREACH.._ ECT. WHILE structure : such as C/C++/Java while(...)..., Pascal's wMe~do..., Basic's DO WHILE..丄OOP, DO UNTtL..LOOP.
Do.—WHILE结构: 如 C/C++/Java的 do—while(...), Basic的 DO....LOOP WHILE..., DCL. LOOP UNTIL.., 该结构至少执循环体一次。  Do.—WHILE structure: such as C/C++/Java do-while(...), Basic DO....LOOP WHILE..., DCL. LOOP UNTIL.., the structure executes the loop body at least once.
上述分支结构和编程语言的示例并非穷举, 凡具有两个或两个以上执行路线的代码结构, 都视为分支结 构。 The above examples of branching structures and programming languages are not exhaustive, and any code structure having two or more execution routes is considered a branching structure.
±j , 循环结构视为具有 ¾ 循环体和不 ¾Λ循环体两个分支, 不考虑循环的», 而 DO...WHILE 循环结构至少执 盾环体一次, 因此, 它的不 循环体的分支是柯达的。  ±j , the loop structure is considered to have two branches of 3⁄4 loop body and not loop body, regardless of the loop», and the DO...WHILE loop structure at least one body of the shield ring, therefore, its branch without loop body It is Kodak.
分支结构也具有一个入口点和一个出口点, 不论其内部的执行路线如何, 在不发生异常的¾下, 总是 由入口点 ax该结构, 并由出口点离开该结构, ¾a有^ 例, 如果结构内含有返回语句, 执行到该语句 时函数即返回, 而不会从出口点离 分支 。  The branch structure also has an entry point and an exit point, regardless of its internal execution route, in the absence of an exception, the structure is always ax by the entry point, and the exit point leaves the structure, 3⁄4a has ^ If the structure contains a return statement, the function returns when the statement is executed, and does not branch off from the exit point.
有¾ ^支^的¾ ^支是隐含的, 如 IF结构, 如 后没有 ELSE分支, 贝抱含一个隐含的分支, 即 使含有 ELSE IF分支也是如此, 此隐含的分支的执行 牛和路线是: 当 IF和所有 ELSE IF判定均为假时, 直 接跳转到结构的出口点。含有隐含分支的情况还有: 循环结构的不进入循环体分支, 该分支的执行条件和线
Figure imgf000006_0001
结构,当不含 DEFAULT 分支时 7也含有—个隐含的分 其执行編口路线是:所有 CASE分支的餅均不满足,不执行 CASE 分支, 直接跳转到^ I的出口点。
The 3⁄4^ branch of 3⁄4^^ is implicit, such as the IF structure. If there is no ELSE branch afterwards, the shell contains an implicit branch, even if it contains an ELSE IF branch. The execution of this implicit branch is The route is: When the IF and all ELSE IF decisions are false, jump directly to the exit point of the structure. The case with implicit branches is also: The loop structure does not enter the loop body branch, the execution conditions and lines of the branch
Figure imgf000006_0001
Structure, when there is no DEFAULT branch, 7 also contains an implicit branch. The execution route is: all the cakes of the CASE branch are not satisfied, the CASE branch is not executed, and the exit point of ^ I is directly jumped.
由 一分支结构至少包含两 支, 可以说, 分支结构是由分支构成的。 分支包含两方面内容: 分支 判定和分支体, 分支判定的计算结果一般只有真和假两个值。判定为真时, 执行分支体, 否则不执行分支体。 隐含分支的分支判定和分支体都是空的。.对于某一分 说, 其分支偶有一定的范围, 称为作用域, —般 i¾J¾特定的符号来定义作用域的开始和结束, 例如: C/C++用花括号 ({})' PASCAL用 begin和 end来指定作 用域的开始和结束。 作用域内的所有语句, 不论其结构如何, 数量多少, ±勾属于该分支体, 因此, 一个分支 的分支体可以包含一个或多个 11顷序结构, 也可以包含一个或多个分支结构, 我们称为子结构, 子结构又可以 包含自己的子结构。  The branch structure consists of at least two branches. It can be said that the branch structure is composed of branches. The branch contains two aspects: branch decision and branch, the calculation result of branch decision generally has only two values: true and false. When the judgment is true, the branch is executed, otherwise the branch is not executed. The branch decisions and branches of the implicit branch are empty. For a certain point, its branch occasionally has a certain range, called scope, and the specific symbol of i3⁄4J3⁄4 defines the beginning and end of the scope, for example: C/C++ with curly braces ({})' PASCAL Begin and end specify the start and end of the scope. All statements in the scope, regardless of their structure, the number, ± hook belongs to the branch, therefore, the branch of a branch can contain one or more 11-order structure, or can contain one or more branch structures, we Called a substructure, the substructure can in turn contain its own substructure.
综上所述; 本实施例把 逻辑结构分为分支结构和顺序结构 —个分支结构至少包含两个分支 每一 分支又可以进一步包含辦结构和 /或分支结构, 我们把这种包含称为嵌套, 嵌套的层次和数量没有限制。分 支结构和顺序结构均有一个入口点和一个出口点, ®m行到任一结构时, 在未发生异常的情况下, 总是从 入口点 ¾Λ该结构, 从出口点离开该结构, 除非因执行到返回駒而提前返回。  In summary, the embodiment divides the logical structure into a branch structure and a sequence structure. The branch structure includes at least two branches. Each branch may further include a structure and/or a branch structure. There are no restrictions on the number of nested levels and numbers. Both the branch structure and the sequence structure have an entry point and an exit point. When the ®m line is to any structure, the structure is always removed from the entry point without leaving an exception, and the structure is removed from the exit point, unless Execute to return and return early.
本实施例用结构¾1¾*(寸应描 ¾±述¾^逻辑结构: 用分支树 描述分支 构, 用分^ 描述分支 结 中的一个分支, 用语句:^橡描 酵结构。 其中, 分支树 (橡嵌套至少两个分5¾ , 分¾¾^可以 嵌套任意数量的分支树 2御 /或语句:^橡, 糖的 欠和数量没有限制, 语句 橡不嵌観 豫。 另外, 本实施例把待示出逻辑结构的目 的難视为一个分支, 称为顶层分支, 用一个顶层分 橡来 描述, 该顶层分¾ (橡与其他分 ¾橡不同的是,'它不嵌 *ΐ其^ ¾ 。 后文腿 "分 橡", 包括顶层分 衛口其他层次的分¾¾^我们把分支树) (豫、 分 橡、 语句: ¾¾tm ^称为结构脉  This embodiment uses a structure 3⁄4⁄4* (the structure should be described as follows: a branch tree is used to describe the branch structure, and a branch is used to describe a branch in the branch node, using the statement: ^ rubber structure. Among them, the branch tree (The oak nests at least two points 53⁄4, the points 3⁄43⁄4^ can be nested in any number of branch trees 2 / or statement: ^ rubber, the amount of sugar and the number of sugar is not limited, the statement rubber is not embedded. In addition, this embodiment The purpose of the logical structure to be shown is hard to be regarded as a branch, called the top branch, which is described by a top-level rubber. The top layer is 3⁄4 (the oak is different from the other 3⁄4 rubbers, 'it is not embedded*ΐ^ 3⁄4. The latter leg "divided oak", including the other levels of the top tiered guard, 3⁄43⁄4^ we put the branch tree) (he, the oak, the statement: 3⁄43⁄4tm ^ called the structure pulse
如 Mm A嵌套了 X豫 B, 我们 橡 A称为雕 B的 像 X橡 B称为赚 A的子 顶层分 橡没有 像, 语句: ^橡没有子 3橡, 另外, 分3¾樣也可能没有子雕。 像的内部麵的关系 来说, (橡 A ( 樣)嵌套)橡 B (子确, 是撤橡 A保存了雕 B本身 豫 A保存了雕 B的指针或 弓 I用, §¾¾#Α保存了可以弓 i用到 2橡 3的其«¾, ¾ ¾像 A可以弓!用 2橡 B; Λ¾¾的图示来说, 对 象 AC m#)«¾ B (子 是指 B至少在一个方向上位于像 A的范围之内。  For example, Mm A nested X Yu B, and our Oak A is called the Eagle B. The X-Blane B is called the earner A. The top layer of the rubber is not like the image. The statement: ^There is no child 3 rubber, and the other is 33⁄4. There is no child carving. Like the relationship of the internal faces, (Acorn A (like) nested) Oak B (Zi is indeed, is to withdraw the Oak A to save the Carving B itself. A saves the pointer of the Carving B or the bow I, §3⁄43⁄4#Α Saved the «3⁄4, 3⁄4 3⁄4 like A can be used for 2 rubber 3! With 2 rubber B; Λ3⁄43⁄4 icon, object AC m#) «3⁄4 B (sub is B at least one The direction is within the range of the image A.
图 7是在本实施例,各结构 (樣的内部醒构成示意图及 构 示意图,其中图 7A是语句: ¾嫁的 内部騰构成示意图,图 7B是分支树¾1象的内部麵构成示意图,图 7C是分 像的内部翻构成示意图, 图 7A到图 7C中,实线示出的是固定的组成部分,点划线示出的是可有可无并且不限数量的组成部分, 图 7D 是 ΐ^"示意图, 所对应的» ^码如图 1A麻。  Fig. 7 is a schematic view showing the internal structure of each structure in the present embodiment, wherein Fig. 7A is a schematic diagram of the internal structure of the statement: Fig. 7B is a schematic diagram of the internal surface of the branch tree, Fig. 7C. It is a schematic diagram of the internal turning of the image. In FIGS. 7A to 7C, the solid line shows a fixed component, and the dotted line shows an optional and unlimited number of components. FIG. 7D is a diagram. ^" Schematic, corresponding to the » ^ code as shown in Figure 1A.
图 7Α是语句 ±3¾像的内部麵构成示意图, 如图 7八麻, 姻象有 ~ 代码字段, 用于储存它所 对应的 »(弋码, 并有一个名称字段, 用于识别不同的语句±細象, 名称可以 字母 , 如 '、 V、 Figure 7Α is a schematic diagram of the internal surface of the statement ±33⁄4 image, as shown in Figure 7, the image has a ~ code field, which is used to store its corresponding » (weight, and has a name field for identifying different statements) ± fine image, the name can be letters, such as ', V,
V。 '- 图 7B是分支树像的内部薩构成示意图, 如图 7B所示, 分支树豫至少嵌套了两个分 S3像, 还可 以條更多的分 5¾樣。分 5^¾中的每一分支实际上是该分支结构的柯分割的组成部分, 没有 支, 分支结构也就不 , 将分支独立出来作为一个 来处理, 仅是为了描述和实 1¾±的简便, 同时也更符合 面向 的思想。 V. '- Figure 7B is a schematic diagram of the internal structure of the branch tree image. As shown in Figure 7B, the branch tree is nested with at least two sub-S3 images. Take more points and divide. Each branch of 5^3⁄4 is actually a component of the partition of the branch structure. There is no branch, and the branch structure is not. The branch is treated separately as a single, just for the convenience of description and realism. At the same time, it is more in line with the idea of orientation.
图 7C是分 像的内部麵构成示意图, 如图 7C麻, 分 ¾樣有 分 啶字删于保存它对应 的分支判定, 顶层分支没有对应的分支判定, 因此该字段为空。 分 寸象可以嵌套任意数量的分支树刘 口 / i , 如果没有嵌套分支树 口语句: ^像, 则该分 ¾橡称为空分 樣, 与駒 橡一样, 分支 具有一个名称字段, 用于¾¾¾不同的分支 ¾m, 名称可以使用字母表示, 如 V、 V、 V。  Fig. 7C is a schematic diagram of the internal surface of the image. As shown in Fig. 7C, the sub-word is deleted and the corresponding branch decision is saved. The top branch has no corresponding branch decision, so the field is empty. The scale image can be nested with any number of branch trees Liu / i. If there is no nested branch tree statement: ^ like, then the branch is called an empty sample. Like the oak, the branch has a name field. For different branches 3⁄4m, the names can be represented by letters, such as V, V, V.
图 7D是结构对 示意图' 对应于图 1所示的代码。 如图 7ϋ , 描述一个程序的逻辑结构的所有结 构翻成了树状 , 我们称为 树。  Figure 7D is a schematic diagram of the structure pair corresponding to the code shown in Figure 1. As shown in Figure 7ϋ, all the structures describing the logical structure of a program are turned into a tree, which we call a tree.
为了遍历±¾每一结构脉 ¾h¾结构橡树进行后序扫描 飾描, 后脑描是指: 从顶层分 ¾橡开始计算, 针对每一腺 «归计算它的每一 橡, 子雕计算完 再计算该 X橡自身, 由于 ± 象和空分¾¾1^没有子 ^, 计算它们时直接计算自身, 因此它们¾¾归终止 牛。前] 描 与后 描相比, 唯一区别在于, 针对每一 , 前^¾描先计算 自身, 再递归计算子 d。  In order to traverse ±3⁄4 each structure pulse 3⁄4h3⁄4 structural oak for post-sequence scanning, the posterior cerebral drawing refers to: Calculate from the top layer 3⁄4 rubber, calculate each rubber for each gland, calculate the sub-carving and calculate The X rubber itself, since the ± image and the space division 3⁄43⁄41^ have no children ^, calculate them directly when calculating themselves, so they are terminated. The first difference is that compared to the post-drawing, the only difference is that for each, the former ^3⁄4 describes itself, and then recursively computes the sub-d.
结构潘除具有内部翻构 还具有相应的外部 即显示在计 屏幕救他可视媒体上的图 示, ¾ ^图示的组合就构成了 »的逻辑^!图。  The structure Pan has an internal flip and also has a corresponding external display that is displayed on the screen to save his visual media. The combination of the 3⁄4^ icons constitutes the logic of »! Figure.
图 8是在本实施例, 结构 (橡的图示的示意图。 ¾^图示 i¾i为了便于描述和働鉢发明, 其魔、 文字、 颜色 ¾¾他组成部分并不 ¾¾对本发明权利要 *¾实» "式的限定, 实施本发明时可以视需要修改这 些图示的 文字、颜色戯麵成部分。.  Figure 8 is a schematic view of the structure of the present embodiment (the illustration of the rubber. 3⁄4^ illustrated i3⁄4i for the convenience of description and invention, its magic, characters, colors 3⁄43⁄4 his components are not 3⁄4⁄4 to the present invention rights *3⁄4 real » "The definition of the formula, the text and color of these illustrations can be modified as needed when implementing the invention.
' 图 是分 的图示的示意图, 如图 8A所示, 811是分支的执行路线, 可以在这条线上添加分支树 或语句块 ¾#, 分支 、的入口点 S12和出口点 S13位于执行路线的两端。 顶层分支 的入口点就 是禾 的入口点, 顶层分 ¾ 的出口点就是禾 的出口点 o - 图 8B是分^ ^的另一种图示的示意图,在图 8A的基础上增加了分支标注。如图 麻, 822是分支 注, 823是分支标注的文字。分支 于显示分支判定或其他说明文字, 分支标注的宽度与分支的宽度相 同或稍短, 从分支标注可以看出分支的范围, 因此分支标注的另一个作用;^出分支的范围。本实施例将分 支判定作为分支 主的文字, 其语 ¾¾C或 C++的语法, 不同编程语言可細相应的语法。分^豫一般不 虫存在, 而是作为某一分支树^的组成部分, 如图 SC。 4 图.8C.是分支树对象的图示的示意图,如图 8C所示, S31是入口线, 832是出口线。 * 分支树对象至少 包含两个分¾(掾, 这^^像是分支树雕的组成部分, 虚线框 833和虚线框 834所 β的就是该分支 树 象« ^的两个分 5¾。 »的执行线路是: 由入口线 ¾Λ, 执行某一分支, 到达出口线并离开该分支 树对象。图 8D示出了分支树刘象的入口点和出口点,入口点 835和出口点 836分别位于入口线的中点和出口 线的中点。 The figure is a schematic diagram of a sub-graph, as shown in FIG. 8A, 811 is an execution route of a branch, and a branch tree or a statement block 3⁄4# can be added on this line, and the branch point, the entry point S12, and the exit point S13 are executed. Both ends of the route. The entry point of the top branch is the entry point of Wo, and the exit point of the top branch is the exit point of Wo. - Figure 8B is a schematic diagram of another diagram of the division, and the branch annotation is added on the basis of Figure 8A. As shown in Fig. 麻, 822 is a branch note, and 823 is a branch mark. Branches are displayed in the branch decision or other explanatory text. The width of the branch label is the same as or slightly shorter than the width of the branch. The branch range can be seen from the branch label, so another function of the branch label; In this embodiment, the branch decision is used as the main character of the branch, and the syntax of the language is 3⁄4⁄4C or C++, and different programming languages can be finely corresponding to the syntax. The sub-sum is generally not a worm, but is a component of a branch tree ^, as shown in Figure SC. 4 Fig. 8C. is a schematic diagram of a branch tree object, as shown in Fig. 8C, S31 is an entry line, and 832 is an exit line. * The branch tree object contains at least two points (掾, which is part of the branch tree sculpture, and the dotted line box 833 and the dotted line box 834 are the two points of the branch tree image «^. 53⁄4. The execution line is: from the entry line 3⁄4, executing a branch, reaching the exit line and leaving the branch tree object. Figure 8D shows the entry and exit points of the branch tree, the entry point 835 and the exit point 836 are respectively located at the entrance The midpoint of the line and the midpoint of the exit line.
图 8Ε、 图 8F、 图 8G 图 8H ±是分支树 的图示的示意图, 由于分支结构有多种,不同种类的分支结 构具有不同数量的分支, 分支判定也不同' 本实施例将分支树 细化, 根据编 ί ^用的语言, 为各 语言的锒中常用的分支结 —个相应的分支树 X橡, 例如, 可为 C++餓: for、 while, if、 e、 if/else if/else、 switch ^^支树 ^分别称为" for分支树", "while分支树"、 "if分支树"、 "if/else分支树"、 "if/else if/else 分支树"、 "switch分支树" 。各种细化的分支树橡仅在分 量和 ^支的分支判¾±有所区别, 应于 SWITCH辯勾的分支树还有外围代码, 如 C++的 SWITCH 的外围代码是 switoh(...) {... }。 本 ¾¾例 为对应于 SWITCH结构的分支树增加一 " f呆;^卜围代码的字段,称为外围代码字段,用 呆 »ί以于 switeh(...) 的外围代码; 但不保存作用綱台符和结束符, 我们 应于 SWITCH结构的分支树称为醫分支树。  Figure 8A, Figure 8F, Figure 8G Figure 8H ± is a schematic diagram of the branch tree. Since there are many branch structures, different types of branch structures have different numbers of branches, and the branch decisions are different. According to the language used by the editor, the branch that is commonly used in each language - a corresponding branch tree X rubber, for example, can be C++: for, while, if, e, if/else if/else The switch ^^ branch tree ^ is called "for branch tree", "while branch tree", "if branch tree", "if/else branch tree", "if/else if/else branch tree", "switch branch" Tree". The various sub-branched tree oaks differ only in the branch of the component and the branch. The branch tree that should be spoofed in SWITCH has peripheral code. For example, the peripheral code of SWITCH in C++ is switoh(...) {... }. This 3⁄43⁄4 example adds a "f stay" to the branch tree corresponding to the SWITCH structure; the field of the code is called the peripheral code field, and the peripheral code of staying » is used for switeh(...); The class and terminator, the branch tree we should be in the SWITCH structure is called the medical branch tree.
图 S [是駒 的图示的¾¾图, 如图 81麻, 843是语句 ± 豫的范围矩形, 语句 ^(樣的入口点 841和出口点 842位于左 ¾Π¾"向的中线与范围矩形的左右两端竖线的交点。  Figure S [is a diagram of the 3⁄43⁄4 diagram of Figure ,, as shown in Figure 81, 843 is the range rectangle of the statement ± 豫, statement ^ (sample entry point 841 and exit point 842 are located on the left 3⁄4Π3⁄4" direction of the center line and the range rectangle The intersection of the vertical lines at both ends.
下面对图 ό所示的各步骤作进^ 细描述。  The steps shown in the figure are described in detail below.
如图 6所示, 步骤 A生成一个顶层分¾¾, 这^顶层的 x , 其他步骤沂产生的 直接或间接 嵌套于顶层分 ¾m中。  As shown in Figure 6, step A generates a top-level partition, which is the top-level x, and the other steps are directly or indirectly nested in the top-level 3⁄4m.
如图 6戶; ^, 步骤 B在任意层次的分^ (像中嵌套分支树 或语句 首先, 可以视需要在 顶层分 橡中嵌套分支树 ¾mn/或语句:^寸象, 由«—分支树)像至少含有两个分 像, 因此, 就 产生了其他层次的分^!橡' ¾¾ 橡可以 ¾^频套分支树 X御 /或分 ¾ (橡。 Figure 6 household; ^, step B at any level of the branch ^ (like nesting branch tree or statement first, you can nest branch tree 3⁄4mn / or statement in the top layer of rubber as needed: ^ inch image, by «- The branch tree) image contains at least two partial images, so Generated other levels of points ^! Oak '3⁄43⁄4 rubber can be 3⁄4^ frequency set branch tree X Royal / or 3⁄4 (Oak.
本发明可用 计辦逻辑结构图 (例如用于详细设计),也可用于根据已有的 »生成逻辑^ I图 (例如用 于测试阶段)。本雄例用于设 踌逻辑结构图, 步骤8難的分支树 (御駒:^ 由用户指定, 條 分支树对^ ¾/或语句
Figure imgf000008_0001
并嵌 套到^ S的^^ ¾上, 即可 "±隹砌"出辦逻辑结构图, 所 的数量和«¾的层次没有限制。下面用 m, 画出»逻辑结构图的过程的示例来详细说明本錢例的步骤 B :
The present invention can be used to calculate a logical structure diagram (for example, for detailed design), and can also be used to generate a logic map according to an existing » (for example, for a test phase). This male example is used to set up the logical structure diagram, the difficult branch tree in step 8 (the 驹:^ is specified by the user, the branch tree is paired with ^ 3⁄4/ or the statement
Figure imgf000008_0001
And nested on the ^ ^ 3⁄4 of ^ S, you can "± 隹 "" to the logical structure diagram, the number of the number and the level of «3⁄4 is not limited. The following is an example of the process of drawing the »logical structure diagram with m, detailing step B of the cost example:
图 9 ϊ 细设计时, 画出 »逻辑结构图的过程的示意图, 图 9Α至图 9D示出了画出对应于图 1B 所示代码的逻辑结构图的各步骤, 均由两部分组成: 左; 上边是逻辑^图的外部 ¾¾^, 右 边是相 Figure 9 is a schematic diagram of the process of drawing a logical structure diagram, and Figures 9A to 9D show the steps of drawing a logical structure diagram corresponding to the code shown in Figure 1B, which are composed of two parts: Above is the external 3⁄43⁄4^ of the logic ^ diagram, the right side is the phase
^(像的内部 «及其嵌套 , 戶 M的 "重画"是 行步骤 C, 后文将对步骤 C作^^ ^细描述。 ^ (The internal « like its nesting, the "repainting" of the household M is the step C, which will be described in detail later.
为了便于用户选择 ¾¾, 本实施例还提供一个¾*¾择界面, 该界 ffi ^以切换编程语言, 每种语言显示 对应于各种分支结构的图标 (即细化的分支树对象)以及对应于 jl顷序结构的图标 (即语句块 供用户选择。 为 了描述方便, 当用户选择一个对应于某一分 构的图标时, 我们称为选择一个某种分支树,例如 while分支 树、 ififelse分支树, 当用户选择 对应于 jl 结构的图标时, 我们称为选 詢块, 将 ¾«择统称为 选^ ^个雕。 '- .  In order to facilitate the user to select 3⁄4⁄4, the embodiment also provides a 3⁄4*3⁄4 selection interface, which switches the programming language, and displays an icon corresponding to various branch structures (ie, a refined branch tree object) and corresponding to each language. The icon of the jl sequence structure (that is, the statement block is for the user to select. For the convenience of description, when the user selects an icon corresponding to a certain structure, we call to select a certain branch tree, such as a while branch tree, an ififelse branch Tree, when the user selects the icon corresponding to the jl structure, we call it the query block, and the 3⁄4 « is called the selection ^ ^ carving. '- .
如图 9A所示,用户选择 while分支树并在顶层分支 ¾ ^的图示上单击,该 while分支树对应于图 1B中虚 线框 101所示的代码。 901是顶层 X豫的内部麵示意图, 在顶层分 ¾橡的内部顯 901中 β while分支 树像 902并重画, 就得到图 9B左 的逻辑结构图。  As shown in Figure 9A, the user selects the while branch tree and clicks on the icon of the top-level branch, which corresponds to the code shown in dashed line 101 in Figure 1B. 901 is a schematic diagram of the inner surface of the top layer X, and in the top of the top, the β while branch tree image 902 is redrawn, and the logical structure diagram of the left side of Fig. 9B is obtained.
如图 9B所示, 用户选擀^ 1:^ , 并在顶层分支对象执行路线位于 while分支树的右边单击, 该语句 寸应于图 1B中虚线框 105 的代码。 在顶层分¾¾的内部 «中^6 ¾^后  As shown in Fig. 9B, the user selects 1:^:^ and clicks on the right side of the top branch object execution line located on the right side of the while branch tree, which should be in the code of the dashed box 105 in Fig. 1B. At the top of the 3⁄43⁄4 internal «中^6 3⁄4^
903并重画, 得到图 9C左; 的逻辑结构图。 903 and redraw, get the logical structure diagram of Figure 9C left;
如图 9C所示, 用户选择 if/else分支树, 并在 while分支树的第一分支单击, 该 ififelse分支树对应于图 1B 中虚线框 102麻的代码。在 while分支树的第一分 像的内部画中嵌套一个 «e分支树 904并重 画, 得到图 9D j;jij^的逻辑结构图。  As shown in Figure 9C, the user selects the if/else branch tree and clicks on the first branch of the while branch tree, which corresponds to the code of the dashed box 102 in Figure 1B. Nesting an «e branch tree 904 in the internal drawing of the first image of the while branch tree and redrawing it, and obtaining the logical structure diagram of Fig. 9D j; jij^.
如图 9D所示, 用户选择 ^±^(樣; 并分别在 i se分支树的第一分支和第二分支单击。在 ifelse分支 树的第一分支 第二分 的内部 β中分别 β— 吾句 ;¾¾] 905、 906并重画, 得到最终的 3 辑 结构图。 駒 ± 樣 905对应于图 1B中虚线框 103麻的代码, 语句: 橡 906对应于图 1B中虚线框 104 所示的代码。 ' - 本¾¾例分别価一个自动递增的字母»*作为 i#iOi«^i¾分 像的名称,如 'a'、 V、 V。添 加駒± ^!橡时为该駒 (橡命名, 添加分支梅橡时为其所属分¾»命名。 .  As shown in FIG. 9D, the user selects ^±^ (like; and clicks on the first branch and the second branch of the i se branch tree respectively. In the internal β of the second branch of the first branch of the ifelse branch tree, respectively β- My sentence; 3⁄43⁄4] 905, 906 and redraw, get the final 3 series structure diagram. 驹 ± sample 905 corresponds to the code of the dotted frame 103 in Figure 1B, the statement: the rubber 906 corresponds to the dotted line frame 104 in Figure 1B Code. ' - This 3⁄43⁄4 case respectively 価 an auto-incrementing letter »* as the name of i#iOi«^i3⁄4, such as 'a', V, V. Add 驹± ^! when the oak is the 驹 (the name of the oak When adding a branch of Mayan, name it 3⁄4».
如图 6麻, 步骤 C计算各 5!樣的尺寸及健并画出其图示, 后文戶 M "重画"或 "重画逻辑 图" 均是指重麵 Co步骤 C包括三个方面: 计算各 X像的尺寸, 本錢例棚宽度和高 ^各) (像 的尺寸, 由于分支树入口线高度的计算较 », 因此, 本实施例还 ¾Λ口线高度也作为分支树雕的尺寸; 计算各对象的位置, 本¾½例用入口点坐标来 ¾ ^各对象的位置; 画出各对象的图示。  As shown in Fig. 6 , step C calculates the size and health of each 5! and draws the icon. The rear M "repainting" or "repainting logic" refers to the heavy surface Co step C includes three aspects. : Calculate the size of each X image, the cost of the shed and the height of the shed (the size of the image, because the calculation of the height of the branch line of the branch tree is more than »), therefore, the height of the Λ line is also used as the size of the branch tree sculpt in this embodiment. ; Calculate the position of each object, this 3⁄4⁄2 case uses the coordinates of the entry point to 3⁄4 ^ the position of each object; draw a diagram of each object.
由于子嫁 内, 其范围位于 豫的范围之内, 因此, 增加 ¾¾ffl除一个 X豫时, 其直接或 间 ^樣的尺寸会发生变化, 一¾¾的健也会; ^变化, 所以, 增加 I¾W除一个 X橡时, 一般都需要 雄十算各 X橡的相 寸和 为了计算各潘的相关尺寸和健, 还需预先定义一SS本尺寸。  Due to the submarriage, the range is within the range of Yu, therefore, the addition of 3⁄43⁄4ffl, except for one X, will change the size of the direct or inter-sample, and a 3⁄43⁄4 of the health will also change; ^, so, increase I3⁄4W In addition to a X rubber, it is generally necessary to calculate the size of each X rubber and to calculate the relevant size and health of each pan, it is also necessary to predefine a SS size.
图 10是在本实施例, 各 X像的尺寸、健和基本尺寸的示意图。  Fig. 10 is a view showing the size, the health and the basic size of each X image in the present embodiment.
. .雕的宽度和高度就慰像包 «橡的子确 ¾±、 *£、最右、最下^ Ϊ连成的矩形(称为范围矩 形)的宽度和高度。 如图 10所示, 虚线画出的矩形 1001是顶层分支 的范围矩形, 虚线画出的矩形 1002 是 if/else分支树的范围矩形, 虚线画出的矩形 1003是 while分支树的第一分支的范围矩形, 虚线画出的矩形 1004是 if/dse分支树的第一分支的范围矩形, 实线画出的矩形 1005是一个 i詢 ±^5 (橡的范围矩形。  The width and height of the eagle are as good as the width and height of the rectangular shape of the rectangle (called the shape of the rectangle). As shown in FIG. 10, the rectangle 1001 drawn by the dashed line is the range rectangle of the top branch, the rectangle 1002 drawn by the dashed line is the range rectangle of the if/else branch tree, and the rectangle 1003 drawn by the dashed line is the first branch of the while branch tree. The rectangle of the range, the rectangle 1004 drawn by the dashed line is the range rectangle of the first branch of the if/dse branch tree, and the rectangle 1005 drawn by the solid line is an i query ±^5 (the range rectangle of the oak).
如图 10所示, E1是 while分支树对象的入口线高度, E2是 if/else分支树对象的入口线高度。  As shown in Figure 10, E1 is the entry line height of the while branch tree object, and E2 is the entry line height of the if/else branch tree object.
如图 10所示, 1011是顶层分 橡的入口点、 1012是 while分支树 ) (橡的入口点、 1013是 while分支树 劇勺第一分支的入口点、 1014是 橡的入口点, 它们的坐标就是相 i¾橡的入口点坐标。  As shown in Figure 10, 1011 is the entry point of the top-level rubber, 1012 is the branch tree (the entrance point of the oak, 1013 is the entry point of the first branch of the while branch tree, and 1014 is the entry point of the oak, their The coordinates are the coordinates of the entry point of the phase i3⁄4 rubber.
如图 10所 , 图 10中由字母 S开头的标注均 ¾¾¾本尺寸, 包括:  As shown in Figure 10, the beginning of the letter S in Figure 10 is 3⁄43⁄43⁄4 in size, including:
语句: ^愤的宽度 S1、駒:^像的高度 S2; 分支标注的高度 S3、 分支标注与分支的距离 S4、 两条分支之间的距离 S5; 其中, 分支标注并非必需的, 如果省 支 ¾¾, 可以把 S3和 S4均设为 0, 不须改 »¾3¾的计算公式; Statement: ^ width of anger S1, 驹: height of ^ image S2; The height of the branch mark S3, the distance between the branch mark and the branch S4, and the distance between the two branches S5; wherein the branch mark is not necessary, if the branch is 3⁄43⁄4, both S3 and S4 can be set to 0, no need to change » 3⁄433⁄4 calculation formula;
左¾ ^向连接的两个 ¾ ^间的距离 S6。  The distance between the two 3⁄4^ of the left 3⁄4^ direction is S6.
尺寸不顧樣的增删而变化, 但可以舰调 尺寸纖放逻辑结构图。  The size varies regardless of the addition and deletion of the sample, but the size of the ship can be scaled.
下面进"^细描述步骤 C  The following is a detailed description of step C.
C1.计算各橡的尺寸。 如前臓, 各雕的尺寸包括: 各 X彻勺宽度和高度, 计算各) (橡的宽度和高度 的步骤是: 从顶层分¾¾开始, 针对每一雕, 先递归计算各子 (働宽度和高度, 再根鮮雕的宽度 和高度计算¾¾的宽度和高度。  C1. Calculate the size of each rubber. As before, the dimensions of each carving include: X width and height of each spoon, calculate each) (The steps of width and height of the oak are: starting from the top 3⁄43⁄4, for each carving, recursively calculate each child (働 width) And height, calculate the width and height of the 3⁄43⁄4 width and height.
图 11是本实施例计算各 X像的宽度和高度的流 @¾意图,其中图 11A是计算语句:^ (像的宽度和高度的 流程示意图, 图 11B是计算分 的宽度和高度的^!示意图, 图 11C是计算分支树 3像的宽度和高度的 示意图。  Figure 11 is a flow diagram of the width and height of each X image in the present embodiment, wherein Figure 11A is a flow chart for calculating the width of the image: ^ (the width and height of the image, and Figure 11B is the width and height of the calculated score! Schematic, FIG. 11C is a schematic diagram of calculating the width and height of the image of the branch tree 3.
如图 HA所示, t i ., 依下述公式计 宽度和高度:  As shown in Figure HA, t i ., according to the following formula: width and height:
宽度 =S1 ; Width = S1 ;
• 高度 =S2; • Height = S2 ;
其中, S1为 的宽度, S2为 ±^1 的高度。 '  Where S1 is the width and S2 is the height of ±^1. '
针对分¾¾, 依下述公式计難宽度和高度: .  For the 3⁄43⁄4, calculate the width and height according to the following formula:
宽度 = S1 +2*S6 (N=0);  Width = S1 +2*S6 (N=0);
宽度 = ∑W + (N+1)*S6 (N>0);  Width = ∑W + (N+1)*S6 (N>0);
高度 = S3 + S4 (N=0);  Height = S3 + S4 (N=0);
高度 =Hm + S3 + S4 (N>0);  Height = Hm + S3 + S4 (N>0);
其中, N为该分 ¾m的子对象数量, SI为语句:^像的宽度, S6为左 ¾向连接的两个¾ ^间的距 离, ∑W为所有子 的宽度之和, S3为分支 注的高度, S4为分支标注与分支的距离, Hm为高度最大的 子雕的高度。 ,  Where N is the number of sub-objects of the division 3⁄4m, SI is the width of the statement: ^ image, S6 is the distance between the two 3⁄4^ of the left 3⁄4 direction, ∑W is the sum of the widths of all the sub-s, and S3 is the branch note. The height of S4 is the distance between the branch and the branch, and Hm is the height of the sub-carving with the highest height. ,
具体计算过 图 11B所示, 如果子 X像数量 N为 0, 则用公式: 宽度 = S1 + 2*S6, 高度 = S3 + S4计 '算自身的宽度和高度, 否则扫描子 , 如果子 是语句: 贝腿归执行图 11A麻的计算, 否则递 归执行图 11C所示的计算; 所有子膽计算完颇, 査找高度最大的子雕, 然后按公式: 宽度 =∑W + (N+1)*S6, 高度=1¾1 + 33 + 34计算自身的宽度和高度。 -.  Specifically, as shown in Fig. 11B, if the number of sub X images N is 0, the formula is used: width = S1 + 2 * S6, height = S3 + S4 'calculates its own width and height, otherwise the scan is if the sub is Statement: The calculation of the Fig. 11A hemp is performed, otherwise the calculation shown in Fig. 11C is performed recursively; all the sub-biliary calculations are completed, and the sub-carving with the highest height is found, and then according to the formula: Width = ∑W + (N+1) *S6, Height = 13⁄41 + 33 + 34 Calculate its width and height. -.
针对分支树翁, 依下述公式计難宽度和高度:  For the branch tree, calculate the difficulty width and height according to the following formula:
宽度 =Wm; ·  Width = Wm;
高度 =∑H + ( -1) * S5;  Height = ∑H + ( -1) * S5;
其中, Wm为宽度最大的子对象的宽度, ΣΗ为所有子对象的高度之和, N为子对象数量, S5为两条分 支之间的距离。  Where Wm is the width of the largest sub-object, ΣΗ is the sum of the heights of all sub-objects, N is the number of sub-objects, and S5 is the distance between the two branches.
具体计算过禾 1¾图110所示,扫描子 X豫,针对每 樣(子 X豫都是分 豫),递归执行图 11B所 示的计算, ^^查找宽度最大的分支, 然后按 的公式计算自身的宽度和高度。  Specifically, the calculation is shown in Fig. 110, the scan is X, and for each sample (sub-X is hesitant), the calculation shown in Fig. 11B is performed recursively, ^^ finds the branch with the largest width, and then calculates according to the formula Its own width and height.
计算完分支树的宽度和高度后, 还要对 支, 使分支树的所有分支的宽度相等, 方法 改除宽度最 大的分支以外的 支的宽度, 令其等于宽度最大的分支的宽度。  After calculating the width and height of the branch tree, it is also necessary to make the branches of the branch tree equal in width. In this way, the width of the branch other than the largest branch is removed, so that it is equal to the width of the branch with the largest width.
如前所述, 各雕的尺寸还可以进 ~ ^包括: 分支树雕的入口线高度, 下面描述计算分支树 (橡的入 口线高度的步骤。  As mentioned earlier, the size of each carving can also be entered into. ^Includes: The height of the entrance line of the branch tree carving. The following describes the procedure for calculating the branch line height of the branch tree.
为了计算分支树 的入口线高度, 需要先计算各 的底座高度。所 座高度就是 ¾1象的 口点 到范围矩形底边的距离, 各 均有自己的/ 高度, β高度也是计算入口点坐标的基础。用后 ff¾描方 法计算各 的驗高度, 即从顶层分 橡开始, 针对每一脉 先递归计算各子?樣的離高度, 再根 据各子雕的鰣高度计算 的藤高度。  In order to calculate the entrance line height of the branch tree, it is necessary to calculate the height of each base first. The height of the seat is the distance from the mouth of the 3⁄41 elephant to the bottom edge of the range rectangle, each with its own / height, and the height of β is also the basis for calculating the coordinates of the entry point. After the ff3⁄4 method is used to calculate the height of each test, starting from the top layer, the height of each sub-sample is recursively calculated for each pulse, and the height of the vine is calculated according to the height of each sub-carving.
图 12是本实施例计算各 3像雄高 分支树樣入口线高度的流 意图,其中图 12A是计算駒 ±夬 X樣赫高度的流程示意图, 图 12B是计算分 豫藤高度的流程示意图, 图 12C是计算分支树樣 高度的流程示意图, 图 12D是计算分支树 白勺入口线高度的流程示意图。 - 如图 12A所示, ^ i -, 依下列公式计 高度: / ^高度 = S2/2; FIG. 12 is a flow chart for calculating the height of the entrance line of each of the three male and female branches in the present embodiment, wherein FIG. 12A is a flow chart for calculating the height of the 驹±夬X-like height, and FIG. 12B is a flow chart for calculating the height of the vine. 12C is a schematic flow chart for calculating the height of the branch tree, and FIG. 12D is a flow chart for calculating the height of the entry line of the branch tree. - As shown in Figure 12A, ^ i -, the height is calculated according to the following formula: / ^ Height = S2/2 ;
其中 S2 M^ m  Where S2 M^ m
针对分 像 依下述公式计難離高度:  For the image, it is difficult to get away from the height according to the following formula:
航高度 =0 (N=0);  Flight altitude =0 (N=0);
藤高度 =Bm (N>0);  Vine height = Bm (N>0);
其中, N为子 X橡数量, Bm为;^高度最大的子 X像的; 高度。  Where N is the number of sub-X rubbers, Bm is; ^ is the height of the child X image; height.
具体计算过禾 1$口图 12B所示, 如果子 ¾] 数量 N为 0, 贝 —个公式计算雄高度, 否则扫描子 , 如果子 是语句块, 则递归执行图 i2A Bi¾的计算, 否则递归执行图 12C所示的计算,
Figure imgf000010_0001
计算完成后, 査職高度最大的子聰 雌± ^二个公式计算赫高度。
Specifically calculated as the 1$ port shown in Figure 12B, if the number N of the child is 0, the formula calculates the male height, otherwise the scan, if the child is a statement block, recursively performs the calculation of the graph i2A Bi3⁄4, otherwise recursively Perform the calculation shown in Figure 12C,
Figure imgf000010_0001
After the calculation is completed, the child height is the highest.
针对分支树雕, 依下述公式计算其雜高度:  For branch tree carving, calculate its impurity height according to the following formula:
赫高度 = [Βι + (Ηη-Βη) + Σ(Η2..Ιϊη-ι) + (N-1)*S5] / 2 + Bn;  Hertz height = [Βι + (Ηη-Βη) + Σ(Η2..Ιϊη-ι) + (N-1)*S5] / 2 + Bn;
其中, Bi为第^ (橡雄高度' Ηπ为 «子 X像高度, Bn为 子豫鐘高度, Σ(Η2...Ηη-ι)为 除第" "ΐΧ衞口: 子 以外的其他子 的高度之和, Ν为子 X橡観 S5为两 支之间的距离。  Where Bi is the second ^ (the height of the oak is ' π is « the height of the sub X image, Bn is the height of the sub-Yu clock, and Σ (Η 2... Η η-ι) is the other than the "" The sum of the heights, the X is the child X rubber S5 is the distance between the two.
具体计算过程如图 12C所示, 扫描子 ¾]象, 针对^ ^3橡, 递归执行图 12B麻的计算, 所有子 3樣 计算完; 棚 di公式计箅自身的雌高度。  The specific calculation process is shown in Fig. 12C. Scanning the image, for the ^^3 oak, recursively performs the calculation of Fig. 12B, and all the subsamples are calculated; the shed di formula calculates its own female height.
如图 12D所示, 依下述公式计算分支树 ^入口线高度:  As shown in Fig. 12D, the branch tree ^ entry line height is calculated according to the following formula:
入口线高度 =Βι + (Ηη - Βη) + Σ(Η2...Ηη-ι) + ( - 1)*S5;  Entrance line height = Βι + (Ηη - Βη) + Σ(Η2...Ηη-ι) + ( - 1)*S5;
其中, Bi为第 橡) ¾¾¾度, Ηη为«子5!橡高度, Bn为駄子豫鍵高度, ∑(H2..JHn- 1)为 除第 最末子刘象以外的其他子 ¾m的高度之和, N为子 S5为两^ 间的距离。  Among them, Bi is the first oak) 3⁄43⁄43⁄4 degrees, and Ηη is «子5! The height of the rubber, Bn is the height of the scorpion, and ∑ (H2..JHn-1) is the sum of the heights of the other 3⁄4m except for the last and last, and N is the distance between the two S5.
C2.计算各 X像的 β。 如前 f¾, 各橡的趙包括: 各橡入口点坐标。计算各 ¾#入口点坐标的步 骤如下: 从顶层分 椽开始, 针病一雕, 先计算 M 的入口点坐标, 再根据 纖位置递归计算 各子櫞的入口点坐标。  C2. Calculate the β of each X image. As before f3⁄4, each rubber's Zhao includes: the coordinates of each rubber entry point. The steps for calculating the coordinates of each 3⁄4# entry point are as follows: Starting from the top level, acupuncture is sculpted, the coordinates of the entry point of M are calculated first, and the coordinates of the entry points of each sub-port are calculated recursively according to the position of the fiber.
为了便于描述和实施, 本实施例釆用如下坐标系: «I坐标向右为正, 标向下为正, 原点为顶层分支 雕范围矩形的 £±角。 ' .  For ease of description and implementation, the present embodiment uses the following coordinate system: «I coordinate is positive to the right, positive is positive to the bottom, and the origin is the top ± branch of the rectangle of the engraving range. ' .
针对顶层分支 X橡' 依下述公式计算其入口点坐标:  For the top-level branch X rubber', calculate the entry point coordinates according to the following formula:
X=0;  X=0;
Y-H- B;  Y-H- B;
■ . 其中, X为入口点横坐标, 向右为正, Y为入口点 ¾ ^标, 向下为正, H为 (豫高度, B为);豫艇高度。  ■ Where X is the abscissa of the entry point, positive to the right, Y is the entry point 3⁄4 ^ mark, down is positive, H is (health height, B is);
针对分 翻第 N 像, 依下述公式计龍入口点坐标: - Xn=∑(Wi...Wn-i) + N*S6; For the N-th image, the coordinates of the dragon entry point are calculated according to the following formula: - Xn=∑(Wi...Wn-i) + N*S6 ;
Yn=Yi; - 其中,Ν为从 1幵始的子橡 «^号,¾1为该第 Ν ΐΧ橡的入口点的横 标,向右为正,∑(Wi...Wn-i) 为¾^ ^¾ ^前的子豫的宽度之和, S6为左 ¾Γ¾ "向雜的两个 Xife间的距离, Yn为戶 ¾ΜΝ个 子像的入口点的 ¾^标, 向下为正, ΥΪ为分^ ^入口点«标。  Yn=Yi; - where Ν is the sub-oil «^ number from 1 ,, 3⁄41 is the horizontal mark of the entry point of the Ν ΐΧ rubber, positive to the right, ∑ (Wi...Wn-i) is 3⁄4 ^ ^3⁄4 ^ The sum of the widths of the preceding sub-heals, S6 is the distance between the left X⁄4Γ3⁄4 "to the two Xifes, Yn is the 3⁄4^ of the entry point of the household 3⁄4ΜΝ, and the direction is positive, ΥΪ is the minute ^ ^ entry point «mark.
针对分支树糊勺第 Ν 膽, 依下述公式计難入口点坐标:  For the branch of the branching paste, calculate the coordinates of the entry point according to the following formula:
Xn = Xi;  Xn = Xi;
Yn=Yl - E/2 (N=l); Yn=Yl - E/2 (N=l);
Figure imgf000010_0002
Figure imgf000010_0002
' 其中, N为从 1开始的子)像 号, η为 ¾¾ N " ^X像的入口点的横坐标, 向右为正, ΧΪ为该分 支树 (樣入口点横坐标, Υη ¾ Ν ^ ¾¾的入口点的»标, 向下为正, Yn-i为前 入口点 » 标, Bn-i为前 D橡的 β高度, Ηη为¾¾ Ν ^像的高度, Bn为織 N ^^的 高度, S5 为两 间的距离。  ' where N is the child starting from 1), η is 3⁄43⁄4 N " ^X image of the entry point of the abscissa, right is positive, ΧΪ is the branch tree (like the entry point abscissa, Υη 3⁄4 Ν ^ The mark of the entry point of 3⁄43⁄4 is positive, Yn-i is the front entry point», Bn-i is the β height of the front D rubber, Ηη is the height of the 3⁄43⁄4 Ν ^ image, and Bn is the weave N ^^ Height, S5 is the distance between the two.
C3.画出各 ϋ的图示。 画出各 ¾ ^图示的步骤如下: 从顶层分¾¾开始, 针对每一 X像, 先画出 象的图示, 再递归画出各子 ¾ 的图示。  C3. Draw a diagram of each 。. The steps for drawing each 3⁄4 ^ diagram are as follows: Starting from the top layer 3⁄43⁄4, for each X image, first draw an icon of the image, and then recursively draw the icon of each child 3⁄4.
画顶层分¾¾ 前檫除旧的整隔图, 画其«¾—3樣前檫除"^樣范围矩形内的图形。  Before the top layer is divided into 3⁄43⁄4, remove the old whole picture, and draw the picture inside the rectangle of the range of «3⁄4—3.
各雕均有出口点, 示 C o, Yo)的为: Xo=Xi +W; Each carving has an exit point, indicating C o, Yo): Xo=Xi +W;
Yo = Yi;  Yo = Yi;
其中, Xi为入口点横坐标, w为对象的宽度, Yi为入口点纵坐标。  Where Xi is the abscissa of the entry point, w is the width of the object, and Yi is the ordinate of the entry point.
图 13是本实施例画出各 (豫图示的示意图,其中图 13A是画出分¾ (樣图示的示意图,图 13B是画出另 一种分 豫图示的示意图, 增加了分支 feft, 图 13C是画出分支树樣图示的示意图, 图 13D是画出 ±^¾1*图示的示意图。  Fig. 13 is a schematic view showing each of the drawings (Fig. 13A is a schematic diagram showing a division, and Fig. 13B is a schematic diagram showing another divisional diagram, adding a branch feft Fig. 13C is a schematic diagram showing a branch tree diagram, and Fig. 13D is a diagram showing a ±^3⁄41* diagram.
如图 13A麻, 分¾樣的图示包括: 执行线 811。 画出执行线 811的方法是: 在入口点 1311和出口点 1312之间画一条线段。  As shown in Fig. 13A, the illustrations are divided into: Execution line 811. The method of drawing the execution line 811 is to draw a line segment between the entry point 1311 and the exit point 1312.
如图 13B所示, 另一种分支刘象的图示还包括: 分支标注 822和分支标注的文字 823。  As shown in Fig. 13B, the illustration of another branch image further includes: a branch label 822 and a branch label text 823.
除画出执行线外, 还要画出分支 ¾¾, 本 例用矩形作为分支标注, 画出分支标注的步骤如下: 计算分支 巨形 823, 其 ¾±角 1321坐标 (Χ,Υ)为:  In addition to drawing the execution line, draw the branch 3⁄43⁄4. In this example, use the rectangle as the branch label. The steps for drawing the branch label are as follows: Calculate the branch giant shape 823, its 3⁄4± angle 1321 coordinates (Χ,Υ) are:
X=Xi + S6; X=Xi + S6 ;
Y=Yi + H -B + S3 + S4; Y=Yi + H -B + S3 + S4 ;
其中, Xi为该分支的入口点横坐标, S6为左 向«的两个 间的距离, Yi为该分支的入口点 标, H为该分支高度, B为该分支 高度, S3为分支标注的高度, S4为分支标注与分支的距离。 分 形的宽度和高度为:  Where Xi is the abscissa of the entry point of the branch, S6 is the distance between the two directions of the left direction, Yi is the entry point of the branch, H is the height of the branch, B is the height of the branch, and S3 is the branch mark Height, S4 is the distance between the branch and the branch. The width and height of the fractal are:
宽度 =W- S6*2;  Width = W- S6*2;
高度 = S3; Height = S3 ;
其中, W为分支宽度, S6为左; ίΓ ^向连接的两个¾ ^间的距离, S3为分支 注的高度。  Where W is the branch width, S6 is the left; ίΓ ^ is the distance between the two 3⁄4^ connections, and S3 is the height of the branch note.
在本实施例, 分支标注不画边框, 只画出灰色背景。  In this embodiment, the branch label is not drawn with a border, and only a gray background is drawn.
. 最后在分支 巨形中输出分支 主的文字。  Finally, the main text of the branch is output in the branch giant.
如图 13C所示, 分支树?樣的图示包括: 入口线 831和出口线 832, 画法是:  As shown in Fig. 13C, the illustration of the branch tree includes: an entry line 831 and an exit line 832, the drawing is:
计算入口线 831的两个端点的坐标值 (XI, Υ1)' (X2,Y2):  Calculate the coordinate values (XI, Υ1)' (X2, Y2) of the two endpoints of the entry line 831:
Xl =X2 = Xi; 其中 Xi为入口点横坐标:  Xl = X2 = Xi; where Xi is the entry point abscissa:
YI =Υι -Ε/2; 其中 ¾为入口点纵坐标, Ε为入口线高度;  YI = Υι -Ε/2; where 3⁄4 is the ordinate of the entry point and Ε is the height of the entry line;
Υ2 = YI +Ε;.其中 Y1为入口线的上端点 S ^标, Ε为入口线高度。  Υ2 = YI +Ε;. where Y1 is the upper endpoint of the entry line S^, and Ε is the entry line height.
将入口线向右偏移该分支树? 的宽度, 即可得到出口线 832, 其坐标为: ·  By shifting the entry line to the right by the width of the branch tree?, you can get the exit line 832 with the coordinates:
(X1+W,Y1), (X2+W,Y2); 其中 W为分支树对象的宽度。 (X1+W, Y1), (X2+W, Y2) ; where W is the width of the branch tree object.
在 (X1,Y1), (Χ2,Υ2)之间画一条线段, 即为入口线 831。  Draw a line segment between (X1, Y1), (Χ2, Υ2), which is the entry line 831.
在 (X1+W,Y1), (X2+W,Y2)之间画一条线段, 即为出口线 832。  Draw a line segment between (X1+W, Y1), (X2+W, Y2), which is the exit line 832.
如图 13D所示, 本实施例用范围矩作为 块的图示。 画出语句: ¾X像的图示的方法是:  As shown in Fig. 13D, this embodiment uses the range moment as an illustration of a block. Draw a statement: The method of the 3⁄4X image is:
用直线画出范围矩形 843, 矩形的: £±角 1341坐标为:  Draw a range rectangle with a straight line 843, the rectangle: £± angle 1341 coordinates are:
X = Xi; X = Xi ;
Y = Yi - S2/2; Y = Yi - S2/2 ;
其中, i为该语句块入口点横坐标, Yi为该语句块入口点纵坐标, S2为语句块对象的高度。  Where i is the horizontal coordinate of the entry point of the statement block, Yi is the ordinate of the entry point of the statement block, and S2 is the height of the statement block object.
各 X像画出后' 所获得的图形就是禾 逻辑结构图, 为了编 i W喿作逻辑结构图, 本实施例还可以增加 下述步骤:  After the X images are drawn, the obtained graphics are the logical structure diagrams. In order to compile the logical structure diagrams, the following steps can be added in this embodiment:
用于在分支树刘象中添加分支的步骤, 该步骤具体包括:  The step of adding a branch to the branch tree image, the step specifically includes:
1)■命中测 ¾ ^法判断用户选择了哪个分支树  1) ■ hit test 3⁄4 ^ method to determine which branch tree the user has selected
2)在该分支树樣中添加"^分¾¾ ; 2) Add "^ points 3⁄43⁄4" to the branch tree ;
3)重画逻辑结构图。  3) Redraw the logical structure diagram.
命中测试是指 ^離鼠标或光标的位置判断用户是否选中某一 ¾¾¾鼠标在某一 上停留的方法。 本实 施例釆用后舶描方法进行命中测试: 从顶层分刻象开始, 针对每一 先递归测试各子膽, 欄试 该¾ , 命中某一雕时结束测试, 判断命中的方法是: 如果鼠标或光标位置位于该膽的范围矩形内则命 中, 否则 »中。 '·  The hit test is the method of judging whether the user has selected a 3⁄43⁄4⁄4 mouse to stay on a certain location from the position of the mouse or the cursor. In this embodiment, the hit test method is used to perform the hit test: starting from the top-level scoring, each sub-recursive test is performed for each recursion, and the column test is performed, and the test is ended when a certain engraving is hit, and the method for judging the hit is: The mouse or cursor position is within the bounding rectangle of the gallbladder and hits, otherwise ». '·
用于在分支树 中删除选定分支的步骤, 该步骤具体包括: 1) ffl前述的命中测∞法判断用户选择了哪个分¾¾^; The step of deleting the selected branch in the branch tree, the step specifically includes: 1) ffl The above-mentioned hit test method determines which branch the user has selected 3⁄43⁄4^ ;
2)在 中删^ ffl应的分  2) In the middle of deleting ^ ffl should be
3)重画逻辑结构图。  3) Redraw the logical structure diagram.
添加和删除分支时,要保证分支树豫的完整,一殊说,可以添加和删除的,只能是 IF绪构的 ELSE IF 分支或 ELSE分支、 SWITCH结构的 CASE分支和 DEFAULT分支, IF结构中, ELSE分支或空分 、有其 一, SWITCH结构中, DEFAULT分支与空分支也必有其一。循环结构对应的分支积赚不能添加 除分支。  When adding and deleting branches, it is necessary to ensure the completeness of the branch tree. In addition, it can be added and deleted. It can only be the ELSE IF branch or the ELSE branch of the IF structure, the CASE branch of the SWITCH structure, and the DEFAULT branch. , ELSE branch or space division, there is one, in the SWITCH structure, DEFAULT branch and empty branch must also have one. The branch product corresponding to the loop structure cannot be added to the branch.
用«改分翅定的步骤, 该步骤具体包括:  Using the step of changing the wing, the step specifically includes:
1) ffl前述的命中测 法判断用户选择了哪个分¾¾#; 1) ffl The aforementioned hit test method determines which branch the user has selected 3⁄43⁄4# ;
2)显示一个编 «, 其中显 见有的分支判定;  2) Display a edit «, which shows branch judgments;
3)用户在编 β中修改分支判定;  3) The user modifies the branch decision in the β;
4)将新的分支判定保存到分 ¾Χ豫中。  4) Save the new branch decision to the 3⁄4Χ.
用于编 詢土姻當截码的步骤, 该步骤具体包括:  The step of invoking the in-laws as a truncation code, the step specifically includes:
1)棚前述的命中测 去判断用户选择了哪 吾句 橡;  1) The aforementioned hit test of the shed to determine which of the choices the user has selected;
2)显示一个编 $雜, 如果语句:^像已有代码, 在编 «中显 见有的代码;  2) Display a code, if the statement: ^ like the existing code, see the code in the editor «
3) ; 3);
)
Figure imgf000012_0001
)
Figure imgf000012_0001
用于隐藏 或显示 象的步骤。对于内部逻辑较 ¾¾的程序, 它的逻辑结构图也将较复杂, 为了突 出重点, 便于分 WfiiT,逻辑结构, 或者为了 JBiSff路径, 可将逻辑结构图的部分内容隐藏。本 例可以 ί壬意对象隐藏, 画出隐藏的 ¾]象时' 可以忽略它' 也可以画出一个替代图示。 图 14是对部分图示的改 画出隐藏对象的图示的示意图,如图 14所示,如果隐藏的像是分支树或语句块,则画出一个小矩形 1405(称 为替代矩形)' 通 3±这个小矩形可以选中该对象, 并恢复正常显示,如果隐藏的对象是分支, 则画成一条虛线 1406。 隐難一鋼-, 直接或间接子雕同时隐藏。 该步骤具体包括:  The steps used to hide or display an image. For programs with more internal logic, its logical structure diagram will also be more complicated. In order to highlight the key points, it is easy to separate WfiiT, logical structure, or for JBiSff path, part of the logical structure diagram can be hidden. This example can be used to hide objects. When you draw a hidden 3⁄4] image, you can ignore it. You can also draw an alternative icon. Figure 14 is a diagram showing an illustration of a partially illustrated hidden object, as shown in Figure 14, if the hidden image is a branch tree or a statement block, a small rectangle 1405 (referred to as an alternative rectangle) is drawn. The small rectangle of 3± can select the object and resume normal display. If the hidden object is a branch, draw a dotted line 1406. Hidden difficulty a steel -, direct or indirect sub-carving while hiding. This step specifically includes:
各 增加一 录状态的字段, 该字段的取儲 "正常"和 "隐藏", 缺省值为 "正常"; 要隐藏某一 膽, 将它的状态设为 "隐藏", 并重画逻辑^ I图。 当计算分支树和駒:^[像的宽度和高度时, 检查它的 状态, 如果状态为 "隐藏", -则其宽度和高度为替 巨形的宽度 sio和高度 sii, 并且忽略子 。计算分支- 贿的宽度和高度时,检查它的状态,如果状态为 "隐藏",忽略子 视为空分 橡来计算宽度和高度。 画出 X像时,
Figure imgf000012_0002
如果状态为 "隐藏", 则只画一个割 巨形,忽略子像, 对于 分¾¾,如果状态为" β急藏",则只 ¾Λ口点和出口点之间画一条虚线,但分支 画出,忽略子 。
Each field that adds a record status, the field is "normal" and "hidden", the default value is "normal"; to hide a certain biliary, set its state to "hidden", and redraw the logic ^ I Figure. When calculating the branch tree and 驹:^[the width and height of the image, check its state, if the state is "hidden", then its width and height are the width sio and height sii of the giant shape, and the sub is ignored. Calculate the branch - the width and height of the bribe, check its state, if the state is "hidden", ignore the child as the empty rubber to calculate the width and height. When drawing an X image,
Figure imgf000012_0002
If the state is "hidden", then only one cut giant is drawn, and the subimage is ignored. For the division 3⁄43⁄4, if the state is "β 急存", then only a 3⁄4 Λ point and an exit point are drawn a dotted line, but the branch draws , ignore the child.
用于由逻辑 έ¾图生藤 Mm弋码的步骤, 该步骤具体包括: ·  The step for generating a vine Mm code by a logic ,3⁄4图, the step specifically includes:
从顶层分 橡开始, 递归扫描各 (橡, 针对駒 豫, 直接输出它对应的代码, 针对分 橡, 如 果是空分支则忽略, 否则«出分支判定和分支作用: W始微如 C++的 "{ "或 PASCAL的 "begin" ), 然后 扫描每 对象, 最后输出分支作用域结束 (如 C++的 "} "或 PASCAL的 "end" )。针对分支树对象, 如果 Starting from the top layer of the rubber, recursively scan each (acorn, for the hesitation, directly output its corresponding code, for the rubber, if it is an empty branch, then ignore, otherwise «out branch judgment and branch role: W first micro as C++" { "or "begin" of PASCAL), then scan each object, and finally output the end of the branch scope (such as C++ "}" or PASCAL "end"). For branch tree objects, if
^一实施例 »M的特殊分支树, 如 C++的 switch分支树, 则 ifeir出外围代码如 switch(- - -) i 始符如 "{", 再扫描各子職各分 , 最后输出作用域结束符如" } "; 如果不 殊分支树脉 直掛 3描 各子¾¾^¾。生成代码时可视需要添加衡 Τ , 另外, 各鋼有藤层次, 如顶层分 像的层次为 ο, 顶层分 ¾樣的直鮮 的层次为 1, m, 可以根据 «^欠计算代码缩进并加入空格, 以 ^A special branch tree of an embodiment»M, such as the sw itch branch tree of C++, then the peripheral code such as switch(- - -) i starts with "{", scans each sub-part, and finally outputs the function. The end of the field is like " } "; if there is no branching tree, it will be 3 straight lines 3⁄43⁄4^3⁄4. When generating the code, you can add the balance as needed. In addition, each steel has a vine level, such as the level of the top layer image is ο, and the top layer is 3⁄4. The straight level is 1, m, which can be indented according to the «^ under calculation code. And add a space to
习惯排版格式的代码。  Code that is used to typographical formatting.
另外, 部分图 可以作一些繊。如图 14麻, 可在顶层分 ¾X樣的左端加上禾醉入口图示 1401,其 宽度和高度为 S7, 右端加上出口图示 1402, 其直径为 S8。 设 示系日中将原点向右偏移 S7, 留出入口图示 的健。  In addition, some of the diagrams can be used for some tricks. As shown in Fig. 14, hemp can be added to the left end of the top layer, and the drunk entry icon 1401 is added, the width and height are S7, and the right end is shown by the outlet icon 1402, which has a diameter of S8. In the setting system, the origin is shifted to the right by S7, leaving the health of the entrance icon.
如图 14 j ¾,还可将分支树 的入口线¾¾矩形 1403,称为入口矩形,增加入口矩形使逻辑结构图的 构^ S清晰, 计算分支树 的宽度时, 力口上入口矩形的宽度 S9, 在计算^支的入口点坐标时也加上 巨 形 i ^的横坐标的偏移' 画出分支树 时, 将入口线画^ Λ口矩形。  As shown in Fig. 14 j 3⁄4, the branch line 3⁄43⁄4 rectangle 1403 of the branch tree may also be referred to as an entrance rectangle, and the entrance rectangle is added to make the structure of the logical structure clear. When calculating the width of the branch tree, the width of the entrance rectangle on the force port S9 In the calculation of the coordinates of the entry point of the ^ branch, the offset of the abscissa of the giant shape i ^ is also added. When the branch tree is drawn, the entry line is drawn as a rectangle.
如图 14所示, 当一^ i吾句块对"^寸应的代码含有返回语句, 还可将该语句块对象的图示画成如 140 所 示, 即在右端加一个直径为 S10的圆形, ¾¾¾¾也是»的一个出口。 如前一雄例腿, 本发明可用于设计禾醉逻辑 勾图 (例如用于详细设计), 也可用于根据已有的辧生 成逻辑结构图 (例如用于测嫩段)。本实施例根据已有的禾! ^生成逻辑绪构图,图 6所示的步骤8舰分支树 衞口 /或语句 依撅 Mm弋码 «。在本实施例, 步骤 B具体包括: 謹 弋码的逻辑结构, 髓 禾 码的分支结构生成对应的分支树 寸应的分¾¾, 依据禾 irn弋码的顺 结构生戯寸应的 i ^块 脉 并将所述分支树 X衞口腿詢:^豫嵌 «W应层次的分 ¾X橡中 进"^细描述如下: As shown in FIG. 14, when the code of the "I" block contains a return statement, the icon of the block object can be drawn as shown in FIG. 140, that is, a diameter of S10 is added at the right end. The round, 3⁄43⁄43⁄43⁄4 is also an exit for ». As in the previous male leg, the present invention can be used to design a drunk logic map (for example for detailed design), and can also be used to generate a logical structure map (for example for a tender section) from existing flaws. In this embodiment, a logic structure is generated according to the existing method, and the step 8 of the ship branch tree or the statement according to the Mm code «. In this embodiment, step B specifically includes: a logical structure of the code, the branch structure of the core code generates a corresponding branch tree size, and the i ^ block according to the structure of the heir code And the branch tree X Weikou leg inquiries: ^ Yu embedded «W should be level 3⁄4X rubber into the" ^ is described as follows:
首先, 将翻弋码分解为代码片。纖代码片是指以结构特赚确^ 5啲代码单位, 代码片类别有: 判定、膽号、 駒块, 着号又分为域开始和域结束。 判定是指含有判断 S¾S兆转 1¾¾似纖字、用于控制 其作用域内的 i詢执行或不执行的代码片, 例如 C++的 if (…; )、 dse ¾..·)、 else, while(...)、 switoh(...), caseN; Basic的 IF...、 ELSE IF...、 ELSE, DOWHILE〜。判定必须完整, 例如, C++的 if(...)是一个完整的判定, 不论 括号内的 多长, 都属于该判定的组成部分, 不能分拆。域符号是 ^判定的作用域的代码, 域开始紧 接着判定,用于指定判定的作用域的开始,域结束用于指定判定的作用域的结束,典型的域 ¾n c++的 "{ " 与 "}", PASCAL的 "begin" .与" end"; 语句: ^指对应于前文户 M的 jl醉 的代码序列, 其中不能含有 判定。位于某一代码片内的注释可忽略也可作为该代码片的 分, 位于代码片外的注释可忽略也可归于其 后的代码片。 图 1C是代码片分类示例, 如图 1C麻, 代码 111、 113、 11 对应的代码片为判定; 代码 112 和 117对应的代码片为 ¾ ^号,其中代码 112对应的代码片为 ¾始,代码 117对应的代码片为域结束;代码 114、 116、 118对应的代码片为语句块。 ―  First, break the translation code into pieces. The fiber code piece refers to the code unit of the structure, and the code piece categories are: judgment, daring number, 驹 block, and the number is divided into domain start and domain end. A decision is a piece of code that contains a judgment S3⁄4S megabyte, which is used to control the execution or non-execution of its query, such as C++ if (...; ), dse 3⁄4..·), else, while( ...), switoh(...), caseN; Basic IF..., ELSE IF..., ELSE, DOWHILE~. The decision must be complete. For example, C++'s if(...) is a complete decision, no matter how long it is in the parentheses, it is part of the decision and cannot be split. The domain symbol is the code of the scope of the decision, the domain begins with the decision, the start of the scope of the specified decision, and the end of the domain is used to specify the end of the scope of the decision. The typical domain 3⁄4n c++ "{" and "" }", "begin" and "end" of PASCAL; Statement: ^ refers to the code sequence of jl drunk corresponding to the former user M, which cannot contain the judgment. Comments that are within a code slice can be ignored or used as part of the code slice. Comments outside the code slice can be ignored or attributed to subsequent code slices. 1C is an example of code slice classification, as shown in FIG. 1C, the code slices corresponding to codes 111, 113, and 11 are determined; the code slices corresponding to codes 112 and 117 are 3⁄4^, and the code slice corresponding to code 112 is 3⁄4. The code slice corresponding to the code 117 is the end of the field; the code piece corresponding to the code 114, 116, and 118 is the statement block. ―
本雄例删包含代码内容、 'mi 附加数 U三个字段的麵结构来存储代码片, 代码片保 如链表 This male example deletes the code structure, the 'mi additional number U three fields of the face structure to store the code piece, the code piece guarantees such as the linked list
»组之类的 «容器中。 M rnt, 针对判定类代码片, 应判断是不是属 殊分支树, 及判断是不是 属于一个分支树的后续分支, 可丰離判定的关键字^提否属 ΐ 殊分支树, 如 C++代码的 switch »字; 后续分支也可離判定的关键字来辨识,如针对 C++代码,如果是 else关键字引出的判定或 elseif关键字引出 的判定, 则属于后续分支, 如果一个判定类代码片属 ^ 殊分支树 ffi续分支 (两者柯能并歹 !D, 则记录在附 加类别中。 »Groups like «In the container. M rnt, for the judgment class code piece, it should be judged whether it is a branch tree, and whether the judgment belongs to a subsequent branch of a branch tree, and the keyword that can be separated from the decision is a special branch tree, such as C++ code. Switch » word; subsequent branches can also be identified from the determined keywords, such as for C++ code, if it is the decision of the else keyword or the decision of the elseif keyword, it belongs to the subsequent branch, if a decision class code is ^ The branch tree ffi continues to branch (both Ke can and 歹! D, it is recorded in the additional category.
有时, ¾ff号是省略的' 如 M"+ "代码, 当作用域只有一条语句时, 珊号是可省略的, 再如, Basic 的 3F...THE ...结构中, ΊΉΕΝ后不衡亍, 其作用域为同一行的 ΊΉΕ 后的语句, ΊΉΕΝ是: I3始, 域结束省略; IF...THEN...END IF结构中, ΊΉΕΝ和 END IF是: 开始和域结束,而 IF...THEN...ELSE IR..THEN...ELSE...END IF结构中, ELSEIF之前省略了域结束, ELSE之前也省略了域结束。代码分解时, 每个判定之后应保证具有 匹配的聰始和域结束, 凡 ^省略的, 应补上相应的膽号, 其代码为空。  Sometimes, the 3⁄4ff number is omitted as 'M" + "code. When the scope has only one statement, the Shan number can be omitted. For example, in the Basic 3F...THE... structure, the balance is unbalanced.亍, the scope of the statement after the same line, ΊΉΕΝ is: I3 start, domain end omitted; IF...THEN...END IF structure, ΊΉΕΝ and END IF are: start and domain end, and IF ...THEN...ELSE IR..THEN...ELSE...END In the IF structure, the end of the field is omitted before ELSEIF, and the end of the field is omitted before ELSE. When the code is decomposed, it is guaranteed to have a matching start and end of the field after each decision. If ^ is omitted, the corresponding biliary code should be added, and the code is empty.
ϋ荦代码时还要考虑隐含分支, 当 IF结构缺少 ELSE分支, SWITCH结构缺少 DEFAULT分支时, 以及 视为分翅勾的循环结构, 均含有隐含分支。应为隐含分支加上三个代码片: 一个判定, 一个域开始, 一个 域结束, 它们的代码均为空。  The code also considers the implicit branch. When the IF structure lacks the ELSE branch, the SWITCH structure lacks the DEFAULT branch, and the loop structure that is considered to be a winged hook, it contains implicit branches. Three pieces of code should be added to the implicit branch: one decision, one field starts, one field ends, and their code is empty.
不同的编程语言, 代码分解依据的语法及关键字 不同, 具体 ¥过程可用编译技术中的词 析和 语細斤技术来实 实麵 MM預有技 在此不作详述 <=  Different programming languages, different syntax and keywords for code decomposition, the specific ¥ process can be used in the compilation of technical analysis and linguistic techniques to achieve real MM pre-technical skills are not detailed here <=
完成代删早后, 进一步樹弋码片 寸为 橡。 图 15是本实施例誠码片赠为结构劇勺流程示 意图, 如图 15所示, 1501是输入的父对象, 流程中所生成的分支树对 # ft^J:^¾¾ft¾TO (寸象中, 父 X舰能是分 椽。 1502是代码片队列, 賊码片按代码的本 醉, 用先进先出的队列储存, 称为代码 片队列。 后文戶 ¾的 "弹出代码片", 是指从代码片队列中取出最前的一个代码片, 并将该代码片从代码片队 列中删除; 后文所述 "代码片", 当未作限定时, 是¾¾新弹出的代码片; 后 述 "HA临时队列", 是指 ί弋码片保存到临时代码片队列的尾部。本雄例将图 15所示的流程编写为一 归调用的函数, 用参 ifc¾" 式传递 腳代码片队列, 初始调用时, 将步骤 A生成的顶层分 ¾(働为 5^m, 代码片 包^ ®ί 的所有代码片, 当处理一个分支时, 为了进一步处理分支体所对应的代码片, 将该分支作为: 5¾¾, 该分支 的分支体对应的代码片保 临时代码片队列中作为输入的代码片 进^¾归调用。  After the completion of the generation, the further tree is inch. FIG. 15 is a schematic diagram of the flow of the Chengji film as a structure script in the embodiment. As shown in FIG. 15, 1501 is the input parent object, and the branch tree generated in the flow is # ft^J:^3⁄43⁄4ft3⁄4TO (in the image, The parent X ship can be a branch. 1502 is a code slice queue, the thief chip is intoxicated by the code, and is stored in a first-in-first-out queue, called a code slice queue. The "pop-up code slice" of the latter user refers to The first piece of code is taken from the code slice queue, and the code piece is deleted from the code slice queue; the "code piece" described later, when not limited, is a new piece of code that pops up; The HA temporary queue means that the 弋 弋 保存 保存 保存 保存 保存 保存 保存 保存 保存 保存 保存 。 。 。 。 。 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 本 HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA HA When calling, the top layer generated by step A is divided into 3^4 (働5^m, all pieces of code package ^ ®ί, when processing a branch, in order to further process the code piece corresponding to the branch, the branch is taken as : 53⁄43⁄4, the branch of the branch The corresponding code slice is called as the input code slice in the temporary code slice queue.
步骤 1503判断代码片 是否为空, 如果为空则结束, 否则执 ^骤 1504, 步骤 1504弹出代码片, 在 步骤 1505判断该代码片的数 I」,如数 U为语句块,执 骤 1511 '如数 lj为判定,执行步骤 1521,如数 (J为 号, 由于此时不应该出现¾ 号' 执行步骤 1590, 步骤 1590报告! ^吴并退出。  Step 1503 determines whether the code slice is empty. If it is empty, it ends. Otherwise, step 1504 is executed. Step 1504 pops up the code slice. In step 1505, the number of the code slice is determined. If the number U is a statement block, step 1511 ' If the number lj is a decision, go to step 1521, such as the number (J is the number, because the 3⁄4 number should not appear at this time), perform step 1590, step 1590 reports! ^ Wu and exit.
步骤 1511生成一 吾句: ^豫' 并嵌 豫中, 本实施例在 橡时棚一个自动递增的 字符 »作为每一 句:^橡的名称, 如 V、 V、 V。步骤 1512保 弋码, 樹弋码片的代码内容拷贝 到¾ ^豫的代码字段中, 然后返回到步骤 1503处理下一代码片。 Step 1511 generates a sentence: ^yu' and embedded in the middle, this embodiment is an auto-incrementing character in the oak shed» as the name of each sentence: ^ rubber, such as V, V, V. Step 1512 security code, copy of the code content of the tree chip Go to the code field of 3⁄4^, and then return to step 1503 to process the next code slice.
步骤 1521生成分支树 ¾tm, 并«到 中, 在步骤 1522中根据代码片的附加类别判 «分支树是 否属刊寺殊分支树, 如果 殊分支树, 执 骤 1531, 否则执 »骤 1541。歩骤 1531保 瞧码, 将 代码片的代码内容拷贝到特殊分支树樣的外围代码字段。步骤 1532判断代码片队列是否为空, 如果为空则 执 4涉骤 1590报错并退出, 否贝軌 ίϊ« 1533弹出代码片, 并在步骤 1534判職代码片的数 1」, 如果類 J 为綱台, 则返回执»骤 1532 (忽 围代码的浙始, 步骤 1572忽略外围代码的域结菊, 如果数删 定则执 骤 1541, 如果类别不是 始也不是判定, 则执 骤 1590报错并退出。  Step 1521 generates a branch tree 3⁄4tm, and «to, in step 1522, according to the additional category of the code slice, the branch tree is a branch tree, if the branch tree, step 1531, otherwise step 1541. Step 1531 protects the code and copies the code content of the code slice to the peripheral code field of the special branch tree. Step 1532 determines whether the code slice queue is empty. If it is empty, then the terminal 1590 reports an error and exits, if no, the tracker ίϊ« 1533 pops up the code slice, and in step 1534, the number of the code slice is 1", if the class J is In the case of Gangtai, return to the operation of step 1532 (the beginning of the code is the beginning of the code, step 1572 ignores the domain of the peripheral code, if the number is deleted, then step 1541, if the category is not the beginning or the judgment, then step 1590 is reported and drop out.
步骤 1541生成一个分 豫, 步骤 1521生成的分支树雕中, 施例在生成分 橡时侧 —个自动递增的字^ «作为 «~个分 橡的名称, 如 'a'、 V、 V。步骤 1542保存分支判定, 槲弋码 片的代码内容拷贝到该分 樣的分支判定字段。步骤 1543判断代码片 是否为空, 如果为空则执行步骤 1590报错并退出,否则抛涉骤 1545弹出代码片,并在步骤 1546判 »¾代码片的类别,如果数 ij是 i¾T始, 贝 1」执 fi ^骤 1547, 否则执行步骤 1590报错并退出。步骤 1547 «—个用于判断¾ 号是否匹配的 »:^并 赋值为 到了一个 ¾5T始, 步骤 1551判断代码片队列是否为空, 如果为空贝 IJ执 骤 1590报错并退 出, 否则执涉骤 1552弹出代码片, 并在步骤 1553中判断该代码片的数 ij, 如果数 U是: ¾JF始, 则 N加 1, 如果是域结束, 则 N减 1, 然后判断 N的值是否为 0, 如果为 0, 表示对应的域结束已弹出, 实现了域匹配, 执 ^骤 1562, 否则在步骤 1554 | 弋码片压入临时队列, 并返回步骤 1551循环处理下一代码片。歩骤 1562 处理分支体代码, 将步骤 1541'生成的分¾¾作为 5i¾ , 临时队列作为代码片队列,进 «归调用, 然后 清空临时队列。  Step 1541 generates a split, in the branch tree sculpture generated in step 1521, the instance is in the form of an auto-incrementing word ^ as a name of the «~ rubber, such as 'a', V, V. Step 1542 saves the branch decision, and the code content of the weight chip is copied to the branch decision field of the sample. Step 1543 determines whether the code slice is empty. If it is empty, step 1590 is reported and exits. Otherwise, the code piece is popped up in step 1545, and in step 1546, the class of the code slice is determined. If the number ij is i3⁄4T, the shell 1 "Fix step 1547, otherwise step 1590 is reported and exits. Step 1547 «- is used to determine whether the 3⁄4 number matches »:^ and the value is assigned to a 3⁄45T. Step 1551 determines whether the code slice queue is empty. If it is empty, the IJ executes the error 1590 and exits. Otherwise, the execution is terminated. 1552 pops up the code slice, and determines the number ij of the code slice in step 1553. If the number U is: 3⁄4JF, then N is incremented by 1. If the domain is over, N is decremented by 1, and then it is judged whether the value of N is 0 or not. If it is 0, it indicates that the corresponding domain end has been popped up, domain matching is implemented, and step 1562 is performed. Otherwise, in step 1554, the chip is pushed into the temporary queue, and the process returns to step 1551 to process the next code slice. Step 1562 Process the branch code, use the split generated by step 1541' as 5i3⁄4, use the temporary queue as the code slice queue, enter the «call, and then clear the temporary queue.
步骤 1563判断队列是否为空, 如果为空则结束, 否则在步骤 1571弹出代码片, 并在步骤 1572判 代 码片的数 ij, 如果类别是域结束, 则返回执 4 骤 1571, 如果类别是判定, 贝 1J执行步骤 1573, 否则返回执行 步骤 1505处理后续的代码片直到结束。步骤 1573根据代码片的附属 1」判断该代码片是否属于上一分支的 后续分支,如是则执 骤 1541,否则 ¾当前的分支树已处理完毕,返回执 fi^骤 1505处理后续的代码片 直到结束。  Step 1563 determines whether the queue is empty. If it is empty, it ends. Otherwise, the code slice is popped up in step 1571, and the number ij of the code slice is judged in step 1572. If the category is the end of the domain, the process returns to step 1571, if the category is determined. Step 1573 executes step 1573, otherwise returns to step 1505 to process the subsequent code slice until the end. Step 1573 determines whether the code slice belongs to a subsequent branch of the previous branch according to the dependency 1" of the code slice, and if so, executes step 1541; otherwise, the current branch tree has been processed, and returns to the processing chip 1505 to process the subsequent code piece until End.
上面详细描述了图' 6 ¾¾勺步骤 B的另一种实施过程。 本«例从Mlift码生 «辑 图, 可用于在 编写代码时裸艘辑结构图与代码的同步, 也可用于在测试时生戯 码逻辑结构图。 下面详细描述用于统计 »路径的实施例, 本实脏前述雄例的基础上, 包括一个用于统 醉路径 的步骤。统计路径时也可以不画出赫的逻辑结构图, 即可以省略计算各结构 的尺寸及^ Ϊ并画出其图 示的步骤。 ·  Another implementation of the step B of Fig. 6 3⁄4⁄4 is described in detail above. This example uses the Mlift code to generate a picture, which can be used to synchronize the structure of the bare ship with the code when writing the code. It can also be used to generate the logic structure chart during the test. The embodiment for the statistic » path is described in detail below, and based on the above-mentioned masculine case, includes a step for immersing the path. When the statistical path is used, the logical structure diagram of Hertz may not be drawn, that is, the steps of calculating the size and structure of each structure and drawing the illustration may be omitted. ·
路径是 的执行路线, 本錢例艇的路歸舌: 駒组合和域分魏合, 滅是说, 用駒组合 和 /或分支组合来描 径, 一膽况下, 用语句组^ *识别路径, 分支组合可用于统计路径所 的分支。 语句组合是指路径所执行的 i ^块的序列, 由语句块名按路径的执行 组成; 分支组合是指路径所经历的 分支的序列, 由分支名按路径的经历 j i^组成; ¾就是说, 语句组 ^己 行的语句, 分支组^己录路 径经历的分支。我们把路径的语句组合中的语句称为路径的执行语句, »径的分支组合中的分支称为路径 的经历分支。 另外, 由于统计路径的需要, 路径还分为两类: 正常和返回, 数 U为返回的路 过了一 有返回语句的语句块, 因此提前结束; 类别为正常的路径在 »结束时结束。统计路径时, 路径的缺省类别 为正常, 当一条路 有返回语句的语句块时, 将该路径的類设为返回, 该路径即结束。  The path is the execution route, and the cost of the boat is the same: 驹Combination and domain division are combined, and the elimination is said to use 驹 combination and/or branch combination to trace the path. The branch combination can be used to count the branches of the path. The statement combination refers to the sequence of the i ^ block executed by the path, which consists of the statement block name according to the execution of the path; the branch combination refers to the sequence of the branch experienced by the path, which is composed of the branch name according to the path experience; 3⁄4 means , the statement group ^ own line of the statement, the branch group ^ recorded path experienced branch. We refer to the statement in the statement combination of the path as the execution statement of the path, and the branch in the branch combination of the path is called the experienced branch of the path. In addition, due to the need of statistical paths, the path is divided into two categories: normal and return, the number U is the return of a statement block with a return statement, so it ends early; the normal path is terminated at the end of ». When the path is counted, the default class of the path is normal. When a block has a statement block that returns a statement, the class of the path is set to return, and the path ends.
统 ii ^路径的步骤具体包括: 后 述结构 X橡, 针对每一 将一 入路径集作为初始数 据进行路径统计 顶层分 象的输入路径 *K含一 路径; 针对语句则象, 在输入路径集的每条路径 中记录该语句块名; 针对分 ¾¾ , 在输入路径集的每条路径中记录该分支名, 前^ 的输出路@*作 为下一子 的输 Λ¾径集; 针对分支树 将输 AS 集的拷贝作为每"^ 象的输 Λ¾径集。下面描 ¾±述步骤中递归计算各结构雕时统计路径的详细步骤:  The steps of the path ii ^ specifically include: the structure X rubber described later, for each input path set as the initial data, the input path of the path statistics top-level image division *K contains a path; for the statement image, in the input path set The name of the statement block is recorded in each path; for each point, the branch name is recorded in each path of the input path set, the output path of the previous ^@ is used as the output of the next child; for the branch tree The copy of the AS set is used as the set of transmissions for each image. The following describes the detailed steps of recursively calculating the statistical path of each structure during the steps:
图 16是本实施例统计 路径的流程示意图,其中,图 16A是当樣为语句块时统计路径的流禾 意图, 图 16B是当豫为分支时统计路径的流程示意图, 图 16C是当樣为分支树时统计路径的流程示意图。  16 is a schematic flow chart of the statistical path in the embodiment, wherein FIG. 16A is a flow chart of the statistical path when the sample block is a sample block, and FIG. 16B is a flow chart of the statistical path when the branch is a branch, and FIG. 16C is a flow chart. Schematic diagram of the statistical path of a branch tree.
图 16A是当 ¾¾为语句块时统计路径的流程示意图。如图 16A麻, 步骤 1603扫描路径集, 即扫描 f俞 入路径集 1601, 针 每一条路径, 在步骤 160 判断它的 IJ, 如果类别为返回, 贝腿回到步骤 1603处理下 一条路径, 否则在步骤 1605判赚詢 豫的代码是否含有返回语句, 如果是, WMs 1606将路径 的¾¾1」设为返回? 骤 1607, 否则直 g¾行步骤 1607, 步骤 1607记¾¾ ^名, 即在路径的 组合的 最后添加该駒块名。所有路径处理完 即得到输出路径集 1602, 输出路據中的路径的数量与输 Λ£各径 集一致 D Fig. 16A is a flow chart showing the statistical path when the block is a statement block. As shown in Fig. 16A, step 1603 scans the path set, that is, scans the f-in path set 1601, and each path is determined. In step 160, its IJ is judged. If the category is returned, the leg returns to step 1603. A path, otherwise, in step 1605, the code that earned the query contains a return statement. If so, WMs 1606 sets the path of the 3⁄43⁄41" to return? Step 1607, otherwise, the straight g3⁄4 line is step 1607, and the step 1607 is recorded as the name of the block, that is, the block name is added at the end of the combination of the paths. After all the paths are processed, the output path set 1602 is obtained, and the number of paths in the output path is consistent with the input path set D.
图 16B是当 (橡为分支时统计路径的流程示意图。 当橡为分支时, 依次计算 橡的子 X橡, Itr—? ^计算后的输出路径集' 作为下"^橡的输 各径集, 所有子 ¾m计算完毕, 子豫的输出路 径 Λ就是该分 ¾像的输出路 «。如图 16B所示, 步骤 1611记录分支, ¾SrA^径集的每条路径的分支 组合的最后添加该分支名。步骤 1612扫描 如果完毕或没有子雕则结束, 否则执行步骤 1613。 步骤 1613判 »¾子(像是不是语句块, 如果是则执 骤 1614, 否则执 骤 1615, 步骤 1614递归执行图 16A所示的计算,并将计算后的路径集作为下 據的输入路径集;步骤 1615递归执行图 16C所示的计算, 并将输出的路径集作为下 像的输 λ¾径集。步骤 1614和步骤 1615执行后均返回到步骤 1612处理下一 子 X橡直到结束。 '  Fig. 16B is a flow chart of the statistical path when the rubber is a branch. When the rubber is a branch, the rubber X rubber is calculated in turn, and the Itr-? ^ calculated output path set is taken as the lower After all the sub-3m4 are calculated, the output path of the sub-sum is the output path of the sub-picture. As shown in Fig. 16B, step 1611 records the branch, and the branch of each path of the 3⁄4SrA path set is added to the branch at the end. Step 1612 If the scan is completed or there is no sub-carving, then step 1613 is performed. Step 1613 is to determine the 3⁄4 sub-segment (if it is not a statement block, if yes, then step 1614, otherwise step 1615, step 1614 recursively perform Figure 16A The calculations shown, and the calculated set of paths as the set of input paths for the underlying data; step 1615 recursively performs the calculation shown in Figure 16C, and the resulting set of paths is used as the set of input λ3⁄4 paths for the lower image. Step 1614 and steps After execution of 1615, both return to step 1612 to process the next sub-X rubber until the end.
图 16C是当 X嫁为分支树时统计路径的流程示意图。如图 16C所示,步骤 1623剔 回路径:将输 ΛϋΙ 径集 1621中数 IJ为返回的路径拷贝到输出路機 1622中, 并从输 AS各径集 1621删除。步骤 1624扫描子对 (分 ,微一个分支后, 步骤 1625将输入路径射考贝一份作为该分支的输 Λ¾径集。步骤 1626针对该分 归执行图 16B所示的计算, 然后返回到步骤 1624处理下 H 所有分支计算完 , 步骤 1627将各 分支的输出路 总到針分支树翁的输出路健 1622中, 计算结束。  Figure 16C is a flow chart showing the statistical path when X is married as a branch tree. As shown in Fig. 16C, in step 1623, the path is deleted: the path IJ of the input path set 1621 is copied to the output path 1622, and deleted from the AS path set 1621. Step 1624 scans the sub-pairs (divided, after a branch is broken, step 1625 takes the input path as a set of input paths for the branch. Step 1626 performs the calculation shown in FIG. 16B for the part, and then returns to the step. After 1624 processing, all branches are calculated. In step 1627, the output path of each branch is totaled in the output path 1622 of the pin branch tree, and the calculation ends.
层分¾¾^的输入路 只含一个空路径, 所述空路径是撒吾句组合和分 且合均为空的路径; 顶层 分 儀输出路鶴就是辦的路径集。 路径集中的每条路径, 均记录了该路径所执行的语句:^像序列 和该路娜圣历的分¾¾ ^序列。  The input path of the layer 3⁄43⁄4^ contains only one empty path, which is the path of the combination of the sentence and the division and the combination of the paths; the top-level output router is the set of paths. Each path in the path set records the statement executed by the path: the sequence of the image and the sequence of the Luna calendar.
图 17题辑 图示出辦路径的示意图。如图 17A所示的逻辑 图,有 3条路径,其语句组合分别 是: ac、 bc、 c; 如图 .17B所示的逻辑结构图,有 6条路径, 其语句组合分别是: adc、 bdc、 dc、 aec、 bec、 ec; 如图 17C所示的逻辑 图,有 8条路径, 其语句组合分别是: adc、 bdc、 fdc、 gdc、 aec、 bee. fee. gec。 Figure 17 is a schematic diagram showing the path of the process. As shown in the logic diagram of FIG. 17A, there are three paths, and the combination of sentences is: ac, bc, c; as shown in the logical structure diagram shown in FIG. 17B, there are six paths, and the combination of sentences is: adc, Bdc, dc, aec, bec, ec ; as shown in the logic diagram of Figure 17C, there are 8 paths whose statement combinations are: adc, bdc, fdc, g dc, aec, bee. fee. gec.
当»较复杂时, 路径的数量会很庞大, 要设计测 i畑例覆盖所有路径是不现实的。可以将一¾ 定的 代码所对应的对象隐藏, 统计路径时, 忽略隐藏的 及其直接或间接子 ¾ , 以EEE缩路径的数量。如果 画出了逻辑结构图, 可以由用户选择要隐藏的对象, 否则可以隐藏 深的对象。  When » is more complicated, the number of paths will be very large, and it is unrealistic to design a test to cover all paths. You can hide the object corresponding to a 3⁄4 code, and when traversing the path, ignore the hidden and its direct or indirect sub- 3⁄4, and reduce the number of paths by EEE. If you draw a logical structure diagram, you can select the object to hide by the user, otherwise you can hide the deep object.
本实例还包括画出 ®ί路径图示的步骤, 一次画出一条 路径的图示, 该步骤具体包括:  The example also includes the steps of drawing a path of the ® ί, drawing an illustration of a path at a time, the steps specifically including:
画出路径经过各分支¼¾1¾时的图示。扫描路径所经历的的分支, 针对每一分支,如果该分支有父对象, 贝! 是分支树 , 本实施例用力口粗的线段连接 的入口点和该分支的入口点, '及 ^像的出口点 与该分支的出口点。 '  Draw a diagram of the path as it passes through each branch. The branch that the scan path is going through, for each branch, if the branch has a parent object, the shell! is a branch tree, and the entry point of the branch line connecting the thick line of the embodiment and the entry point of the branch, 'and ^ The exit point and the exit point of the branch. '
画出路径经过各分 时的图示。 扫描路径所经历的的分支, 针 每一分支, 本实施例用加粗的线段 连接该分 橡的入口点、 各子 X橡、 出口点, 即连接入口点与第一子 的入口点, 第 ~T豫的出口点- 与第二子对象的入口点, ……, 最末子对象的出口点与该分支的出口点。  Draw a path through the various time-sharing diagrams. The branch that the scan path is going through, each branch of the needle, in this embodiment, the entry point of the sub-rubber, the sub-X rubber, and the exit point are connected by a thick line segment, that is, the entry point of the connection entry point and the first sub-point, ~T Henan exit point - the entry point of the second child object, ..., the exit point of the last child object and the exit point of the branch.
画出路径经过各语句:^像 Β寸的图示。 扫描路径所经历的的 , 针对每 ~Η吾句块, 本¾¾例用斜线填 充駒 豫的范围矩形 ¾ ^ ¾i了该駒块。  Draw the path through each statement: ^ like the icon of the inch. The scan path is experienced, for each block, the 3⁄4⁄4 case is filled with a slash to fill the radius of the rectangle 3⁄4 ^ 3⁄4i the block.
. 图 17A和图 17B示出了本实施例画出一条辦路径的 其中, 图 17A示出了路径 be, 图 17B示出 了路径 ec。 各实施例可看出, 本发明提出的»逻辑结构图示方法, 可快舰 细设计, 可在禾 弋码与 逻辑结构图之间双向转换' 可用以统计和示出程序路径。本发明提出的程序路径统计方法, 可自动统计禾 U亨 路径并画出路径的图示。 上述各实施例仅是本发明的较佳实 »式, 仅用以说明发本明而非限制, 对本发明进行修改、 变形或者 等同替换而不脱离本发明的精祌和范围, 均应涵盖于本发明的范围之内。  17A and 17B show the present embodiment in which a path is drawn, Fig. 17A shows the path be, and Fig. 17B shows the path ec. It can be seen from various embodiments that the method of the logical structure diagram proposed by the present invention can be designed in a fast ship, and can be bidirectionally converted between the code and the logical structure diagram, which can be used to count and show the program path. The program path statistical method proposed by the present invention can automatically count the Heheng path and draw a schematic diagram of the path. The above-mentioned embodiments are merely preferred embodiments of the present invention, and are intended to be illustrative, and not restrictive, and modifications, variations, or equivalents may It is within the scope of the invention.

Claims

权 利 要 求 书 Claim
1.一种 »逻辑结构图示方法 簾正在于, 包繊骤: 1. A way to illustrate the logical structure. The curtain is in the process, including:
A.生成" 顶层分 豫;  A. Generate "top layer resolution;
B.在任意层次的分 橡中嵌套分支树擦口 I或语句^ m; B. Nesting branch tree wipes I or statements ^ m in any level of oak ;
C.计算 各樣的尺寸及 44¾并画出其图示。  C. Calculate the various sizes and 443⁄4 and draw the illustration.
2.根据权利要求 1繊舊逻辑结构图示方法,其特征在于,将»逻辑鋼分为辦结构和分支结构; 所述 橡用于描删序结构, 所述分支树翻于描述分支结构, 所述分 棚于描述顶层分支或 分支结构的一个分支; 每一戶满分支树膽至少嵌套了两个分 橡。  2. The method according to claim 1, wherein the logical steel is divided into an office structure and a branch structure; the rubber is used to describe the sequence structure, and the branch tree is turned over to describe the branch structure. The sub-segment is a branch describing the top branch or branch structure; each household has at least two sub-insoles nested in the full branch.
3.根据权利要求 1戶/¾的©^逻辑结构图示方法,其特征在于,戶 ¾β包括:被嵌套的 的范围至少 在一个方向上 它的¾¾的范围之内。  3. The method of claim 1, wherein the household includes: the range of being nested within at least one of its ranges of 3⁄4⁄4.
4.根据权利要求 1戶 的 gff逻 构图示方法, 征在于,用细化的分支树¾#描述不同的分支结构。 4. A method of gff logical representation of a household according to claim 1, wherein the different branch structures are described by a refined branch tree.
5.漏又利要求 1纖的辦逻辑结构图示方法,其特征在于,繊步骤 B鹏分支树雕和 /或駒块 由用户指定。 5. Leakage and profit requirement 1 fiber's logical structure diagram method, which is characterized in that the step B branch tree carving and / or block is specified by the user.
6.漏又利要求 5腿的 逻辑结构图示方法, 其特征在于, β難分支树谢 Π/或駒: ^橡的 分 ¾m由用户t定。  6. Leakage and profitability The 5-legged logical structure diagram method is characterized in that the β-difficult branch tree Xie/or 驹: ^The rubber's 3⁄4m is determined by the user t.
7·根据权利要求 1腿的薪逻辑结构图示方法,其特征在于,繊步骤 B腿分支树御 /或语句块 刘豫依据翻码生成。  7. The salary logic structure diagram method according to claim 1, wherein the step B leg branch tree/or the statement block is generated according to the code.
8·根据权利要求 7所述的 逻辑结构图示方法,蕭正在于,所述步骤 B具体包括:解 ilfgJW侧勺逻 辑结构 7 依据翻弋码的分支结构 寸应的分支树膽 ¾寸应的分 像 依据禾 弋码的磨结构生成 对应的駒块 5(像 并将戶 分支树衡口膨詢 橡嵌釺对应翻勺分 (像中。  8. The logic structure diagram method according to claim 7, wherein the step B specifically comprises: solving the ilfgJW side spoon logic structure 7 according to the branch structure of the translation code, the branch tree should be 3⁄4 inch The image is generated according to the grinding structure of the Wo's code, and the corresponding block 5 is generated (such as the image of the branch of the tree branch).
9.根据权利要求 1至 8 ^权利要求織的醇逻辑^ 图示方法,其特征在于,舰各 的尺寸包括: 各潘的宽度和高度。  9. An alcohol logic method according to any of claims 1 to 8 wherein the dimensions of the ship comprise: width and height of each pan.
10.根据权利要求 9戶¾&的 gff逻辑^ I图示方法, ¾ 征在于, mc ^M:  10. According to the method of 9 households, the gff logic ^ I diagram method, 3⁄4 is in, mc ^M:
ci.从顶层分穷樣开始, 针对每一 X嫁, 归计算各子 的宽度禾 π高度, 再根据子 的宽度和高 度计算 的宽度和高度, ^^包括: +  Ci. Starting from the top level, for each X marry, calculate the width of each sub and the height and height calculated according to the width and height of the sub, ^^ include:
依下述公式计算语句 橡的宽度和高度: .  Calculate the width and height of the statement rubber according to the following formula:
. 宽度 =S1; Width = S1 ;
高度 =S2; Height = S2 ;
其中, S1为 ± 像的宽度, S2为 i詢 像的高度;  Where S1 is the width of the image and S2 is the height of the i-question;
依下述公式计算分 橡的宽度和高度:  Calculate the width and height of the rubber according to the following formula:
宽度 =S1 + 2*S6 (N-0);  Width = S1 + 2*S6 (N-0);
宽度 =∑W + ( +1)*S6 (N>0);  Width =∑W + ( +1)*S6 (N>0);
高度 =S3 + S4 (N=0);  Height = S3 + S4 (N = 0);
高度 =Hm + S3 + S4 (N>0);  Height = Hm + S3 + S4 (N>0);
其中, ' N为该分 ¾橡的子 S豫数量, S1为駒 橡的宽度, S6为左 ¾ ^向连接的两个 间的距 离, ∑W为所有子对象的宽度之和, S3为分支 注的高度, S4为分支 主与分支的距离, Hm为高度最大的 子 X像的高度;  Where 'N is the number of sub-Shes of the 3⁄4 rubber, S1 is the width of the 驹 rubber, S6 is the distance between the left 3⁄4^ to the connection, ∑W is the sum of the widths of all the sub-objects, and S3 is the branch The height of the note, S4 is the distance between the branch main and the branch, and Hm is the height of the child X image with the highest height;
依下述公式计算分支树膽的麵口高度:  Calculate the face height of the branch tree bile according to the following formula:
宽度 =Wm;  Width = Wm;
高度 =∑H + (N-1) * S5;  Height = ∑H + (N-1) * S5;
其中, Wm为最宽子 X橡的宽度, ΣΗ为所有子对象的高度之和, N为子 (橡数量, S5为两条分支之间 的距离。  Where Wm is the width of the widest sub-X rubber, ΣΗ is the sum of the heights of all sub-objects, N is the sub-number (the number of rubbers, and S5 is the distance between the two branches).
11.漏又利要求 10繊勺禾游逻辑绪构图示方法, 其特征在于, 所述各雕的尺寸进 ~ ^包括 ·· 支 树 X漏入口线高度。  11. Leakage and profit requirement 10 繊 禾 逻辑 逻辑 逻辑 图示 图示 , , , 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 图示 图示 X X X
12.根据权利要求 11所述的 »逻辑^)图示方法' 其特征在于, 繊步骤 C1进一步包括: 计算各翁的雄高度; 12. The method of the present invention as claimed in claim 11, wherein the step C1 further comprises: Calculate the male height of each Weng;
依下述公式计算分支树舰入口线高度:  Calculate the branch line height of the branch tree according to the following formula:
入口线高度 =Βι + (Ηη- Βη) + Σ(Η2..Ήη-ι) + (N-1)*S5;  Entrance line height = Βι + (Ηη- Βη) + Σ(Η2..Ήη-ι) + (N-1)*S5;
其中, Bl为第一子对象雄高度, Hn为最末子对象高度, Bn为最末子对象底座高度, Σ(Η2···Ηα-ι)为 除第 D^ l**子 X像以外的其他子 的高度之和, N为子 S5为两^ 5¾间的 J?巨离。  Where Bl is the height of the first sub-object, Hn is the height of the last sub-object, Bn is the height of the base of the last sub-object, and Σ(Η2···Ηα-ι) is other than the X image of the D^l** The sum of the heights of the children, N is the sub-S5 is the J? giant distance between the two ^ 53⁄4.
13.根据权利要求 12戶 ¾的@ ^逻辑 图示方法, 其樹正在于, 所述 i十算各 ¾m的] 高度具体包括: 从顶层分¾ (橡开始, 针对每一 先递归计算各子 X橡的底座高度 7 再根据各子糊猶高度计算该 X橡的鰱高度, 进"^包括: . 13. The method according to claim 12, wherein the tree is in the height of the 3⁄4m of the i-th to include: from the top layer 3⁄4 (starting with the oak, calculating each child for each recursion first) The base height of the X rubber is 7 and the height of the X rubber is calculated according to the height of each sub-paste.
依下述公式计算 橡的赫高度:  Calculate the height of the rubber according to the following formula:
鵷高度 = S22; 鹓 height = S22 ;
其中 S2为语句 的高度;  Where S2 is the height of the statement;
依下述公式计算分 S«的藤高度:  Calculate the height of the vine of the S« according to the following formula:
雄高度 = 0 (N=0); Male height = 0 (N = 0) ;
雄高度 = Bm ( >0);  Male height = Bm ( >0);
其中, N为子像数量, Bm为 高度最大的子对象的 高度;  Where N is the number of sub-images and Bm is the height of the sub-object with the highest height;
依下述公式计算分支树雕的離高度: ·  Calculate the height of the branch tree carving according to the following formula:
赫高度 = [Βΐ + (Ηη- Βη) + Σ(Η2...Ηη-ι) + (N-1)*S5] /2 + Bn; Hertz height = [Βΐ + (Ηη- Βη) + Σ(Η2...Ηη-ι) + (N-1)*S5] /2 + Bn ;
其中, Bl为第^ (橡雄高度, Hn为 ft*子対象高度, Bn为 **子3橡鐘高度, Σ(Η2··.Ηη-ι)为 除第 ~^¾^¾**子¾ 以外的其他子 的高度之和, Ν为子 X像 |¾, S5为两 支之间的]?巨离。  Among them, Bl is the second (the height of the oak, Hn is the height of the ft*, the height of the Bn is the height of the rubber ring of the **3, and the Σ(Η2··.Ηη-ι) is the division of the ^^3⁄4^3⁄4** The sum of the heights of the children other than 3⁄4, Ν is the child X image | 3⁄4, S5 is the large distance between the two.
14.根据权利要求 1至 8 ΐΕΗ¾利要求戶 的 »逻辑^ I图示方法, 其特征在于, 戶 ¾各 的 ¾«包 括: 各 X樣的入口点坐标。  14. The method according to claims 1 to 8 要求 ⁄ 要求 要求 户 户 户 户 户 , , , , , , , , 逻辑 逻辑 逻辑 逻辑 逻辑 逻辑 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示 图示
15.根据权利要求 14繊的»逻辑 图示方法, 蕭正在于, 継步骤 C包職骤:  15. The logic diagram method according to claim 14,, Xiao is in, 継Step C:
C2.从顶层分 ¾橡开始' 针对 橡, 先计算 橡的入口点坐标, -再根据 的健递归计算各 子 X像的入口点坐标, 包括: .  C2. Starting from the top 3⁄4 rubber, 'for the oak, first calculate the entrance point coordinates of the rubber, and then calculate the entry point coordinates of each X image according to the recursion, including:
依下述公式计 分 猶入口点坐标: ' '  According to the following formula, the coordinates of the entrance point are: ' '
X=0;  X=0;
Y=H - B;  Y=H - B;
其中, X为入口点横坐标, 向右为正, Y为入口点 标, 向下为正, H为) (像高度, B为)豫鍵高度; 依下述公式计算分¾¾#的第 N 橡的入口点坐标:  Where X is the abscissa of the entry point, positive to the right, Y is the entry point mark, the direction is positive to the down, H is) (like the height, B is the height of the key); the Nth of the 3⁄43⁄4# is calculated according to the following formula Oak entry point coordinates:
Xn= ∑(Wi...Wn-i) + N*S6; 其中, 为从1开始的子¾^1 号,¾1为鶴^^ ^¾椽的入口点的横坐标,向右为正,∑(Wi...Wn-i) 为 ¾m N ^¾ ^前的子 ^的宽度之和, S6为左 向连接的两个 ¾ ^间的距离, Υη为戶 ¾第 Ν个 子像的入口点的 1½标, 向下为正, 为分 入口点 标; Xn= ∑(Wi...Wn-i) + N*S6 ; where, for the child 3⁄4^1 starting from 1, 3⁄41 is the abscissa of the entry point of the crane ^^ ^3⁄4椽, positive to the right, ∑(Wi...Wn-i) is the sum of the widths of the children before 3⁄4m N ^3⁄4 ^ , S6 is the distance between the two 3⁄4 ^ of the left connection, and Υη is the entry point of the third image of the household 3⁄4 The 11⁄2 mark, down to positive, is the sub-entry mark;
依下述公式计算分支树?!橡的第 N 橡的入口点坐标:  Calculate the branch point of the branch tree by the following formula?!
Xn = ¾  Xn = 3⁄4
Υη = Υι - E/2 ( =l);  Υη = Υι - E/2 ( =l);
Υη = Υη-ι + Βη-ι + Ηη - Bn + S5 ( >1);  Υη = Υη-ι + Βη-ι + Ηη - Bn + S5 ( >1);
其中, N为从 1开始的子 赃号, ¾1为¾^ ^[ 象的入口点的横坐标, 向右为正, Xi为该分 支树对象入口点横坐标, Υιι为该第 Ν ·^ΡΧ 的入口点的纵坐标, 向下为正, Yn-i为前一子对象入口点纵坐 标, Bn-i为前 的] ¾j¾高度, Hn为雜 N (橡的高度, Bn为織 N ^像的離高度, S5 为两 ^^支之间的距离。  Where N is the sub-nickname starting from 1, 3⁄41 is the abscissa of the entry point of the image, the right is positive, Xi is the abscissa of the entry point of the branch tree object, Υιι is the first Ν ·^ΡΧ The ordinate of the entry point, down is positive, Yn-i is the ordinate of the entry point of the previous sub-object, Bn-i is the front] 3⁄4j3⁄4 height, Hn is the impurity N (the height of the oak, Bn is the woven N ^ image From the height, S5 is the distance between the two ^^ branches.
16.根据权利要求 1至 S i-权利要求所述的»逻辑 图示方法, 其特征在于, 戶满分支树 的图 示包括: 入口线和出口线。  16. The logic diagram method of claim 1 to S i-claim, wherein the representation of the full branch tree comprises: an entry line and an exit line.
17.根据权利要求 1至 8任一权利要求戶 ¾Ε的 @ί逻辑结构图示方法, 其特征在于, «分¾ ^的图示 包括: 执涵。 17. The @ί logical structure diagram method according to any one of claims 1 to 8, wherein the graphical representation of the word "comprising" includes: stipulation.
18.根据权利要求 17戶 ¾的辦逻辑^ I图示方法, ¾ 征在于,戶;¾分 橡的图 包括: 分支 标注 018. The method according to claim 17, wherein the figure is: the household; the map of the rubber includes: branch mark 0
19.根据权利要求 18 ¾的 图示方法, »征在于,戶;¾分 像的图 包括: 分支 主的文字。  19. The illustrated method according to claim 18, wherein the graph of the household image is included: the main text of the branch.
20.根据权利要求 1至 8任一权利要求戶; ¾β勺薪逻辑^ )图示方法, 其特征在于, 戶; ^的图 示包括: 范围矩形。 …―.  20. The method according to any one of claims 1 to 8; wherein the graphical representation of the household; ^ comprises: a range rectangle. ...―.
21; ^据权利要求 1至 S任一权利要求戶 ¾的辦逻辑结构图示方法,其特征在于,戶 Μ步骤 C包括步骤: 21; The method for graphically illustrating the logical structure of any of claims 1 to S, wherein the household step C comprises the steps of:
C3.从顶层分¾ (豫开始, 针对每一刘象 先画出 ¾Χ像的图示, 再递归画出各子像的图示。 C3. From the top level, 3⁄4 (starting with Henan, first draw a 3⁄4 image for each Liu Xiang, and then recursively draw a picture of each sub-image.
22.根据权利要求 21腿的餅逻辑雖图示方法, 難征在于, 所述步骤 C3进一步包括: 忽略隐藏的 y mm ., 只画出 ^图示。  22. The method of the cake logic according to claim 21, wherein the step C3 further comprises: ignoring the hidden y mm .
23裉据权利要求 1至 8 ^ ¾利要求 ifM的禾鮮逻辑 图示方法, 其特征在于, 进"^包括: 用于在 分支树赚中添加分支的步骤。  23 According to the claims 1 to 8 ^ 3⁄4, ifM's logic logic diagram method, characterized in that: "^ includes: a step for adding a branch in the branch tree earning.
24根据权利要求 1至 8 ^~权利要求所述的禾 逻辑 ^图示方法, 其特征在于, 进~ 包括: 用于在 分支树 中删除选定分支的步骤。  A method according to any one of claims 1 to 8 to claim wherein the method comprises the steps of: deleting the selected branch in the branch tree.
25.根据权利要求 1至 8任一权利要 逻辑绪构图示方法, 其樹正在于, 进一步包括: 用于修. 改分支判定的步骤。  25. A method according to any one of claims 1 to 8, wherein the tree is in progress, further comprising: a step of modifying the branch decision.
26.根据权利要求 1至 8任一权利要求所述的»逻辑^ I图示方法, 其樹正在于' 进一步包括: 用于编 Si詢:^橡的代码的步骤。  26. The method of logic according to any of claims 1 to 8, the tree being in the step of: further comprising: a step of coding the code of the rubber.
27.根据权利要求 1至 8任一权利要求所述的程序逻辑结构图示方法,其特征在于, 进一步包括: 用于隐 藏纖口 /或显示悲的步 ¾  The method for illustrating a logic structure of a program according to any one of claims 1 to 8, further comprising: a step for hiding a port and/or displaying a sadness.
28.根据权利要求 1至 权利要救;¾的»逻辑 图示方法, 其街正在于, 进一步包括: 用于由 逻辑结构图生戯 弋码的步骤。 "  28. The method of claim 1 to claim 3, wherein the logic is illustrated by the method, and the method is further comprising: a step for generating a weight from the logical structure diagram. "
 •
29.—种 权利要求 1 ^¾的 ^逻辑结构图示方法统计 ^路径的方法, 其特征在于, 用统ffif 路 径的步骤代 ^骤 C。 ' 29. A claim 1 ^3⁄4 ^ logical structure diagram method method ^ path method, characterized by the step of using the system ffif path to step C. '
- .  - .
30.根据权利要求 29所述的统计游路径的方法, 其樹正在于, dm ^: 组合和 /或分支 组合。 -30. A method of statistically traveling a path according to claim 29, the tree being in, dm^: combination and/or branch combination. -
31.根据权利要求 29臓的统计薪路径的方法,其特征在于'所述统 路径的步骤包括: 后飾描 所述各脉 针对每一聰 将一^ ir入路径集作为初始 行路径统计, 顶层分¾«的输 Λ¾径集只 含一終路径。 31. A method of statistically paying a payroll path according to claim 29, wherein the step of: said step of arranging comprises: rearranging said pulses for each of said sin-in path sets as initial line path statistics, The top layer of the 3⁄4« set contains only one final path.
32.根据权利要求 31戶 ¾的统 路径的方法,其特征在于, «统计 ®ί路径的步 包括:针 对语句: fe¾ ^, ¾¾Λδ各径集的每条路径中记录该语句块名; 针对分 S¾) , 前 的输出路径集作为 下^橡的输 径集; 针对分支树脉 将输入路径集的拷贝作为每"^橡的输入路径集。  32. The method of claim 31, wherein the step of «statistics® ί path comprises: recording the block name of each statement for each path of the statement: fe3⁄4^, 3⁄43⁄4Λδ; S3⁄4), the front output path set is used as the lower path set of the rubber; for the branch tree pulse, the copy of the input path set is used as the input path set of each "^".
33.根据权利要求 32艇的统计辦路径的方法,其擀正在于'鸸统计禾醉路径的步爾一步包括:针 对分 ¾Χ橡, 纖入路纏的每条路径中记录该分支名。  33. The method of claim 32, wherein the step of calculating the path of the boat is included in the step of arranging the path of the drunken path. The branch name is recorded in each path of the pair of fibers.
34.根据权利要求 31至 33 权利要求戶 ¾的统计 ¾ ^路径的方法, 其擀正在于, 戶 路径的 步霞一步包括: 当路径纽含有返回语句的语句 豫时) 该路径即结束。  34. The method of claim 3 to 4, wherein the step of the household path comprises: when the path contains a statement that returns a statement, the path ends.
35.根据权利要求 31至 33任一权利要求戶 的统ffl^路径的方法,其牛封正在于, «统^»路径的 步職一步包括: 忽略隐藏的 X樣及隐藏的 的直接或间接子 X樣。  35. A method according to any one of claims 31 to 33, wherein the step of the step of the «system^» path comprises: ignoring the hidden X-like and hidden direct or indirect Child X.
36·根据权利要求 29舰的统 路径的方法, 其特征在于, 进"^包括权利要求 1腿的步骤 Co 36. A method of routing a ship according to claim 29, wherein the step of including the leg of claim 1 Co
37.根据权利要求 36所述的统计 ® 路径的方法, 其特征在于, 进^ ^包括画出 ®ί路径的步骤。 37. A method of statistic ® path according to claim 36, wherein the step of drawing a path of ® ί is included.
38.根据权利要求 37腿的统 i†»路径的方法, 其特征在于, 腿画出辦路径的步骤具体包括: 画出路径 ¾1 ^支树对象时的图示;  38. A method of routing a leg according to claim 37, wherein the step of drawing a path of the leg comprises: drawing an icon when the path is a tree object;
画出路径经过各分支 ¾ ^时的图示; - 画出路径 各 ± ^时的图示。  Draw a diagram of the path through each branch 3⁄4 ^; - Draw a path of ± ^ for each icon.
PCT/CN2006/001900 2005-08-01 2006-07-28 A program logic structure graphical representation method and a program path statistic method WO2007014522A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNA2005100361903A CN1908893A (en) 2005-08-01 2005-08-01 Programmed logic structure graphic method and program track static method
CN200510036190.3 2005-08-01

Publications (1)

Publication Number Publication Date
WO2007014522A1 true WO2007014522A1 (en) 2007-02-08

Family

ID=37700010

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/001900 WO2007014522A1 (en) 2005-08-01 2006-07-28 A program logic structure graphical representation method and a program path statistic method

Country Status (2)

Country Link
CN (1) CN1908893A (en)
WO (1) WO2007014522A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8584108B2 (en) * 2010-03-29 2013-11-12 GM Global Technology Operations LLC Method and apparatus for analyzing software
US8589898B2 (en) * 2010-03-29 2013-11-19 GM Global Technology Operations LLC Method and apparatus for analyzing software including a calibrated value
CN102141958B (en) * 2011-03-09 2014-07-30 中国矿业大学 Method for evolving and generating path coverage test data facing defects
CN103207903B (en) * 2013-03-26 2015-11-18 南京南瑞继保电气有限公司 A kind of visualized graphs program topological sorting method
CN104077232B (en) * 2014-07-21 2017-02-22 上海零一拼装信息技术有限公司 Testing device and method based on use case and source code two-way tracing
CN107870853A (en) * 2016-09-27 2018-04-03 北京京东尚科信息技术有限公司 The method and device of test program code path coverage

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1063536A (en) * 1996-08-16 1998-03-06 Hitachi Software Eng Co Ltd Program development supporting device, method therefor and storage medium therefor
US20050050391A1 (en) * 2003-08-27 2005-03-03 Microsoft Corporation Access driven filtering
US20050050531A1 (en) * 2003-08-25 2005-03-03 Woo-Hyong Lee System of benchmarking and method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1063536A (en) * 1996-08-16 1998-03-06 Hitachi Software Eng Co Ltd Program development supporting device, method therefor and storage medium therefor
US20050050531A1 (en) * 2003-08-25 2005-03-03 Woo-Hyong Lee System of benchmarking and method thereof
US20050050391A1 (en) * 2003-08-27 2005-03-03 Microsoft Corporation Access driven filtering

Also Published As

Publication number Publication date
CN1908893A (en) 2007-02-07

Similar Documents

Publication Publication Date Title
WO2007014522A1 (en) A program logic structure graphical representation method and a program path statistic method
TWI291143B (en) Method of learning the second language through picture guiding
Liu et al. Programmatic semantics for natural language interfaces
JP2004258674A (en) System for creating language syntax
TW201512970A (en) Managing real-time handwriting recognition
US11574633B1 (en) Enhanced graphical user interface for voice communications
US8018471B2 (en) Visual component/clause merging
JP2009193595A (en) Chinese dialect judgment program
Castledine et al. Build mobile websites and apps for smart devices
JPH07160705A (en) Apparatus and method for automatic formatting of sentence selected by user
EP2869219A1 (en) Text processing apparatus, text processing method, and computer program product
KR101115497B1 (en) Method, system, program for assisting object selection when web page is authored
WO2020057242A1 (en) Object selecting method and device, terminal, and storage medium
EP0118187B1 (en) Menu-based natural language understanding system
Bessghaier et al. Towards the automatic restructuring of structural aesthetic design of Android user interfaces
US11048405B2 (en) Information processing device and non-transitory computer readable medium
US20070263010A1 (en) Large-scale visualization techniques
JPH1040316A (en) Device and method for supporting test of graphics
JP7225541B2 (en) Information processing device and information processing program
US20100280819A1 (en) Dialog Design Apparatus and Method
CN112530433A (en) Universal voice instruction generation method and device and augmented reality display equipment
US20190243896A1 (en) Information processing device and non-transitory computer readable medium
JP2000029677A (en) Automatic generating device for screen constitution
JPH06348499A (en) Object directional programming support device and its method
Berari et al. Overview of the 2021 ImageCLEFdrawnUI Task: Detection and Recognition of Hand Drawn and Digital Website UIs.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06761605

Country of ref document: EP

Kind code of ref document: A1