Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Software Engineering Expert

PART 1: Short Answers

1. Briefly discuss the relationship between integration testing, unit testing and system test.

2. Code Analysis: int Calculate (int x, int y) {
int total=0; if (x>30) {
total=(x*40+y*50)*.95;
}
else
total=x+y;

for (int i=0;i}
return total;
}

a. Draw the control flow graph for this code.

b. What are the test cases to achieve statement coverage for this code?

c. What additional test cases (if any) are required for branch coverage?

d. Is it possible to test all paths through this module?

3. A car insurance company "Simplicity" provides insurance cover for motor vehicles. When a customer applies for a quote on insurance, the agent requests the following information:
1. Vehicle year of registration and make (e.g. Toyota, 2001)
2. Age of the driver
The system outputs a quote for insurance.

Use EP to do testing analysis and find the necessary test cases (15 marks)

PART 2: Long answers

1. Testing a Stack class (25 marks)

Here is Java code for a simple Stack class provided:

class Stack
{
int number; // number of items in the stack
int limit; // limit on number of items in the stack int increment; // incremental number to be added int array[ ]; // stack contents

Stack(int limit)
{
this.limit = limit; // set instance variable to argument value increment = limit; // use increment for limit
array = new int[limit]; // create array
number = 0; // stack contains no items initially
}

void ensure() // make sure push is possible
{
if( number >= limit )
{
int newArray[] = new int[limit+increment]; // create new array for( int i = 0; i < limit; i++ )
{
newArray[i] = array[i]; // copy elements in stack
}
array = newArray; // replace array with new one limit += increment; // augment the limit
}
}

void push(int x)
{
ensure();
array[number++] = x; // put element at position number and increment
}

int pop()
{
return array[--number]; // decrement number and take element
}

boolean empty()
{
return number == 0; // see if number is 0
}

public static void main(String arg[])
{
int limit = new Integer(arg[0]).intValue(); Stack s = new stack(limit);
for( int i = 0; i < limit; i++ )
{
s.push(i);
}
while( !s.empty() )
{
System.out.println(s.pop());
}
}
}

How would you test this class?
Hint: I am looking for as complete and detailed an answer as you can give in the time available. I am looking for both a discussion of overall strategies (how will you approach the task) as well as a small number of specific test cases.

3. OO programming might provide an easy way for testing. Please explain it with examples (15 marks).

PART 3: Multiple Choice

1. Black-box Testing attempts to find errors in which of the following categories
a. Incorrect or missing functions
b. Interface errors
c. Performance errors
d. All of the above

2. Condition coverage that executes possible combinations of condition outcomes of each decision is called as .
a. Black box Testing
b. White box Testing
c. Integration Testing
d. Acceptance Testing

3. Testing all possible paths through a module is:
a. The strongest whitebox coverage criteria
b. The strongest blackbox coverage criteria
c. Not possible to achieve if the module has loops
d. Both a and c are correct

4. Which is NOT true - The black box tester:
a. should be able to understand a functional specification or requirements document
b. should be able to understand the source code
c. is highly motivated to find faults
d. is creative to find the system's weaknesses

5. Unreachable code would best be found using: code inspections
code review
a coverage tool
a static analysis tool

6. Statement Coverage will not check for the following:
a) Missing Statements
b) Unused Branches
c) Dead Cod
d) Unused Statement

7. Verification is:
a) Checking that we are building the right system
b) Checking that we are building the system right
c) Making sure that it is what the user really wants
d) Performed by an independent test team

8. Which testing phase tests individual software modules combined together as a group?
a) Module testing
b) Integration testing
c) White Box testing
d) Software testing

9. A shopping website gives discount based on prices of total purchased items. Suppose customer purchases are below 2000 rs. then no discount,for purchases till 20000, it gives 10% discount and above 20000 it gives 15% discount. Which of the following sets of values lie in 3 different equivalence classes?

a) 1800,2000,8000
b) 2001,10000,20002
c) 1800, 2003,58,000
d) 100,1800,20001

10. A theme park charges entry fee based on age group. For children below 3 it charges nothing, for 3-10 it charges 500/-, for 10-18 it charges 800/-,then for 18-60 it charges 1000 and above 60 it charges 500 again. Using boundary value analysis, what will be the values to test if person pays 500 rs entry fee?

a) 0,2,3
b) 2,3,10,11,59,60,100,101
c) 2,3,10,11,59,60,100,101
d) 59,60,100,101

Software Engineering, Computer Science

  • Category:- Software Engineering
  • Reference No.:- M92782299
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Software Engineering

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 ...

In this assignment you will answer the following review

In this assignment, you will answer the following review questions from the reading materials of the module/week. 1. "What are the key components of a typical P2P application? Describe their functions." 2. "What are the ...

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 ...

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 ...

Proposaldesign of an efficient gps tracking system tag for

Proposal Design of an efficient GPS Tracking System (tag) for monitoring small species IMPLEMENTING EMBEDDED SYSTEMS USING SYSML Task Using PapyrusSysML Software (Downloadable online - Evaluation Copy- Latest Version) Mo ...

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 ...

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 ...

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 ...

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 ...

Assignment part 1objectives to learn to identify the

Assignment Part 1 Objectives: To learn to identify the relevant use cases for a given application, describe the use cases and develop an object-oriented domain model. Problem Statement - Standing Orders Management System ...

  • 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