Summary
1. public String t(String str) { 2. final String G = “A+A B+B C+C D+D E F ”; 3. final String P = “9 8 7 6 5 4 3 2 1 0 ”; If (! str.matches(“[^ABCDEF]+”)) return str; for (int i = 0; i < str.length(); index++) { int pos=G.substr(i,2); String n = P.substr(i,2); str = str.substring(0,i)+n+s.substring(i+2); } return str ; 12. }
1. public String t(String str) { 2. final String G = “A+A B+B C+C D+D E F ”; 3. final String P = “9 8 7 6 5 4 3 2 1 0 ”; If (! str.matches(“[^ABCDEF]+”)) return str; for (int i = 0; i < str.length(); index++) { int pos=G.substr(i,2); String n = P.substr(i,2); str = str.substring(0,i)+n+s.substring(i+2); } 12. return str ; 13. }
Program Graph 1 12 6 2 7 8 9 3 10 4 11 5 13
DD-Path 1 A I 12 E 6 Case 1 2 B F 7 H 8 Case 2 Case 3 9 H 3 B Case 4 H 10 Case 5 C 4 11 H 5 D L 13
DD-Path Graph A E I B F H C D L
Common Program Text Coverage Models Statement Coverage Segment Coverage Branch Coverage Multiple-Condition Coverage