Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Software Engineering Expert

Section 1 #1. Just as with graphs, it is possible to generate an infinite number of tests from a grammar. How and what makes this possible?

We know that code generators translate graphical source language into textual language that implies a natural approach in representing the generator with the help of graphs set. Testing all input models that triggers any possible application sequence is impossible because of the large amount of combinatorial possibilities. Just like graphs it is possible to generate infinite numbers of tests from grammar by triggering any possible application sequence for testing. Even though, it would be impractical because ofunnecessary and large number of combinatorial possibilities. However, it would be vital to include as many tests a possible to reveal any errors in the code.

Section 2 #1. Consider the stream BNF in Section 1 and the ground string \B 10 06.27.94."Give three valid and three invalid mutants of the string. Stream BNF from section 5.1.1: G 17 08.01.90

B 13 06.27.94

G 13 11.21.94

B 04 01.09.03

Section 2 #2. Provide reachability conditions, infection conditions, propagation conditions, and testcase values to kill mutants 2, 4, 5, and 6 in table 1.

Original Method

 

With Embedded Mutants

int Min (int A, int B)

 

int Min (int A, int B)

{

 

{

int minVal;

 

int minVal;

minVal = A;

 

minVal = A;

if (B < A)

Δ1

minVal = B;

{

 

if (B < A)

minVal = B;

Δ2

if (B      > A)

}

Δ3

if (B < minVal)

return (minVal);

 

{

} // end Min

 

minVal = B;

 

Δ4

Bombo:

 

Δ5

minVal - A:

 

Δ6

minVal = failOnZero (B):

 

 

}

return (minVal);

 

 

1 // end Min

Table 1.

Section 2 #3. Answer questions (a) through (d) for the mutant in the two methods, findVal() andsum().

(a) If possible, find a test input that does not reach the mutant.

(b) If possible, find a test input that satisfies reachability but not infection for the mutant.

(c) If possible, find a test input that satisfies infection, but not propagation for the mutant.

(d) If possible, find a test input that strongly kills mutant m.

//Effects: If numbers null throw NullPointerException                //Effects: If x null throw NullPointerException

// else return LAST occurrence of val in numbers[]                      // else return the sum of the values in x

// If val not in numbers[] return -1

1. public static intfindVal (int numbers[], intval)                           1. public static int sum (int[] x)

2. {                                                                                          2{

3. intfindVal = -1;                                                                                3. int s = 0;

4.                                                                                             4. for (inti=0; i

5. for (inti=0; i

5'.// for (inti=(0+1); i

6. if (numbers [i] == val)                                                              6'.            // s = s - x[i]; //AOR

7. findVal = i;                                                                            7. }

8. return (findVal);                                                                     8. return s;

9. }                                                                                         9. }

Section 3 #1 Generate tests to satisfy PDC for the bank example grammar.

899_Finite state machine.png

bank ::= action*
action ::= dep | deb
dep ::= "deposit" account amount
deb ::= "debit" account amount
account ::= digit3
amount "$"digit + "."digit2
digit ::= "0" I "1" I "2" I "3" I "4" I "5" I "6" I "7" I "8" I "9"

1535_Finite state machine1.png

Section 3 #2 Consider the following BNF with start symbol A:

A::= B"@"C"."B

B::= BL | L

C::= B | B"."B

L::= "a" | "b" | "c" | ... | "y" | "z" and the following six possible test cases:

t1 = a@a.a

t2 = aa.bb@cc.dd

t3 = mm@pp

t4 = aaa@bb.cc.dd

t5 = bill

t6 = @x.y

For each of the six tests, (1) identify the test sequence as either \in" the BNF, and give a derivation, or (2) identify the test sequence as \out" of the BNF, and give a mutant derivation that results in that test. (Use only one mutation per test, and use it only one time per test).

Section 3 #3. Java provides a package, java.util.regex, to manipulate regular expressions. Write aregular expression for URLs and then evaluate a set of URLs against your regular expression.

This assignment involves programming, since input structure testing withoutautomation is pointless.

(a) Write (or find) a regular expression for a URL. Your regular expression does not need to be so general that it accounts for every possible URL, but give your best effort (for example "*" will not be considered a good effort). You are strongly encouraged to do some web surfing to find some candidate regular expressions.

One suggestion is to visit the Regular Expression Library.

(b) Collect a set of URLs from a small web site (such as a set of course web pages).

Your set needs to contain at least 20 (different) URLs. Use the java.util.regexpackage to validate each URL against your regular expression.

(c) Construct a valid URL that is not valid with respect to your regular expression (and show this with the appropriate java.util.regex call). If you have done an outstanding job in part 1, explain why your regular expression does not have any such URLs.

Software Engineering, Computer Science

  • Category:- Software Engineering
  • Reference No.:- M91698768
  • Price:- $70

Guranteed 36 Hours Delivery, In Price:- $70

Have any Question?


Related Questions in Software Engineering

Research projectin the course we have covered various

RESEARCH PROJECT In the course, we have covered various security and privacy issues that arise in the cyberspace field. We have learned to identify these risks and have discussed the current approaches and developments f ...

Write reply to this article with references with apa

Write reply to this article with references with APA bibliography. Hate Crimes Over the past couple of years, hate crimes have been on the rise in America's largest cities. Studies show that there were sharp spikes in th ...

The research paper for this course is about some of the

The research paper for this course is about some of the best sources of digital evidence for child abuse and exploitation, domestic violence, and gambling according to the National Institute of Justice. Research commerci ...

Instructions - onion routingin this assignment you will

INSTRUCTIONS - ONION ROUTING In this assignment, you will answer the following questions related to Onion Routing and Tor. 1. Describe the infrastructure of Onion Routing and explain how it works for providing anonymity ...

Reply to this article with apa referencehate crimes

Reply to this article with APA reference. Hate crimes According to Merriam-Webster, hate crime is any of various crimes (such as assault or defacement of property) when motivated by hostility to the victim as a member of ...

Overviewyou are required to modify and logically extend

Overview You are required to modify and logically extend the functionality of a provided code base to implement a game. This requires you to modify the code base as well as create documentation and implement various user ...

In this assignment you will answer the following questions

In this assignment, you will answer the following questions related to Android platform and Android security design. 1. Describe Android architecture in detail by explaining the four conceptual layers. 2. Describe Androi ...

Write review on this article with apa formatgovernment

Write review on this article with APA format. Government surveillance is a major issue in the United States and globally. Surveillance refers to any collection and processing of personal data, whether, identifiable or no ...

Assignment lab - statement of workclient liberty vacation

Assignment Lab - Statement of Work Client: Liberty Vacation Planning Inc. (LVP) Project: Website Assessment 1. Project Objectives With this statement of work, LVP is engaging you to conduct a website assessment to determ ...

Address the following integrating biblical perspectives

Address the following, integrating biblical perspectives where appropriate: Define a hate crime and describe how white supremacist groups use the Internet to spread their message of hate. Explain why hate crime legislati ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As