Precise Detection of Un-Initialized Variables    In Large, Real-life Cobol Programs    In Presence Of Unrealizable Paths  ...
AgendaMotivationUn-Initialized VariablesResultsUnrealizable PathsSolutionHeuristics                           2
Typical Maintenance Scenario   Failure                                              Change                                ...
Case Study            Background                                    Concerns• Core banking product                       •...
Case Study           Branch A            Request for RD                                acct closure                       ...
Un-Initialized Variablesdouble calculatePoints                                     1(char cardType, double amt)           ...
Results                           Un-Initialized           Program                        Variables Instances           AB...
Results                     Un-Initialized Variables70006000500040003000                                                Co...
Context-Insensitive Analysis          Paragraph            • Paragraph - A set of statements 1. A.                        ...
Context-Insensitive Analysis 1. A.                                        E 2. MOVE 0 TO VA                           E 3....
Context-Insensitive Analysis 1. A.                                   VA   E 2. MOVE 0 TO VA                           E 3....
Context-Insensitive Analysis 1. A.                                   VA    E 2. MOVE 0 TO VA                           E 3...
Context-Insensitive Analysis 1. A.                                   VA    E 2. MOVE 0 TO VA                           E 3...
Context-Insensitive Analysis1. A.                                   VA    E2. MOVE 0 TO VA                            E3. ...
Unrealizable Paths                          E        E                     E                          6        2          ...
Design ChallengesPerform ChainParagraph level informationParagraph range level informationData flow equations:    NBottom ...
Context-Insensitive Analysis 1. A.                                        E 2. MOVE 0 TO VA                           E 3....
Context-Insensitive Analysis 1. A.                                        E 2. MOVE 0 TO VA                           E 3....
Context-Insensitive Analysis 1. A.                                        E 2. MOVE 0 TO VA                           E 3....
Context-Insensitive Analysis 1. A.                                        E 2. MOVE 0 TO VA                           E 3....
Results                         Un-Initialized          Program                     Variables Instances          AB0000   ...
HeuristicsBad Code Smells RemovalUtility-Parameter based PrioritizationFan-in based Prioritization                        ...
Heuristics Results350030002500                                           Context Sensitive2000                            ...
Future WorkHeuristics– Error-path pruning– Output-variable basedDynamic AnalysisUn-Initialized path detection             ...
Key LearningPrecise detection of un-initialized variablesHeuristicsRealizable data-flow analysis across Paragraphs for COB...
Thank You            26
Upcoming SlideShare
Loading in...5
×

Industry - Precise Detection of Un-Initialized Variables in Large, Real-life COBOL Programs in Presence of Un-realizable Paths

322

Published on

Paper: "Precise Detection of Un-Initialized Variables in Large, Real-life COBOL Programs in Presence of Un-realizable Paths"

Authors: Rahul Jiresal, Adnan Contractor and Ravindra Naik

