public static int[] goodResize(int[] list, int newSize) { assert list != null && newSize >= 0 : "failed precondition"; int[] result = new int[newSize]; int limit = Math.min(list.length, newSize); for(int i = 0; i < limit; i++) { result[i] = list[i]; } return result; } **Note: Software testing & quality assurance Question: Create a control flow graph (CFG) based on the coding above and find all these paths Statement coverage Branch coverage Predicate coverage
public static int[] goodResize(int[] list, int newSize) { assert list != null && newSize >= 0 : "failed precondition"; int[] result = new int[newSize]; int limit = Math.min(list.length, newSize); for(int i = 0; i < limit; i++) { result[i] = list[i]; } return result; }
|
**Note: Software testing & quality assurance
Question: Create a control flow graph (CFG) based on the coding above and find all these paths
- Statement coverage
- Branch coverage
- Predicate coverage
Step by step
Solved in 2 steps with 2 images