ICT2201-P2-9 / Music-School

0 stars 0 forks source link

[M3] White Box Testing #54

Closed RexxarAng closed 1 year ago

RexxarAng commented 1 year ago

This section should include a suitably complex method from a class inside your system. The code representation of this class can be pseudocode (logically correct and translatable into actual code) or actual code. You are expected to show CFG, Complexity and use basis testing to achieve appropriate coverage for your test cases, as well as a set of test cases which address each path identified

RexxarAng commented 1 year ago

CFG https://drive.google.com/file/d/1yp14kRDD9zq6fVEa9A64jzXB-yYinuYN/view?usp=sharing

Code for job allocation

Image

RexxarAng commented 1 year ago

Image

Cyclomatic Complexity = E - N + 2P = 40 - 32 + 2(1) = 10

Determine a set of basis paths

Steps

  1. Pick a “baseline” path that corresponds to normal execution (aim to have as many decisions as possible)
  2. To get succeeding basis paths, back track the baseline until you reach a decision node. “Flip” the decision (take another alternative) and continue as much of the baseline as possible
  3. Repeat this until all decisions have been flipped. When you reach V(G) basis paths, you’re done!

Determine a set of basis paths

Steps

  1. Pick a “baseline” path that corresponds to normal execution (aim to have as many decisions as possible)
  2. To get succeeding basis paths, back track the baseline until you reach a decision node. “Flip” the decision (take another alternative) and continue as much of the baseline as possible
  3. Repeat this until all decisions have been flipped. When you reach V(G) basis paths, you’re done!

Path 1: 1-2-3-32

Path 2: 1-2-4-5-32

Path 3: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-19-20-32

Path 4: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-19-21-23-24-25-26-27-18-29-30-31-32

Path 5: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-19-21-23-24-25-26-27-18-19-21-22-26-27-18-29-30-31-32

Path 6: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-19-21-23-24-25-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-28-32

Path 7: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-19-21-23-24-25-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-19-21-22-26-27-18-29-30-31-32

Path 8: 1-2-4-6-7-8-9-10-11-12-14-15-16-17-18-29-30-31-32

Path 9: 1-2-4-6-7-8-9-8-12-13-32

Path 10: 1-2-4-6-7-8-12-13-32

RexxarAng commented 1 year ago

Test Cases


Path | Instrument qualified | Instrument for job | Instrument in studio | Availability | New job time period | Allocated jobs time periods | Result -- | -- | -- | -- | -- | -- | -- | -- 1 | Drums | Piano | Drums, Piano, Violin, Trumpet | 0900-1300 | 1100-1130 | 1200-1230 | F 2 | Drums | Drums | Piano, Violin, Trumpet | 0900-1300 | 1100-1130 | 1200-1230 | F 3 | Drums | Drums | Drums, Piano, Violin, Trumpet | 0900-1300 | 1100-1130 | 1100-1130 | F 4 | Piano | Piano | Drums, Piano, Violin, Trumpet | 0900-1500 | 1400-1430 | 1330-1400 | T 5 | Drums | Drums | Drums, Piano, Violin, Trumpet | 0900-1500 | 1300-1330 | 0900-0930
0930-1000 | T 6 | Drums | Drums | Drums, Piano, Violin, Trumpet | 0900-1500 | 1300-1330 | 0900-0930
0930-1000
1000-1030
1030-1100
1100-1130
1130-1200
1200-1230
1230-1300 | F 7 | Drums | Drums | Drums, Piano, Violin, Trumpet | 0900-1500 | 1400-1500 | 0900-0930
0930-1000
1000-1030
1030-1100
1100-1130
1130-1200
1200-1230
1230-1300 | T 8 | Piano | Piano | Drums, Piano, Violin, Trumpet | 0900-1500 | 1000-1030 |   | T 9 | Piano | Piano | Drums, Piano, Violin, Trumpet | 0900-1500 | 1500-1530 |   | F 10 | Piano | Piano | Drums, Piano, Violin, Trumpet |   | 1500-1530 |   | F