Q1) Define each of the following terms: 1) Fault 2) Error 3) Failure

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
QI) Define cach of the following terms:
1) Fault
2) Error
3) Failure
Q2) Study the shown code below then answer the following questions.
public static int oddorPos (int(] x)(
//Effects:
//else return the number of elements in x that
//
int count = 0;
if x is null throw NullPointerException
are either odd or positive (or both)
for (int i = 0; i < x.length; i++) |
if (x[1] 2 == 1 || x[i] > 0)
count++;
return count;
x- [-3, -2, 0, 1, 4]
Expected = 3
//test:
1) Explain what is wrong with the given code. Bescribe the fault precisely by proposing a
modification to the code.
2) If possible, give a test case that does not execute the fault. If not, briefly explain why not.
3) If possible, give a test case that exccutes the fault, but does not result in an error state. If not,
briefly explain why not.
4) If possible give a test case that results in an error, but not a failure. If not, briefly explain why
not. Hint: Don't forget about the program counter.
5) For the given test case,
6) Write the proper JUnit test methods for the previous questions.
describe the first error state. Be sure to describe the complete state.
Transcribed Image Text:QI) Define cach of the following terms: 1) Fault 2) Error 3) Failure Q2) Study the shown code below then answer the following questions. public static int oddorPos (int(] x)( //Effects: //else return the number of elements in x that // int count = 0; if x is null throw NullPointerException are either odd or positive (or both) for (int i = 0; i < x.length; i++) | if (x[1] 2 == 1 || x[i] > 0) count++; return count; x- [-3, -2, 0, 1, 4] Expected = 3 //test: 1) Explain what is wrong with the given code. Bescribe the fault precisely by proposing a modification to the code. 2) If possible, give a test case that does not execute the fault. If not, briefly explain why not. 3) If possible, give a test case that exccutes the fault, but does not result in an error state. If not, briefly explain why not. 4) If possible give a test case that results in an error, but not a failure. If not, briefly explain why not. Hint: Don't forget about the program counter. 5) For the given test case, 6) Write the proper JUnit test methods for the previous questions. describe the first error state. Be sure to describe the complete state.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY