SER216 Final
Which of the following are fault tolerance techniques? Unit testing System testing Exception Handling Configuration Management
Exception Handling
Any deviation of the observed behavior from the specified behavior
Failure
Annotating a public void method with @AfterClass causes that method to be run after each Test method. Is it true or false?
False
Unit testing is the same as refactoring. True or false?
False
What is the purpose of the sleep method of the thread class ?
Puts the thread to sleep for the specified time in milliseconds
If possible, identify a test case that does not execute the fault (in the above program Code Analysis 1).
Test Input: x=[]; Expected output = 0
What is a Test Fixture?
fixed state of a set of objects used as a baseline for running tests
Code Analysis 2 Below is a faulty program. It includes a test case that results in failure. Answer the following questions Code Analysis 2: a through d about this program. public static int lastZero (int[] x){ //Effects: if x==null throw NullPointerException // else return the index of the LAST 0 in x. // Return -1 if 0 does not occur in x for (int i = 0; i < x.length; i++) { if (x[i] == 0) { return i; } } return -1; } // Test input: x=[0, 1, 0] // Expected output = 2 Identify the fault in the above program (Code Analysis 2).
for loop is incorrect: it is iterating from low to high
Blackbox testing is also known as
functional testing
A limited logging meeting
gathers a limited group together from among the total set of reviewers
Which of the following annotation causes that method to be run after each test method?
@After
The server listens for a connection request from a client using the following statement: A. Socket s = serverSocket.accept() B. Socket s = new Socket(ServerName); C. Socket s = serverSocket.getSocket() D. Socket s = new Socket(ServerName, port);
A. Socket s = serverSocket.accept()
A mechanical or algorithmic cause of an error is a Fault Bug Defect All of the above
All of the above
What are the types of Integration Testing? Big Bang Testing Bottom Up testing Top down testing All of the above
All of the above
Which of the following are ways to deal with faults? Fault detection Fault tolerance Fault avoidance All of the. above
All of the above
What is the opacity of system testing
Blackbox testing
What are some of the product standards defined and used is software quality management? Design Review Form Java Programming Style Change Control Process Method Header Format Version Release Process Test Recording Process
Design Review Form Java Programming Style Method Header Format
_________ are the Testers of Unit Testing.
Developers
In the context of Integration Testing, a component that calls the TestedUnit and controls the test cases is called __________.
Driver
Which of the following are strategies of Black box testing? Test Automation Equivalence Class Partitioning Boundary Value Analysis Decision Table Testing Acceptance Testing Regression Testing
Equivalence class partitioning Boundary value analysis Decision table testing
Which of the following are important features of JUnit It is open source framework Provides annotations to identify the test methods Provides testing for the entire software system JUnit tests can be run automatically JUnit tests can be organized into test suites Provides fixes for test cases that failed Provides mechanism for customers to test the system
It is open source framework Provides annotations to identify the test methods JUnit tests can be run automatically JUnit tests can be organized into test suites
Equivalence class partitioning is used to: find the very-common bugs that lurk in the corner record complex business rules that the system must implement and that must be tested manage the number of test cases run None of the above
Manage the number of test cases run
What is a fault or bug?
Mechanical or algorithmic cause of an error
If possible, identify a test case that does not execute the fault (in the above program Code Analysis 2).
No
Bottom-up integration testing has as it's major advantage(s) that ____________.
No stubs need to be written
What is Validation (in testing terminology)?
Process of checking for deviations between observed behavior of a system and its specification
The client requests a connection to a server using the following statement:
Socket s = new Socket(ServerName, port);
Whitebox testing is also known as
Structural testing
In the context of Integration Testing, a component the TestedUnit depends on and is a partial implementation that returns fake values is called __________.
Stubs
If possible, identify a test case that executes the fault, but does not result in an error state (in the above program Code Analysis 2).
Test Input: x=[ 0]; Expected output = 0
If possible, identify a test case that executes the fault, but does not result in an error state (in the above program Code Analysis 1).
Test Input: x=[-4, 1, 5]; Expected output = 2
Which of the following are JUnit classes? TestCase Assert Math Refactor UnitTest Listener TestSuite Event
TestCase Assert TestSuite
The anatomy or format of a test case consists of which of the following: TestID Description Expected Results Actual Results Exceptions Special Cases
TestID Description Expected Result Actual Results Exceptions Special Cases
Analyze the following code: public class Test implements Runnable { public static void main(String[] args) { Test t = new Test(); } public Test() { Thread t = new Thread(this); t.start(); } public void run() { System.out.println("test"); } } The program has a compilation error because t is defined in both the main() method and the constructor Test(). The program compiles fine, but it does not run because you cannot use the keyword this in the constructor. The program compiles and runs and displays nothing. The program compiles and runs and displays test.
The program compiles and runs and displays test
The purpose of reviews and inspections is
To improve software quality
Which of these types of review meetings conducted for software quality ? Secondary inspection Virtual logging meeting Limited logging meeting Pair Review Kick-off meeting No-Logging meeting review
Virtual logging meeting Limited logging meeting Pair review No-logging meeting review
What is the opacity of unit testing?
Whitebox testing
What is the opacity of integration testing
Whitebox testing Blackbox testing
Which method of thread class is used to temporarily release time for other threads ?
Yield
What is the best way to release a thread object once you are done using it?
assign null to thread variable
What is the normal order of activities in which traditional software testing is organized? a. integration testing b. system testing c. unit testing d. acceptance testing
c, a, b, d
Which of the following is a fix for the fault (in the above program Code Analysis 2)?
change for loop to: for (int i=x.length - 1; i >= 0; i--)
Which of the following is a fix for the fault in the above program (Code Analysis 1)?
change if condition to: x[i] > 0
Code Analysis 1 Below is a faulty program. It includes a test case that results in failure. Answer the following questions Code Analysis 1: a through d about this program. public int countPositive (int[] x){ //Effects: If x==null throw NullPointerException // else return the number of positive (non-zero) elements in x. int count = 0; for (int i=0; i < x.length; i++) { if (x[i] >= 0) { count++; } } return count; } // Test input: x=[-4, 2, 0, 2] // Expected output = 2 Identify the fault in the above program (Code Analysis 1).
if conditional is incorrect: it is testing for 0 as well
Top-down integration testing has as it's major advantage(s) that _______.
major decision points are tested early no drivers need to be written
In the software development process, when the emphasis is on the users' participation then what kind of inspection method is essential?
pluralistic and cognitive walk-through
What is the purpose of Usability testing?
to evaluate the extent to which a user can learn to operate, prepare inputs for, and interpret outputs of a system
Which of the following method Assert class checks that an object is null?
void assertNull(Object object)