CN106383781B - Method and device for realizing code analysis - Google Patents

Method and device for realizing code analysis Download PDF

Info

Publication number
CN106383781B
CN106383781B CN201610803274.3A CN201610803274A CN106383781B CN 106383781 B CN106383781 B CN 106383781B CN 201610803274 A CN201610803274 A CN 201610803274A CN 106383781 B CN106383781 B CN 106383781B
Authority
CN
China
Prior art keywords
executed
program segment
branch
judgment branch
source code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610803274.3A
Other languages
Chinese (zh)
Other versions
CN106383781A (en
Inventor
李聚良
陈树伟
张凤玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201610803274.3A priority Critical patent/CN106383781B/en
Publication of CN106383781A publication Critical patent/CN106383781A/en
Application granted granted Critical
Publication of CN106383781B publication Critical patent/CN106383781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging 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 method and a device for realizing code analysis, which are used for improving the code analysis efficiency, and the method comprises the following steps: adding a first mark after the starting line of each program segment in the source code, wherein the first mark is used for recording the starting line number of the program segment when the program segment is executed; adding a second mark after each judgment branch of the source code, wherein the second mark is used for recording the line number of the judgment branch when the judgment branch is executed; running the marked source code; in the running process of the source code added with the mark, recording the line number of the initial line of the executed program segment in the log file according to the first mark, and recording the line number of the executed judgment branch in the log file according to the second mark; acquiring the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the marked source code; the program name of the program segment being executed and the judgment branch name of the judgment branch being executed are displayed.

Description

Method and device for realizing code analysis
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for realizing code analysis.
Background
Along with the development of application services, program codes for realizing the application services are more and more complex, and along with the increasing huge number of code lines, the code maintenance is more and more difficult, and the cost is higher and higher. In the existing program code analysis process, generally, a suspected problematic code part is marked, and whether the suspected problematic code part is correct or not is guessed through code running verification, so that the analysis method is high in efficiency for a short program, but for a huge source code with complex judgment conditions, it is difficult to accurately know which branches of the judgment conditions are executed in the analysis process, the code cannot be comprehensively and accurately analyzed, the code analysis efficiency is low, and the maintenance cost is high.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for implementing code analysis, so as to solve the technical problems in the prior art that complex codes cannot be analyzed completely and accurately, and the efficiency of code analysis is low.
In order to solve the above problems, the technical scheme provided by the invention is as follows:
a method of implementing code analysis, the method comprising:
adding a first mark after the starting line of each program segment in the source code, wherein the first mark is used for recording the starting line number of the program segment when the program segment is executed;
adding a second mark after each judgment branch of the source code, wherein the second mark is used for recording the line number of the judgment branch when the judgment branch is executed;
running the marked source code;
in the running process of the source code added with the mark, recording the line number of the initial line of the executed program segment in a log file according to the first mark, and recording the line number of the executed judgment branch in the log file according to the second mark;
acquiring the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the source code added with the mark;
and displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch.
Correspondingly, the method further comprises the following steps:
if the source code comprises a transaction code and/or a transaction serial number, recording the executed transaction code and/or transaction serial number in the log file during the running process of the marked source code.
Correspondingly, obtaining the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the source code added with the mark, including:
acquiring the initial line number of the executed program segment from the log file, and searching and acquiring the program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
and acquiring the line number of the executed judgment branch from the log file, and searching and acquiring the corresponding judgment branch name of the executed judgment branch from the marked source code according to the line number of the executed judgment branch.
Correspondingly, the method further comprises the following steps:
acquiring an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch according to the log file;
displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
Correspondingly, the displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch comprises:
highlighting the program name of the executed program segment and the judgment branch name of the executed judgment branch;
the displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch comprises:
highlighting the execution sequence value of the executed program segment and the execution sequence value of the executed decision branch.
An apparatus to implement code analysis, the apparatus comprising:
a first adding unit, for adding a first mark after the starting line of each program segment in the source code, wherein the first mark is used for recording the starting line number of the program segment when the program segment is executed;
a second adding unit, configured to add a second flag after each judgment branch of the source code, where the second flag is used to record a line number of the judgment branch when the judgment branch is executed;
the running unit is used for running the source code added with the mark;
a first recording unit, configured to record, in an operation process of the source code after adding the mark, a line number of a starting line of an executed program segment in a log file according to the first mark, and record, in the log file, a line number of an executed judgment branch according to the second mark;
a first obtaining unit, configured to obtain, according to the log file and the marked source code, a program name of the executed program segment and a judgment branch name of an executed judgment branch;
a first display unit for displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch.
Correspondingly, the device further comprises:
and the second recording unit is used for recording the executed transaction codes and/or transaction serial numbers in the log file in the running process of the marked source codes if the source codes comprise the transaction codes and/or transaction serial numbers.
Correspondingly, the first obtaining unit comprises:
a first obtaining subunit, configured to obtain, from the log file, a starting line number of the executed program segment;
the first searching subunit is used for searching and acquiring a program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
a second obtaining subunit operable to obtain, from the log file, a line number of the executed judgment branch;
and the second searching subunit is used for searching and acquiring the corresponding judging branch name of the executed judging branch from the marked source code according to the line number of the executed judging branch.
Correspondingly, the device further comprises:
a second obtaining unit, configured to obtain, according to the log file, an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch;
and the second display unit is used for displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
Correspondingly, the first display unit is specifically configured to: highlighting the program name of the executed program segment and the judgment branch name of the executed judgment branch;
the second display unit is specifically configured to: highlighting the execution sequence value of the executed program segment and the execution sequence value of the executed decision branch.
Therefore, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention adds the mark in the source code, can record the executed program segment and the executed judgment branch in the source code in the log file and highlight the program name of the executed program segment and the judgment branch name of the executed judgment branch when the marked source code is operated, so that the complex code logic is simple and clear, a code analyst is helped to quickly clear the operation process of the code, the code is comprehensively and accurately analyzed, and the code analysis efficiency is improved.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for implementing code analysis in an embodiment of the present invention;
fig. 2 is a schematic diagram of an embodiment of an apparatus for implementing code analysis according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
The method and the device for realizing code analysis provided by the embodiment of the invention are used for solving the technical problems that in the prior art, aiming at a huge source code with complex judgment conditions, which branches of the judgment conditions are difficult to accurately know to be executed in the analysis process, the code cannot be comprehensively and accurately analyzed, the code analysis efficiency is low, and the maintenance cost is high, the complex program code is formatted, the marks are made at the beginning of each program segment of the source code and each condition branch, all the passed program segments and passed judgment branches are recorded in a log file in the running process of the source code, the log file and the source code added with the marks highlight the program names of the executed program segments and the judgment branch names of the executed judgment branches, so that the code problem analysis is facilitated, and the code analysis efficiency is improved, especially, the code analysis efficiency is obviously improved for the huge source codes with complex judgment conditions.
Based on the above thought, referring to fig. 1, an embodiment of a method for implementing code analysis provided in the embodiment of the present invention may include the following steps:
step 101: a first marker is added after the starting line of each program segment in the source code, and the first marker is used for recording the starting line number of the program segment when the program segment is executed.
The start line of each program segment will typically be the program name of the segment, which may have a fixed format, the start line position of each program segment being determined by identifying the program name of the segment, a first marker being added after the start line of each program segment, which first marker may be used to record the start line number of the segment when the segment is executed. For example, if the line number of the starting line of the program segment a is 0016, a first flag may be added to the line next to the starting line, and when the program segment a is executed, the code content in the first flag is also executed, so that when the program segment a is executed, the starting line number of the program segment a 0016 may be recorded in the log file.
Step 102: a second marker is added after each predicate branch of the source code, the second marker being used to record a line number of the predicate branch when the predicate branch is executed.
The location of the decision branches may be determined by keywords of the decision branches, such as WHEN, IF, etc., and a second flag may be added one row after each decision branch, which may be used to record the row number of the decision branch WHEN the decision branch is executed. When a certain judgment branch is executed, the code content in the second mark after the judgment branch is also executed, so that the judgment branch can record the line number of the judgment branch in a log file when the judgment branch is executed.
In some possible implementation manners of the present invention, the method for implementing code analysis provided in the embodiment of the present invention may further include:
if the source code includes a transaction code and/or transaction serial number, the executed transaction code and/or transaction serial number is recorded in a log file during the running of the source code after the mark is added.
In some source code related to transactions, in order to analyze whether the execution process of each transaction is the same, the executed transaction code and/or transaction serial number in the running process of the code can be recorded, so that the code can be analyzed subsequently by combining the transaction code and/or transaction serial number.
Step 103: and running the marked source code.
After the source code added with the mark is compiled successfully, the source code added with the mark can be run.
Step 104: during the running process of the source code after the mark is added, the line number of the initial line of the executed program segment is recorded in the log file according to the first mark, and the line number of the executed judgment branch is recorded in the log file according to the second mark.
As is apparent from the above description, when a certain program segment is executed, the first flag following the start line of the program segment is executed, and the start line number of the program segment to be executed can be recorded in the log file, and when a certain decision branch is executed, the second flag following the decision branch is executed, and the line number of the decision branch to be executed can be recorded in the log file. The LOG file may be a LOG file or a TSQ (Temporary Storage Queue), which is a Temporary data Storage Queue in the host platform middleware CICS.
Step 105: and acquiring the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the marked source code.
In some possible implementations of the present invention, the specific implementation of step 105 may include:
acquiring the initial line number of the executed program segment from the log file, and searching and acquiring the program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
and acquiring the line number of the executed judgment branch from the log file, and searching and acquiring the corresponding judgment branch name of the executed judgment branch from the marked source code according to the line number of the executed judgment branch.
The program name of the executed program segment can be searched and obtained in the marked source code according to the line number of the initial line of the executed program segment, the judgment branch name of the executed judgment branch can be searched and obtained in the marked source code according to the line number of the executed judgment branch, and the judgment branch name can be a specific judgment condition.
Step 106: the program name of the program segment being executed and the judgment branch name of the judgment branch being executed are displayed.
In some possible implementation manners of the present invention, the method for implementing code analysis provided in the embodiment of the present invention may further include:
acquiring an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch according to the log file;
and displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
The log file may also record the execution sequence of the program segment and the judgment branch, and the execution sequence value, for example, the judgment branch is called in the 100 th step and the 358 th step of the execution, so that when a certain program segment or judgment branch is executed multiple times, the execution of different times can be distinguished.
In some possible implementations of the invention, the program name of the executed program segment and the judgment branch name of the executed judgment branch may be highlighted; and may highlight the execution order value of the executed program segment and the execution order value of the executed decision branch.
The program name, corresponding line number, corresponding execution order value of the executed program segment, and the branch-of-judgment name, corresponding line number, corresponding execution order value of the branch-of-judgment being executed may also be displayed/highlighted for ease of viewing.
In practical application, the log file can be imported into Excel, and the VBA macro is run in combination with the marked source code, so that the display and/or highlight display functions are realized. VBA is a macro language of Visual Basic, and is mainly used for extending application programs of Windows.
The executed program segment and the judgment branch in the source code are highlighted, so that the code analysis efficiency can be improved to the greatest extent.
Therefore, by adding the mark in the source code, when the source code added with the mark is operated, the method and the device can record the executed program segment and the executed judgment branch in the source code in the log file, highlight the program name of the executed program segment and the judgment branch name of the executed judgment branch, simplify and clarify complex code logic, help code analysts to quickly clear up the operation process of the code, comprehensively and accurately analyze the code, and improve the efficiency of code analysis.
The method for implementing code analysis provided in the embodiment of the present invention is described below with reference to practical applications. In practical application, the implementation of the embodiment of the present invention may use REXX (reconstructed Extended execution) scripting language on the host, format the complex source program code, add marks at the beginning and each judgment branch of all program segments, write all the passed program segments and judgment branches into a LOG file when the source code is running, such as LOG file or TSQ, after the program is running, import the LOG file into Excel, and display the program segments passed by the source code and the judgment branch logic with highlight marks by running VBA macro according to the marked source code and the LOG file, so as to facilitate code problem analysis and code analysis before and after modification, improve the code working efficiency, and particularly improve the code analysis efficiency significantly for a huge host.
The REXX is used as a very high-level script language on a host, has a very strong tool for text processing tasks, does not need to be compiled, can be directly used, and is simple and convenient to use.
The following provides application embodiments of a method for implementing code analysis.
Step A: running REXX script program, using PDS (Partitioned Data Sets) where the source code is located or the position of the source code as parameter to be transmitted into REXX script program, and adding mark in the source code through REXX script.
Taking a certain main line source code GL0000 as an example, adding a marked variable definition in front of a LINKAGE part or a PROCEDURE part of the source code; if the LINKAGE part contains the STRTAAREA area at the starting position of the PROCEDURE part, transaction codes and/or transaction serial number marks are added so as to record executed transaction codes and/or transaction serial numbers in a log file in the running process of the marked source codes; adding a first mark after the starting line of each program segment; adding a second label after each decision branch (e.g., IF, WHEN); an end definition is added at the end of the source code.
And B: and compiling and linking the marked source code, and actually running the marked source code to generate the LOG file.
And C: and importing the source code GL0000 and the LOG file after the operation into a PC (personal computer), importing the LOG file into an Excel file, operating the macro, and highlighting the program name, the corresponding line number and the corresponding execution sequence value of the executed program segment, and the judgment branch name, the corresponding line number and the corresponding execution sequence value of the executed judgment branch.
Therefore, by adding the mark in the source code, when the source code added with the mark is operated, the method and the device can record the executed program segment and the executed judgment branch in the source code in the log file, highlight the program name of the executed program segment and the judgment branch name of the executed judgment branch, simplify and clarify complex code logic, help code analysts to quickly clear up the operation process of the code, comprehensively and accurately analyze the code, and improve the efficiency of code analysis.
Correspondingly, an embodiment of an apparatus for implementing code analysis is further provided in the embodiments of the present invention, which may include:
a first adding unit 201, configured to add a first mark after a start line of each program segment in the source code, where the first mark is used to record a start line number of the program segment when the program segment is executed.
A second adding unit 202, configured to add a second flag after each judgment branch of the source code, where the second flag is used to record a line number of the judgment branch when the judgment branch is executed.
And the running unit 203 is used for running the marked source code.
A first recording unit 204, configured to record, in the running process of the source code after the mark is added, a line number of a starting line of the executed program segment in the log file according to the first mark, and record, in the log file, a line number of the executed judgment branch according to the second mark.
A first obtaining unit 205, configured to obtain, according to the log file and the marked source code, a program name of the executed program segment and a judgment branch name of the executed judgment branch.
In some possible implementations of the present invention, the first obtaining unit may include:
a first obtaining subunit, configured to obtain, from the log file, a starting line number of the executed program segment;
the first searching subunit is used for searching and acquiring the program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
a second obtaining subunit operable to obtain, from the log file, a line number of the executed judgment branch;
and the second searching subunit is used for searching and acquiring the judgment branch name of the corresponding executed judgment branch from the marked source code according to the line number of the executed judgment branch.
A first display unit 206 for displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch.
In some possible implementation manners of the present invention, an apparatus for implementing code analysis provided in the embodiment of the present invention may further include:
and the second recording unit is used for recording the executed transaction codes and/or transaction serial numbers in the log file in the running process of the marked source code if the source code comprises the transaction codes and/or transaction serial numbers.
In some possible implementation manners of the present invention, an apparatus for implementing code analysis provided in the embodiment of the present invention may further include:
a second obtaining unit configured to obtain, from the log file, an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch;
and the second display unit is used for displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
In some possible implementations of the invention, the first display unit may be specifically configured to: highlighting the program name of the executed program segment and the judgment branch name of the executed judgment branch;
the second display unit may be specifically configured to: the execution sequence value of the executed program segment and the execution sequence value of the executed decision branch are highlighted.
Therefore, by adding the mark in the source code, when the source code added with the mark is operated, the method and the device can record the executed program segment and the executed judgment branch in the source code in the log file, highlight the program name of the executed program segment and the judgment branch name of the executed judgment branch, simplify and clarify complex code logic, help code analysts to quickly clear up the operation process of the code, comprehensively and accurately analyze the code, and improve the efficiency of code analysis.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of implementing code analysis, the method comprising:
adding a first mark after the starting line of each program segment in the source code, wherein the first mark is used for recording the starting line number of the program segment when the program segment is executed;
adding a second mark after each judgment branch of the source code, wherein the second mark is used for recording the line number of the judgment branch when the judgment branch is executed;
running the marked source code;
in the running process of the source code added with the mark, recording the line number of the initial line of the executed program segment in a log file according to the first mark, and recording the line number of the executed judgment branch in the log file according to the second mark;
acquiring the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the source code added with the mark;
and displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch.
2. The method of claim 1, further comprising:
if the source code comprises a transaction code and/or a transaction serial number, recording the executed transaction code and/or transaction serial number in the log file during the running process of the marked source code.
3. The method of claim 1, wherein obtaining the program name of the executed program segment and the judgment branch name of the executed judgment branch according to the log file and the marked source code comprises:
acquiring the initial line number of the executed program segment from the log file, and searching and acquiring the program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
and acquiring the line number of the executed judgment branch from the log file, and searching and acquiring the corresponding judgment branch name of the executed judgment branch from the marked source code according to the line number of the executed judgment branch.
4. The method of claim 1, further comprising:
acquiring an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch according to the log file;
displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
5. The method of claim 4, wherein displaying the program name of the executed program segment and the branch-of-judgment name of the executed branch comprises:
highlighting the program name of the executed program segment and the judgment branch name of the executed judgment branch;
the displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch comprises:
highlighting the execution sequence value of the executed program segment and the execution sequence value of the executed decision branch.
6. An apparatus for implementing code analysis, the apparatus comprising:
a first adding unit, for adding a first mark after the starting line of each program segment in the source code, wherein the first mark is used for recording the starting line number of the program segment when the program segment is executed;
a second adding unit, configured to add a second flag after each judgment branch of the source code, where the second flag is used to record a line number of the judgment branch when the judgment branch is executed;
the running unit is used for running the source code added with the mark;
a first recording unit, configured to record, in an operation process of the source code after adding the mark, a line number of a starting line of an executed program segment in a log file according to the first mark, and record, in the log file, a line number of an executed judgment branch according to the second mark;
a first obtaining unit, configured to obtain, according to the log file and the marked source code, a program name of the executed program segment and a judgment branch name of an executed judgment branch;
a first display unit for displaying the program name of the executed program segment and the judgment branch name of the executed judgment branch.
7. The apparatus of claim 6, further comprising:
and the second recording unit is used for recording the executed transaction codes and/or transaction serial numbers in the log file in the running process of the marked source codes if the source codes comprise the transaction codes and/or transaction serial numbers.
8. The apparatus of claim 6, wherein the first obtaining unit comprises:
a first obtaining subunit, configured to obtain, from the log file, a starting line number of the executed program segment;
the first searching subunit is used for searching and acquiring a program name of the corresponding executed program segment from the marked source code according to the initial line number of the executed program segment;
a second obtaining subunit operable to obtain, from the log file, a line number of the executed judgment branch;
and the second searching subunit is used for searching and acquiring the corresponding judging branch name of the executed judging branch from the marked source code according to the line number of the executed judging branch.
9. The apparatus of claim 6, further comprising:
a second obtaining unit, configured to obtain, according to the log file, an execution sequence value of the executed program segment and an execution sequence value of the executed judgment branch;
and the second display unit is used for displaying the execution sequence value of the executed program segment and the execution sequence value of the executed judgment branch.
10. The apparatus according to claim 9, wherein the first display unit is specifically configured to: highlighting the program name of the executed program segment and the judgment branch name of the executed judgment branch;
the second display unit is specifically configured to: highlighting the execution sequence value of the executed program segment and the execution sequence value of the executed decision branch.
CN201610803274.3A 2016-09-05 2016-09-05 Method and device for realizing code analysis Active CN106383781B (en)

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 CN106383781A (en) 2017-02-08
CN106383781B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446234A (en) * 2018-03-20 2018-08-24 中国银行股份有限公司 Information processing method and information processing unit

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778169A (en) * 1995-08-07 1998-07-07 Synopsys, Inc. Computer system having improved regression testing
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
CN105843740A (en) * 2016-03-23 2016-08-10 腾讯科技(深圳)有限公司 Method and device for detecting code compiling result

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744782A (en) * 2014-01-02 2014-04-23 北京百度网讯科技有限公司 Method and device for acquiring program execution sequence

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778169A (en) * 1995-08-07 1998-07-07 Synopsys, Inc. Computer system having improved regression testing
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
CN105843740A (en) * 2016-03-23 2016-08-10 腾讯科技(深圳)有限公司 Method and device for detecting code compiling result

Also Published As

Publication number Publication date
CN106383781A (en) 2017-02-08

Similar Documents

Publication Publication Date Title
CN110442511B (en) Visual embedded point testing method and device
US8065667B2 (en) Injecting content into third party documents for document processing
CN107908959B (en) Website information detection method and device, electronic equipment and storage medium
US11599451B2 (en) Visible elements-based application testing
CN109637000B (en) Invoice detection method and device, storage medium and electronic terminal
CN109308254B (en) Test method, test device and test equipment
WO2019169760A1 (en) Test case range determining method, device, and storage medium
CN101562618A (en) Method and device for detecting web Trojan
US20150095305A1 (en) Detecting multistep operations when interacting with web applications
CN106911694B (en) Automatic updating method based on ANDROID vulnerability knowledge base
CN102882716A (en) Ministry of industry and information technology recording detecting method and system
US9563541B2 (en) Software defect detection identifying location of diverging paths
US11899770B2 (en) Verification method and apparatus, and computer readable storage medium
CN106874758A (en) A kind of method and apparatus for recognizing document code
CN106383781B (en) Method and device for realizing code analysis
US9483447B2 (en) Method, device, and computer storage media for adding hyperlink to text
US8751508B1 (en) Contextual indexing of applications
CN105302700A (en) Method and equipment for recording user operation on touch terminal
CN116739795A (en) Knowledge graph-based insurance risk assessment method and device and electronic equipment
CN107908724B (en) Data model matching method, device, equipment and storage medium
CN109241706A (en) Software plagiarism detection method based on static birthmark
Thomas Exploring the usability and effectiveness of interactive annotation and code review for the detection of security vulnerabilities
Santos et al. Test-based SPL extraction: an exploratory study
CN107992992B (en) Unionpay IC card transaction data analysis system and method
US20180225286A1 (en) Changing a language for a user session replay

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