Session: Industry Track Session 4: Program analysis and Verification

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
322
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Industry - Precise Detection of Un-Initialized Variables in Large, Real-life COBOL Programs in Presence of Un-realizable Paths

  1. 1. Precise Detection of Un-Initialized Variables In Large, Real-life Cobol Programs In Presence Of Unrealizable Paths Adnan Contractor Ravindra Naik Rahul Jiresal 1
  2. 2. AgendaMotivationUn-Initialized VariablesResultsUnrealizable PathsSolutionHeuristics 2
  3. 3. Typical Maintenance Scenario Failure Change Request• Re-produce Code Changes• Analysis • Understand • Testing • Impact Analysis • ProductionConjecture Analysis Changes Delivered Code Change Failures & Efforts Automated Tools 3
  4. 4. Case Study Background Concerns• Core banking product • Repeated failure of transactions• Stable back-office COBOL • Not so-easily-reproducible failures applications • Longer turn-around time• Over 1 million transactions daily Examples… Transaction for Recurring Deposit account change of base A Forex transaction closure fails whenever branch fails failing only after 6PM triggered at the same time at randomly two different branches Not yet 5 days 8 months fixed 1 day 10 days 4
  5. 5. Case Study Branch A Request for RD acct closure Check Balance Notify balance to customerCustomer Banker Request for RD acct closure Branch B Check Balance Notify balance to customer Fire Close acct commandCustomer Banker Fire Close acct 5 command
  6. 6. Un-Initialized Variablesdouble calculatePoints 1(char cardType, double amt) 21 float rate; double points; 42 if (cardType == ‘G’) 33 rate = 0.005;4 elseif (cardType == ‘S’) 55 rate = 0.001; 66 points = amt * rate;7 return points; 7 6
  7. 7. Results Un-Initialized Program Variables Instances AB0000 1317 6090 CR0000 1173 4313 CR0025 336 871 CR7070 74 253 AB0024 59 120 Context-insensitive Analysis Results 7
  8. 8. Results Un-Initialized Variables70006000500040003000 Context-insensitive2000 Context-sensitive1000 0 AB0000 CR0000 CR0025 CR7070 AB0024 Program 8
  9. 9. Context-Insensitive Analysis Paragraph • Paragraph - A set of statements 1. A. represented by a label. Can be executed 2. MOVE 0 TO VA as a unit. 3. PERFORM P. 4. 5. B. 6. MOVE 1 TO VB • Perform - Using PERFORM statement 7. MOVE 1 TO VA Perform one can execute a paragraph. 8. PERFORM P 9. MOVE VB TO MV.10.11. P.12. MOVE 5 TO VF. 9
  10. 10. Context-Insensitive Analysis 1. A. E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 X 10
  11. 11. Context-Insensitive Analysis 1. A. VA E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 X 11
  12. 12. Context-Insensitive Analysis 1. A. VA E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 VA, VF X 12
  13. 13. Context-Insensitive Analysis 1. A. VA E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. VA, 810. VF X VA,11. P. VF12. MOVE 5 TO VF. X 9 VA, VF X 13
  14. 14. Context-Insensitive Analysis1. A. VA E2. MOVE 0 TO VA E3. PERFORM P. E4. 65. B. 26. MOVE 1 TO VB VA 12 77. MOVE 1 TO VA8. PERFORM P 3 VA, VB9. MOVE VB TO MV. VA, 810. VF X VA,11. P. VF12. MOVE 5 TO VF. X 9 VA, VF X 14
  15. 15. Unrealizable Paths E E E 6 2 12 7 3 8 X X 9 X 15
  16. 16. Design ChallengesPerform ChainParagraph level informationParagraph range level informationData flow equations: NBottom = [ Ntop – KillSump ] ∪ GenSump GenSump = Defined (p) KillSump = Ø 16
  17. 17. Context-Insensitive Analysis 1. A. E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 X 17
  18. 18. Context-Insensitive Analysis 1. A. E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 X 18
  19. 19. Context-Insensitive Analysis 1. A. E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. 810. X11. P.12. MOVE 5 TO VF. X 9 VF X 19
  20. 20. Context-Insensitive Analysis 1. A. E 2. MOVE 0 TO VA E 3. PERFORM P. E 4. 6 5. B. 2 6. MOVE 1 TO VB VA 12 7 7. MOVE 1 TO VA 8. PERFORM P 3 VA, VB 9. MOVE VB TO MV. VA, 810. VF X VA,11. P.12. MOVE 5 TO VF. X 9 VB VF ,VF X 20
  21. 21. Results Un-Initialized Program Variables Instances AB0000 737 2945 CR0000 838 3001 CR0025 187 437 CR7070 30 60 AB0024 48 103 Context-sensitive Analysis Results 21
  22. 22. HeuristicsBad Code Smells RemovalUtility-Parameter based PrioritizationFan-in based Prioritization 22
  23. 23. Heuristics Results350030002500 Context Sensitive2000 Analysis Code Smell Removal15001000 Utility Parameter removal500 0 AB0000 CR0000 CR0025 CR7070 23
  24. 24. Future WorkHeuristics– Error-path pruning– Output-variable basedDynamic AnalysisUn-Initialized path detection 24
  25. 25. Key LearningPrecise detection of un-initialized variablesHeuristicsRealizable data-flow analysis across Paragraphs for COBOLTechnique can be extended to other analyses – defectdetection, program understanding, code architecture discovery 25
  26. 26. Thank You 26
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×