Research Article
A Coverage and Slicing Dependencies Analysis for Seeking Software Security Defects
Algorithm 2
Traversal algorithm: traverse (var).
Input: the execution path (given in the form of program code fragment) | Output: program slicing (the set , number of element) | Symbol indicates: | Left: Each code line of the left chain | Right: Each code line of the right chain | Strore: Storage table | Var: Specified variable | L_pointer: Left temporary pointer variables | R_pointer: Right temporary pointer variables | Initialization: | (1) {Repeat | (2) Left = store -> left | (3) Right = store -> right | (4) line_num = | (5) L_pointer = left | (6) {Repeat: L_pointer = L_pointer -> next | (7) If (L_pointer -> name) == var | (8) go to 13 | (9) Until L_pointer == null} | (10) go to 1 | (11) Until (L_pointer -> name) == var} | (12) Add line_num to //code line numbers added to set | (13) R_pointer = right | (14) {Repeat R_pointer = R_pointer -> next | (15) var = R_pointer -> name | (16) traverse (var) // Recursive traversal algorithm | (17) Until R_pointer == null}// Find next to the variable field is null | (18) {Repeat //Simplified repeat statements in collection | (19) | (20) {Repeat | (21) if | (22) delete | (23) Until | (24) Until |
|