发明名称 Method for finding all valid interprocedural execution paths on COBOL in polynomial time
摘要 Disclosed are methods for finding all valid paths in a COBOL program. These methods are performed in polynomial time, allowing them to be scaled to accommodate large COBOL programs. As the methods find all valid paths in COBOL program code, by traversing and marking the nodes of the program upon being traversed. Accordingly, all usable and reachable code is indicated and marked. This increases safety when working with the code, as removal or alteration of such valid code is indicated, and thus, made unlikely.
申请公布号 US9280446(B2) 申请公布日期 2016.03.08
申请号 US201414194821 申请日期 2014.03.03
申请人 International Business Machines Corporation 发明人 Abadi Aharon;Abadi Moria;Ettinger Ran;Feldman Yishai
分类号 G06F9/44;G06F11/36;G06F9/45 主分类号 G06F9/44
代理机构 代理人
主权项 1. A computer-implemented method for scanning valid executable paths of a COBOL program to find all reachable code comprising: scanning a successive node in paragraphs of the COBOL program, according to an order of execution of the COBOL program, wherein each node in the paragraphs of said COBOL program is a statement including at least part of a line of code; marking the scanned node in accordance with an index value; moving to a successive unmarked node of the scanned node; analyzing the successive unmarked node for determining a type of the successive unmarked node, and determining a continued executable path for scanning based on the type of the successive unmarked node, wherein determining the continued executable path for scanning based on the type of the successive unmarked node comprising: when the successive unmarked node type is an internal node, successor nodes are scanned until an End of Paragraph (EOP) node is reached,when the successive unmarked node type is a CALL node for a called paragraph, nodes of the called paragraph are scanned, until an End of Paragraph (EOP) EOP node is reached,when the successive unmarked node type is a RESUME node, and is arrived at after a CALL node was previously scanned, a return edge is taken to the next successive unmarked node,marking each scanned node with an increased value for the index;when an index value of the CALL node is greater than a node entered after the CALL node, a FALL-THROUGH edge is taken to a next successive unmarked node; and continuing to scan all unmarked successive nodes until only marked nodes are reachable, wherein all of the valid executable paths in the COBOL program include all reachable code in the reachable paragraphs of the COBOL program, and all of the reachable code is found in polynomial time.
地址 Armonk NY US