Question: Instructions: 1. For each case study belowcase study 1 and 2). answer all of the following questions: i. Draw the control flow graph of the

 Instructions: 1. For each case study belowcase study 1 and 2).

Instructions: 1. For each case study belowcase study 1 and 2). answer all of the following questions: i. Draw the control flow graph of the code. ii. List down the possible test paths in order to achieve 100% test coverage for statement coverage. (test path should be written using this format. SnCn it. List down the possible test paths in order to achieve 100% test coverage for decision coverage (test path should be written using this format, Sn+Cn+) iv. List down the possible test paths in order to achieve 100% test coverage for branch coverage (test path should be written using this format SnCn.) V. Calculate Cyclomatic Complexity value for path coverage. You may use any of cyclomatic metric formula vi. How many test cases need to be created to test the control-flow of that particular case-study? Write each test case. Write your test case using the following format: Test Case ID Test Case Description: Test Data: Test Path: Expected Result Case Study 2 The following function in Figure 2 shows a function to calculate a factorial for any input number. int factorial (int n) /Calculate a factorial using loop. A factorial of a number is the product of the number itself times the factorial of the number minus 1: i.ent = nxin-1)..1/ int i = -1; if in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!