Question

In: Computer Science

Program Slicing Assignment 1- Choose a program you’d like to analyze. Explain what the program’s purpose...

Program Slicing Assignment

1- Choose a program you’d like to analyze. Explain what the program’s purpose is and how many lines of code it has.

2- Browse the tools necessary for slicing and install if you haven’t already done so.

If there is a problem with the tool, and you would not like to use it, explain:

What the tool is used for, and why wouldn’t use it.

3- demonstrate static, dynamic, forward, and backward slicing using a slicing criterion.

In a documentation, submit examples and descriptions of each static and dynamic slicing. Submit descriptions and examples of forward and backward slicing.

3- demonstrate static, dynamic, forward, and backward slicing using a slicing criterion.

Solutions

Expert Solution

As it is not mentioned which question needs to be done, I am doing the first two questions of this assignment

(A) I would like to analyze a program which helps to find the factorial of a number

Purpose -: The purpose of this program is to find the factorial of the user inputted number using recursive function.

Number of lines in the code is as follows -:

14 physical lines of code excluding whitespace, including logical lines of codes

PROGRAM -:

class Test {

static int factorial(int n)

{

if(n == 0)

return 1;

return(n* factorial(n-1))

}

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();

System.out.println( "Factorial of " + num + " is " + factorial(num));

    }

}

(B) A tool that I browsed and installed for the purpose of program slicing is CodeSurfer.

CodeSurfer is a tool that gives eases reading and understanding of code and also provides a variety of effects of the code and its effect.

There is one problem with this tool is that 100k lines of code is the upper bound. No integration with eclipse, visual studio, etc.


Related Solutions

The purpose of this assignment is to choose a compensation philosophy that is appropriate for a...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a life coaching firm and articulate a rationale for this selection. There are two aspects to this assignment. First, describe the risks and benefits of leading, meeting, and lagging the market in overall compensation and benefits. Next, choose the appropriate strategy (lead, meet, or lag) for your firm, and provide rationale about why this is appropriate. There is a minimum requirement of 500 words for...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a life coaching firm and articulate a rationale for this selection. There are two aspects to this assignment. First, describe the risks and benefits with leading, meeting, and lagging the market in overall compensation and benefits. Next, choose the appropriate strategy (lead, meet, or lag) for your firm, and provide rationale about why this is appropriate. There is a minimum requirement of 500 words for...
Baye suggests some ways to assess markets. Choose any market that you’d like and assess the...
Baye suggests some ways to assess markets. Choose any market that you’d like and assess the concentration of firms and its impact on competition. ~1-2 pages.
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of one dimensional arrays and methods.(Need Comment, Write by Java Code) Instructions Write a method rotateArray that is passed to an array, x, of integers (minimum 7 numbers) and an integer rotation count, n. x is an array filled with randomly generated integers between 1 and 100. The method creates a new array with the items of x moved forward by...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use and re-use of methods with input validation. Instructions It is quite interesting that most of us are likely to be able to read and comprehend words, even if the alphabets of these words are scrambled (two of them) given the fact that the first and last alphabets remain the same. For example, “I dn'ot gvie a dman for a man taht...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of one dimensional arrays and methods. Instructions Write a method rotateArray that is passed to an array, x, of integers (minimum 7 numbers) and an integer rotation count, n. x is an array filled with randomly generated integers between 1 and 100. The method creates a new array with the items of x moved forward by n Elements that are rotated...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of two dimensional arrays, input validation, and methods. (Write by Java Code, Need Comment) Instructions A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: Seat Ticket Price 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
Assignment Purpose The purpose of this lab is to write a well-commented java program that demonstrates...
Assignment Purpose The purpose of this lab is to write a well-commented java program that demonstrates the use of loops, and generation of random integers. Instructions You are taking some time off from your paint business and currently are on vacation in Bahamas. You decide to write a Java program that generates 10 random numbers between 1 and 20 (all integers). You cannot use arrays (even if you know what they are) to store these numbers. It then picks up...
You’d like to install routers in a room without a power outlet. Explain the Ethernet standard...
You’d like to install routers in a room without a power outlet. Explain the Ethernet standard that will allow you to do that.
The purpose of this assignment is to develop a security program aligned with regulatory compliance and...
The purpose of this assignment is to develop a security program aligned with regulatory compliance and security control frameworks. Select a company for the focus of your assignment. Using the following, map the standard controls to the regulatory compliance that would be appropriate for the organization: The "Security Controls Mapping Template." Regulatory compliance information, such as HIPAA, PCI, SOX, GLBA, etc. Security control frameworks, such as NIST, CIS, COBIT, COSO, ITIL, etc. On the template, map the regulatory rules (one...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT