CN106383781A - Code analysis realization method and device - Google Patents
Code analysis realization method and device Download PDFInfo
- Publication number
- CN106383781A CN106383781A CN201610803274.3A CN201610803274A CN106383781A CN 106383781 A CN106383781 A CN 106383781A CN 201610803274 A CN201610803274 A CN 201610803274A CN 106383781 A CN106383781 A CN 106383781A
- Authority
- CN
- China
- Prior art keywords
- branch
- program segment
- source code
- mark
- name
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000008569 process Effects 0.000 abstract description 8
- 238000012423 maintenance Methods 0.000 description 2
- 101001074449 Crotalus durissus terrificus Phospholipase A2 inhibitor CNF Proteins 0.000 description 1
- 210000000481 breast Anatomy 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3636—Debugging of software by tracing the execution of the program
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3644—Debugging of software by instrumenting at runtime
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a code analysis realization method and device, and aims at improving the code analysis efficiency. The method comprises the following steps of: adding a first mark behind an initial row of each program segment in a source code, wherein the first mark is used for recording the initial row number of the program segment when the program segment is executed; adding a second mark behind each judgement branch of the source code, wherein the second mark is used for recording the row number of the judgement branch when the judgement branch is executed; operating the mark-added source code; in the operation process of the mark-added source code, recording the initial row number of the executed program segment in a log file according to the first mark and recording the row number of the judgement branch executed in the log file according to the second mark; obtaining a program name of the executed program segment and a judgement branch name of the executed judgement branch according to the log file and the mark-added source code; and displaying the program name of the executed program segment and the judgement branch name of the executed judgement branch.
Description
Technical field
The present invention relates to field of computer technology is and in particular to a kind of method and device realizing code analysis.
Background technology
With the development of applied business, the program code realizing applied business also becomes increasingly complex, with lines of code
Increasingly huge, code maintenance is more and more difficult, cost more and more higher.During the analysis of existing program code, typically in bosom
Doubt problematic code section to be marked, whether correct by operation code checking conjecture, for this analysis of brief program
Method efficiency comparison is high, but for source code that is huge and there is complicated Rule of judgment, is difficult to accurately during analysis
Which branch knowing Rule of judgment be performed it is impossible to all-sidedly and accurately code is analyzed, code analysis inefficiency, dimension
Shield is relatively costly.
Content of the invention
In view of this, the present invention provides a kind of method and device realizing code analysis, so that solve cannot in prior art
All-sidedly and accurately elaborated code is analyzed, the technical problem of code analysis inefficiency.
For solving the above problems, the technical scheme that the present invention provides is as follows:
A kind of method realizing code analysis, methods described includes:
Add the first mark after the initial row of each program segment in source code, described first marks for when this journey
Sequence section records the initial row line number of this program segment when being performed;
Each in described source code judges to add the second mark after branch, and described second marks for dividing when this judgement
Prop up the line number recording this judgement branch when being performed;
Run the source code after adding mark;
In the described running adding the source code after marking, it is marked at record in journal file according to described first
The initial row line number of the program segment being performed, is marked in described journal file according to described second and records the judgement being performed and divide
The line number propped up;
According to the source code after described journal file and described interpolation mark, the journey of the program segment being performed described in acquisition
Sequence name and the judgement branch name judging branch being performed;
The program name of the program segment being performed described in display and the judgement branch name judging branch being performed.
Accordingly, methods described also includes:
If described source code includes transaction code and/or transaction journal number, in the described fortune adding the source code after marking
During row, described journal file records the transaction code being performed and/or transaction journal number.
Accordingly, according to the source code after described journal file and described interpolation mark, the journey being performed described in acquisition
The program name of sequence section and the judgement branch name judging branch being performed, including:
The initial row line number of the program segment being performed described in obtaining from described journal file, according to the described journey being performed
The initial row line number of sequence section is searched from the described source code adding after marking and is obtained the corresponding described program segment being performed
Program name;
The line number judging branch being performed described in obtaining from described journal file, divides according to the described judgement being performed
The line number propped up is searched the corresponding described judgement judging branch being performed of acquisition from the described source code adding after marking and is divided
Prop up name.
Accordingly, methods described also includes:
The execution sequence value of program segment that is performed according to described journal file obtains and described be performed sentence
The execution sequence value of disconnected branch;
The execution sequence value of the program segment being performed described in display and the described execution sequence judging branch being performed
Value.
Accordingly, described in described display, the program name of program segment being performed and the judgement judging branch being performed divide
Prop up name, including:
The program name of the program segment being performed described in being highlighted and the judgement branch name judging branch being performed;
The execution sequence value of program segment being performed described in described display and the described execution judging branch being performed
Sequence valve, including:
The execution sequence value of the program segment being performed described in being highlighted and the described execution judging branch being performed
Sequence valve.
A kind of device realizing code analysis, described device includes:
First adding device, for adding the first mark after the initial row of each program segment in source code, described
First marks the initial row line number for recording this program segment when this program segment is performed;
Second adding device, for judging to add the second mark after branch in each of described source code, described second
Mark the line number for recording this judgement branch when this judgement branch is performed;
Running unit, for running the source code adding after mark;
First recording unit, in the described running adding the source code after marking, according to the described first mark
Note records the initial row line number of the program segment being performed in journal file, is marked in described journal file according to described second
Record the line number judging branch being performed;
First acquisition unit, for according to the source code after described journal file and described interpolation mark, obtaining described
The program name of the program segment being performed and the judgement branch name judging branch being performed;
First display unit, for the program name of program segment that is performed described in showing and be performed judge branch
Judge branch's name.
Accordingly, described device also includes:
Second recording unit, if including transaction code and/or transaction journal number for described source code, adds mark described
In the running of the source code after note, described journal file records the transaction code being performed and/or transaction journal number.
Accordingly, described first acquisition unit includes:
First acquisition subelement, the initial every trade of the program segment for being performed described in acquisition from described journal file
Number;
First lookup subelement, adds after mark from described for the initial row line number according to the described program segment being performed
Source code in search obtain the corresponding described program segment being performed program name;
Second acquisition subelement, with the line number judging branch being performed described in acquisition from described journal file;
Second lookup subelement, for according to described be performed judge the line number of branch from the described source added after marking
Search in code and obtain the corresponding described judgement branch name judging branch being performed.
Accordingly, described device also includes:
Second acquisition unit, for the execution sequence value of program segment that is performed described in being obtained according to described journal file with
And the described execution sequence value judging branch being performed;
Second display unit, for the execution sequence value of program segment that is performed described in showing and described be performed sentence
The execution sequence value of disconnected branch.
Accordingly, described first display unit specifically for:The program name of the program segment being performed described in being highlighted with
And the judgement branch name judging branch being performed;
Described second display unit specifically for:The execution sequence value of the program segment being performed described in being highlighted and institute
State the execution sequence value judging branch being performed.
As can be seen here, the embodiment of the present invention has the advantages that:
The embodiment of the present invention passes through to add mark, when running the source code that with the addition of mark, Ke Yi in source code
In record source code in journal file the program segment being performed and be performed judge branch can be to the program being performed
The program name of section and the judgement branch name judging branch being performed are highlighted, and make the code logic of complexity simply clear
Clearization, helps code analysis personnel quickly to clear the running of code, all-sidedly and accurately code is analyzed, improves generation
The efficiency of code division analysis.
Brief description
Fig. 1 is the flow chart of the embodiment of the method realizing code analysis in the embodiment of the present invention;
Fig. 2 is the schematic diagram of the device embodiment realizing code analysis in the embodiment of the present invention.
Specific embodiment
Understandable for enabling the above objects, features and advantages of the present invention to become apparent from, below in conjunction with the accompanying drawings and specifically real
Mode of applying is described in further detail to the embodiment of the present invention.
The method and device realizing code analysis providing in the embodiment of the present invention, is huge for being directed in prior art
And the source code of the complicated Rule of judgment of presence, it is difficult to accurately know which branch of Rule of judgment is performed during analysis,
All-sidedly and accurately code cannot be analyzed, technical problem that code analysis inefficiency, maintenance cost are higher, proposition will answer
Miscellaneous program code formats, and is marked at the beginning of each program segment of source code and each conditional branching, realizes
Record the program segment of all processes and the judgement branch of process in journal file in the running of source code, and daily record
File and the source code after adding mark are by the program name of the program segment being performed and the judgement judging branch that is performed
Branch's name is highlighted, and in order to code issue analysis, improves code analysis efficiency, answers especially for huge and presence
The source code of miscellaneous Rule of judgment, code analysis efficiency is obviously improved.
Based on above-mentioned thought, shown in Figure 1, the method realizing code analysis providing in the embodiment of the present invention is implemented
Example, may comprise steps of:
Step 101:Add the first mark after the initial row of each program segment in source code, first marks for working as
This program segment records the initial row line number of this program segment when being performed.
The initial row of each program segment would generally be the program name of this program segment, and the program name of program segment can have fixing
Form, determines the initial row position of each program segment by the program name of recognizer section, each program segment initial row it
All add the first mark afterwards, the first mark can be used for recording the initial row line number of this program segment when this program segment is performed.
For example, the line number of the initial row of program segment A is 0016 row, then can add the first mark in the next line of initial row, work as program
Section A is performed, and the code content in the first mark is also carried out, and can remember when such program segment A is performed in journal file
The initial row line number 0016 of record program segment A.
Step 102:Each in source code judges to add the second mark after branch, and second marks for dividing when this judgement
Prop up the line number recording this judgement branch when being performed.
The position judging branch can be determined by judging the keyword of branch, such as WHEN, IF etc., in each judgement
A line after branch all adds the second mark, and the second mark can be used for recording this judgement when this judgement branch is performed and divides
The line number propped up.When a certain judgement branch is performed, the code content in the second mark after this judgement branch is also carried out, this
This judgement branch of sample can record the line number of this judgement branch in journal file when being performed.
In some possible implementations of the present invention, the method realizing code analysis of offer in the embodiment of the present invention
Can also include:
If source code includes transaction code and/or transaction journal number, in the running of the source code after adding mark,
The transaction code being performed and/or transaction journal number is recorded in journal file.
It is related in the source code concluded the business at some, whether identical in order to analyze each transaction implementation procedure, can be to code
The transaction code being performed in running and/or transaction journal number are recorded, in order to subsequently combine transaction code and/or friendship
Easily serial number is analyzed to code.
Step 103:Run the source code after adding mark.
After to the compilation of source code success after adding mark, the source code after adding mark can be run.
Step 104:In the running of the source code after adding mark, it is marked at record in journal file according to first
The initial row line number of the program segment being performed, is marked at, according to second, the row judging branch that in journal file, record is performed
Number.
The first mark by described above, when a certain program segment is performed, after this program segment initial row
It is performed, then can record the initial row line number of the program segment of this execution in journal file, be performed in a certain judgement branch
When, the second mark after this judgement branch is performed, then can record the branch that judges of this execution in journal file
Line number.Journal file can be LOG file or TSQ (Temporary Storage Queue, interim storage queue), and TSQ is
Ephemeral data storage queue in host platform middleware CICS.
Step 105:According to the source code after journal file and interpolation mark, obtain the program name of the program segment being performed
And the judgement branch name judging branch being performed.
In some possible implementations of the present invention, implementing of step 105 can include:
Obtain the initial row line number of the program segment being performed from journal file, according to the initial row of the program segment being performed
Line number searches, the source code after adding mark, the program name obtaining the corresponding program segment being performed;
Obtain the line number judging branch that is performed from journal file, judge the line number of branch from adding according to be performed
Search in source code after labelling and obtain the corresponding judgement branch name judging branch being performed.
Initial row line number according to the program segment being performed can search acquisition in the source code after adding mark, and this is held
The program name of the program segment of row, the line number judging branch according to being performed can be searched in the source code after adding mark and be obtained
Take the judgement branch name judging branch of this execution, judge that branch's name can be specific Rule of judgment.
Step 106:The display program name of program segment being performed and the judgement branch name judging branch being performed.
In some possible implementations of the present invention, the method realizing code analysis of offer in the embodiment of the present invention
Can also include:
The execution sequence value of the program segment being performed and the execution judging branch being performed are obtained according to journal file
Sequence valve;
The display execution sequence value of program segment being performed and the execution sequence value judging branch being performed.
Can be with logging program section and the execution sequence judging branch in journal file, such as certain judgement of execution sequence value
Branch was called respectively in the 100th step run, the 358th step, so when certain program segment or when judging that branch is performed a plurality of times,
The situation that homogeneous is not performed can be distinguished.
In some possible implementations of the present invention, can be highlighted the program segment being performed program name and
The judgement branch name judging branch being performed;And execution sequence value and the quilt of the program segment being performed can be highlighted
The execution sequence value judging branch of execution.
For the ease of check can also show/be highlighted the program segment being performed program name, corresponding line number, correspondence
Execution sequence value and be performed judge the judgement branch name of branch, corresponding line number, corresponding execution sequence value.
In actual applications, journal file can be imported Excel, in conjunction with the source code adding after mark, by running
VBA is grand, realizes above-mentioned display and/or is highlighted function.VBA is a kind of macrolanguage of Visual Basic, is mainly used in expanding
The application program of exhibition Windows.
The program segment that is performed in highlighted displaying source code and judge branch, can at utmost improve code analysis effect
Rate.
So, the embodiment of the present invention passes through to add mark in source code, when running the source code that with the addition of mark, can
With the program segment that is performed in record source code in journal file and be performed judge branch can be to being performed
The program name of program segment and the judgement branch name judging branch being performed are highlighted, and make the code logic letter of complexity
Single sharpening, helps code analysis personnel quickly to clear the running of code, all-sidedly and accurately code is analyzed, improve
The efficiency of code analysis.
Below in conjunction with practical application, the method realizing code analysis providing in the embodiment of the present invention is illustrated.In reality
In the application of border, the realization of the embodiment of the present invention can with main frame REXX (Restructured Extended Executor,
Expand weight structureization execution) script, complicated source program code is formatted, in beginning and each judgement of all program segments
Bifurcation adds mark, the program segment of all processes and judge that branch can write in journal file when source code runs,
Journal file, after the completion of program is run, can be imported to Excel by journal file such as LOG file or TSQ, after mark
Source code and journal file, program segment that by source code pass by and judge branching logic with highlighted grand by running VBA
Mark display, in order to code analysis before and after code issue analysis and transformation, improves code operation efficiency, especially for huge
Main program, code analysis efficiency is obviously improved.
Wherein, REXX is as the very high script of a level on a main frame, have especially powerful for text
The instrument of process task, need not compile, and can directly use, easy to use.
A kind of Application Example of method realizing code analysis presented below.
Step A:Run REXX shell script, by PDS that source code is located (Partitioned Data Sets, partition data
Collection) or source code position as parameter incoming REXX shell script, mark is added in source code by REXX script.
, add mark before the LINKAGE portion or PROCEDURE portion of source code taking a certain main line source code GL0000 as a example
The variable-definition of note;If containing STRTAREA area in the LINKAGE portion of PROCEDURE portion starting position, add transaction code
And/or transaction journal labelled notation, in the running in order to the source code after adding mark, journal file records quilt
The transaction code of execution and/or transaction journal number;Add the first mark after the initial row of each program segment;Judge branch at each
Add the second mark after (such as IF, WHEN);Add at source code end and terminate definition.
Step B:Compiling link adds the source code after mark, and actual motion adds the source code after mark, generates LOG
File.
Step C:LOG file after the completion of source code GL0000 and operation is imported PC, LOG file is imported Excel
File, run macro, it is highlighted program name, corresponding line number, corresponding execution sequence value and the quilt of the program segment being performed
Execution judge the judgement branch name of branch, corresponding line number, corresponding execution sequence value.
So, the embodiment of the present invention passes through to add mark in source code, when running the source code that with the addition of mark, can
With the program segment that is performed in record source code in journal file and be performed judge branch can be to being performed
The program name of program segment and the judgement branch name judging branch being performed are highlighted, and make the code logic letter of complexity
Single sharpening, helps code analysis personnel quickly to clear the running of code, all-sidedly and accurately code is analyzed, improve
The efficiency of code analysis.
Accordingly, also provide a kind of device embodiment realizing code analysis in the embodiment of the present invention, can include:
First adding device 201, for adding the first mark after the initial row of each program segment in source code, the
One marks the initial row line number for recording this program segment when this program segment is performed.
Second adding device 202, for judging to add the second mark after branch in each of source code, the second mark is used
In the line number recording this judgement branch when this judgement branch is performed.
Running unit 203, for running the source code adding after mark.
First recording unit 204, in the running for the source code after adding mark, is marked at day according to first
Record the initial row line number of the program segment being performed in will file, according to second be marked in journal file that record is performed sentence
The line number of disconnected branch.
First acquisition unit 205, for according to the source code after journal file and interpolation mark, obtaining the journey being performed
The program name of sequence section and the judgement branch name judging branch being performed.
In some possible implementations of the present invention, first acquisition unit can include:
First acquisition subelement, for obtaining the initial row line number of the program segment being performed from journal file;
First lookup subelement, for source code after interpolation mark for the initial row line number according to the program segment being performed
The middle program name searching the corresponding program segment being performed of acquisition;
Second acquisition subelement, with obtaining the line number judging branch being performed from journal file;
Second lookup subelement, for looking into from the source code after interpolation mark according to the line number judging branch being performed
Look for the corresponding judgement branch name judging branch being performed of acquisition.
First display unit 206, for show the program name of program segment that is performed and be performed judge branch
Judge branch's name.
In some possible implementations of the present invention, a kind of code analysis of realizing of providing in the embodiment of the present invention
Device can also include:
Second recording unit, the source if including transaction code and/or transaction journal number for source code, after adding mark
In the running of code, journal file records the transaction code being performed and/or transaction journal number.
In some possible implementations of the present invention, a kind of code analysis of realizing of providing in the embodiment of the present invention
Device can also include:
Second acquisition unit, for obtaining the execution sequence value of the program segment being performed and being performed according to journal file
The execution sequence value judging branch;
Second display unit, for show the execution sequence value of program segment that is performed and be performed judge branch
Execution sequence value.
In some possible implementations of the present invention, the first display unit can be specifically for:It is highlighted and held
The program name of program segment of row and the judgement branch name judging branch being performed;
Second display unit can be specifically for:It is highlighted the execution sequence value of the program segment being performed and be performed
The execution sequence value judging branch.
So, the embodiment of the present invention passes through to add mark in source code, when running the source code that with the addition of mark, can
With the program segment that is performed in record source code in journal file and be performed judge branch can be to being performed
The program name of program segment and the judgement branch name judging branch being performed are highlighted, and make the code logic letter of complexity
Single sharpening, helps code analysis personnel quickly to clear the running of code, all-sidedly and accurately code is analyzed, improve
The efficiency of code analysis.
It should be noted that each embodiment is described by the way of going forward one by one in this specification, each embodiment emphasis is said
Bright is all the difference with other embodiment, between each embodiment identical similar portion mutually referring to.For reality
For applying system disclosed in example or device, because it corresponds to the method disclosed in Example, so fairly simple, the phase of description
Referring to method part illustration in place of pass.
Also, it should be noted herein, such as first and second or the like relational terms are used merely to one
Entity or operation are made a distinction with another entity or operation, and not necessarily require or imply between these entities or operation
There is any this actual relation or order.And, term " inclusion ", "comprising" or its any other variant are intended to contain
Comprising of lid nonexcludability, wants so that including a series of process of key elements, method, article or equipment and not only including those
Element, but also include other key elements being not expressly set out, or also include for this process, method, article or equipment
Intrinsic key element.In the absence of more restrictions, the key element that limited by sentence "including a ..." it is not excluded that
Also there is other identical element including in the process of described key element, method, article or equipment.
The step of the method in conjunction with the embodiments described herein description or algorithm can directly be held with hardware, processor
The software module of row, or the combination of the two is implementing.Software module can be placed in random access memory (RAM), internal memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In known any other form of storage medium in field.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses the present invention.
Multiple modifications to these embodiments will be apparent from for those skilled in the art, as defined herein
General Principle can be realized without departing from the spirit or scope of the present invention in other embodiments.Therefore, the present invention
It is not intended to be limited to the embodiments shown herein, and be to fit to and principles disclosed herein and features of novelty phase one
The scope the widest causing.
Claims (10)
1. a kind of method realizing code analysis is it is characterised in that methods described includes:
Add the first mark after the initial row of each program segment in source code, described first marks for when this program segment
The initial row line number of this program segment is recorded when being performed;
Each in described source code judges to add the second mark after branch, and described second marks for when this judgement branch quilt
The line number of this judgement branch is recorded during execution;
Run the source code after adding mark;
In the described running adding the source code after marking, it is marked in journal file to record according to described first and is held
The initial row line number of the program segment of row, according to described second be marked in described journal file that record is performed judge branch
Line number;
According to the source code after described journal file and described interpolation mark, the program name of the program segment being performed described in acquisition
And the judgement branch name judging branch being performed;
The program name of the program segment being performed described in display and the judgement branch name judging branch being performed.
2. method according to claim 1 is it is characterised in that methods described also includes:
If described source code includes transaction code and/or transaction journal number, in the described operation adding the source code after marking
Cheng Zhong, records the transaction code being performed and/or transaction journal number in described journal file.
3. after method according to claim 1 is it is characterised in that mark according to described journal file and described interpolation
Source code, the program name of program segment being performed described in acquisition and the judgement branch name judging branch being performed, including:
The initial row line number of the program segment being performed described in obtaining from described journal file, according to the described program segment being performed
Initial row line number from described add mark after source code search obtain the corresponding described program segment being performed program
Name;
The line number judging branch that is performed described in obtaining from described journal file, according to described be performed judge branch
Line number is searched from the described source code adding after marking and is obtained the corresponding described judgement branch name judging branch being performed.
4. method according to claim 1 is it is characterised in that methods described also includes:
The execution sequence value of the program segment being performed according to described journal file obtains and the described judgement being performed divide
The execution sequence value propped up;
The execution sequence value of the program segment being performed described in display and the described execution sequence value judging branch being performed.
5. method according to claim 4 it is characterised in that the program segment being performed described in described display program name with
And the judgement branch name judging branch being performed, including:
The program name of the program segment being performed described in being highlighted and the judgement branch name judging branch being performed;
The execution sequence value of program segment being performed described in described display and the described execution sequence judging branch being performed
Value, including:
The execution sequence value of the program segment being performed described in being highlighted and the described execution sequence judging branch being performed
Value.
6. a kind of device realizing code analysis is it is characterised in that described device includes:
First adding device, marks for adding first after the initial row of each program segment in source code, described first
Mark the initial row line number for recording this program segment when this program segment is performed;
Second adding device, for judging to add the second mark after branch in each of described source code, described second mark
For recording the line number of this judgement branch when this judgement branch is performed;
Running unit, for running the source code adding after mark;
First recording unit, for, in the described running adding the source code after marking, being marked at according to described first
Record the initial row line number of the program segment being performed in journal file, be marked at record in described journal file according to described second
The line number judging branch being performed;
First acquisition unit, for according to the source code after described journal file and described interpolation mark, obtaining described being held
The program name of program segment of row and the judgement branch name judging branch being performed;
First display unit, for the program name of program segment that is performed described in showing and the judgement judging branch being performed
Branch's name.
7. device according to claim 6 is it is characterised in that described device also includes:
Second recording unit, if including transaction code and/or transaction journal number for described source code, after described interpolation mark
The running of source code in, described journal file records the transaction code being performed and/or transaction journal number.
8. device according to claim 6 is it is characterised in that described first acquisition unit includes:
First acquisition subelement, the initial row line number of the program segment for being performed described in acquisition from described journal file;
First lookup subelement, for the initial row line number according to the described program segment being performed from the described source added after mark
The program name obtaining the corresponding described program segment being performed is searched in code;
Second acquisition subelement, with the line number judging branch being performed described in acquisition from described journal file;
Second lookup subelement, for according to described be performed judge the line number of branch from the described source code adding after marking
Middle lookup obtains the corresponding described judgement branch name judging branch being performed.
9. device according to claim 6 is it is characterised in that described device also includes:
Second acquisition unit, for the execution sequence value of program segment that is performed described in being obtained according to described journal file and institute
State the execution sequence value judging branch being performed;
Second display unit, the execution sequence value of program segment and the described judgement being performed for being performed described in showing are divided
The execution sequence value propped up.
10. device according to claim 9 it is characterised in that described first display unit specifically for:It is highlighted institute
The program name stating the program segment being performed and the judgement branch name judging branch being performed;
Described second display unit specifically for:The execution sequence value of the program segment being performed described in being highlighted and described quilt
The execution sequence value judging branch of execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610803274.3A CN106383781B (en) | 2016-09-05 | 2016-09-05 | Method and device for realizing code analysis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610803274.3A CN106383781B (en) | 2016-09-05 | 2016-09-05 | Method and device for realizing code analysis |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106383781A true CN106383781A (en) | 2017-02-08 |
CN106383781B CN106383781B (en) | 2020-02-14 |
Family
ID=57939555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610803274.3A Active CN106383781B (en) | 2016-09-05 | 2016-09-05 | Method and device for realizing code analysis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106383781B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108446234A (en) * | 2018-03-20 | 2018-08-24 | 中国银行股份有限公司 | Information processing method and information processing unit |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5778169A (en) * | 1995-08-07 | 1998-07-07 | Synopsys, Inc. | Computer system having improved regression testing |
US20030159133A1 (en) * | 2001-10-26 | 2003-08-21 | International Business Machines Corporation | Method and system for tracing and displaying execution of nested functions |
CN102902764A (en) * | 2012-09-25 | 2013-01-30 | 北京奇虎科技有限公司 | Method and device for log recording |
CN103744782A (en) * | 2014-01-02 | 2014-04-23 | 北京百度网讯科技有限公司 | Method and device for acquiring program execution sequence |
CN105843740A (en) * | 2016-03-23 | 2016-08-10 | 腾讯科技(深圳)有限公司 | Method and device for detecting code compiling result |
-
2016
- 2016-09-05 CN CN201610803274.3A patent/CN106383781B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5778169A (en) * | 1995-08-07 | 1998-07-07 | Synopsys, Inc. | Computer system having improved regression testing |
US20030159133A1 (en) * | 2001-10-26 | 2003-08-21 | International Business Machines Corporation | Method and system for tracing and displaying execution of nested functions |
US7120901B2 (en) * | 2001-10-26 | 2006-10-10 | International Business Machines Corporation | Method and system for tracing and displaying execution of nested functions |
CN102902764A (en) * | 2012-09-25 | 2013-01-30 | 北京奇虎科技有限公司 | Method and device for log recording |
CN103744782A (en) * | 2014-01-02 | 2014-04-23 | 北京百度网讯科技有限公司 | Method and device for acquiring program execution sequence |
CN105843740A (en) * | 2016-03-23 | 2016-08-10 | 腾讯科技(深圳)有限公司 | Method and device for detecting code compiling result |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108446234A (en) * | 2018-03-20 | 2018-08-24 | 中国银行股份有限公司 | Information processing method and information processing unit |
Also Published As
Publication number | Publication date |
---|---|
CN106383781B (en) | 2020-02-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105446723B (en) | Method and apparatus for identifying the semantic differential between source code version | |
US7752613B2 (en) | Disambiguation in dynamic binary translation | |
US8984485B2 (en) | Analysis of source code changes | |
CN109902248A (en) | Page display method, device, computer equipment and readable storage medium storing program for executing | |
CN105512285B (en) | Adaptive network reptile method based on machine learning | |
CN106294313A (en) | Study embeds for entity and the word of entity disambiguation | |
Rau et al. | Transferring tests across web applications | |
CN115309634B (en) | A microservice extraction method, system, medium, device and information processing terminal | |
US8484148B2 (en) | Predicting whether strings identify a same subject | |
CN112559355A (en) | Test case generation method and device, electronic equipment and storage medium | |
CN116149670A (en) | HDL compiling optimization method based on graph | |
CN111859985A (en) | AI customer service model testing method, device, electronic equipment and storage medium | |
CN106202007B (en) | A Method for Evaluating the Similarity of MATLAB Program Files | |
CN106383781A (en) | Code analysis realization method and device | |
US20140006373A1 (en) | Automated subject annotator creation using subject expansion, ontological mining, and natural language processing techniques | |
WO2023275887A1 (en) | System and method for automated software testing | |
CN107784019A (en) | Word treatment method and system are searched in a kind of searching service | |
CN107025229A (en) | The method of off-line file trace detection based on browser client application program | |
Schluter | Restarting automata with auxiliary symbols restricted by lookahead size | |
JP6955162B2 (en) | Analytical equipment, analysis method and analysis program | |
CN104866592A (en) | Method and apparatus for displaying abstract in search engine | |
Vidoni et al. | Towards a taxonomy of Roxygen documentation in R packages | |
Wang et al. | Closed inter-sequence pattern mining | |
CN107077365A (en) | Selectively load the head and/or its part of precompile | |
CN111933228B (en) | Method and device for realizing project distribution and management system in clinical research |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |