Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is the program listing for which I would like to answer the questions from 1 to 4. It is not a working program. It

Below is the program listing for which I would like to answer the questions from 1 to 4. It is not a working program. It is related to structural testing.

(a).Use structured programming constructs to draw the program graph

(b) Compute the cyclomatic complexity

(c) Determine a set of basis paths through the graph

(d) The test cases that will exercise the basis paths by determining the outcomes of the conditions at each of the predicate nodes in the program graph. Present the test cases in a table for easy understanding.

1. public static void main(String[] args) {

2. double a1 = 1.0;

3. double a2 = 2.0;

4. double a3 = 3.0;

5. if (c1) {

6. r1 = rate * 1.1;

7. r2 = rate * 2.1;

8. } else {

9. r3 = rate * 3.1;

10. r4 = rate * 4.1; }

11. while (c2) {

12. a5 = r1 * r3;

13. a6 = r2 * r4;

14. switch (c3) {

15. case 'A1':

16. a7 = a1 + a5;

17. a8 = a3 * a2;

18. break; // End Case A1

19. case 'A2':

20. s1 = a5 + a6 ;

21. s2 = s1 * a3;

22. if (c4) {

23. s3 = s2 * 1.5;

24. s4 = s2 * 2.0;

25. } else {

26. s3 = s2 * s1;

27. s4 = s2 * s2;}

28. break; // End Case A2

29. case 'A3':

30. s5 = a6 + a5 * a1;

31. s6 = a6 + * (a1 / a2);

32. break; // End Case A3

33. default:

34. System.out.println("Invalid");

35. } // End Switch

36. t1 = s3 * s4;

37. t2 = s3 * s5;

38. t3 = s4 * s6;

39. if (c5) {

40. t4 = t3 * 9.99;}

41. t5 = t1 + t2 ;

42. } // End While

43. System.out.println("Computation complete!");

44. }

Please help me answer all questions especially d part. I am not able to understand what to prvide in part d.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions