SER 216 All Quizes
to improve software quality
The purpose of reviews and inspections is
try block
To catch an exception, the code that might throw the exception must be enclosed in a
fixed state of a set of objects used as a baseline for running tests
What is a Test Fixture?
yield
Which method of Thread class is used to temporarily release time for other threads?
IOException
Which of the following exceptions is a checked is a checked exception?
Exception handling can catch but not resolve exceptions
Which of the following statements is false?
@param
__ Javadoc tag describes an argument of method or constructor
Developers
__ are the Testers of Unit Testing?
Black box testing
__ is a testing methodology that is not concerned with the inner working and implementation details of the application.
part-of and is-kind-of
2 important kinds of Hierarchy are __ and __.
Object Model
A kind of System Model that provides abstraction based on the structure of the system is called __.
Dynamic Model
A kind of system model that provides abstraction based on how the system reacts to external events/triggers and event flow in the system is called __.
gathers a limited group together from among the total set of reviewers
A limited logging meeting
class Throwable
All exception classes inherit, either directly or indirectly, from:
is an exception that occurs for which there are no matching catch clauses
An uncaught exception:
The program compiles and runs and displays test.
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"); } }
Failure
Any deviation of the observed behavior from the specified behavior
Functional testing
Blackbox testing is also known as
no stubs need to be written
Bottom-up integration testing has as it's major advantage(s) that __.
V-shaped Model
Choose the most appropriate generic software process model that might be used as a basis for managing the development of the following system: "A system to control anti-lock braking in a car"
Waterfall model
Choose the most appropriate generic software process model that might be used as a basis for managing the development of the following system: "A university accounting systems that replaces and existing system"
Incremental model
Choose the most appropriate generic software process model that might be used as a basis for managing the development of the following system: "An interactive travel planning system that helps users plan journeys with the lowest environmental impact"
if conditional is incorrect: it is testing for 0 as well
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).
Test input: x = []; Expected output = 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 If possible, identify a test case that does not execute the fault (in the above program Code Analysis 1).
Test input: x =[-4, 1, 5]; Expected output = 2
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 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).
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 Which of the following is a fix for the fault in the above program (Code Analysis 1)?
for loop is incorrect: it is iterating from low to high
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).
No test case possible
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 If possible, identify a test case that does not execute the fault (in the above program Code Analysis 2).
Test input: x=[0]; Expected output = 0
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 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).
change for loop to: for (int I=x.length-1; I >= 0; I--)
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 Which of the following is a fix for the fault (in the above program Code Analysis 2)?
/** prompts the user with a message and returns a string. * * @param scan Scanner used to read in user input * @param message message to prompt user with * @return returns a string from the user*/
Correct Javatags: @param @return
Defect Type Phases injected and removed Fix Time Description
Defect logging in PSP involves logging what kind of information about a defect?
manage the number of test cases run
Equivalence class partitioning is used to:
Activity diagrams may be used to describe the business processors in which the system is used and the other systems which are also used in these processes.
How are activity diagrams used in describing the context of use of a system?
State diagrams focus on set of attributes of a single abstraction whereas activity diagrams focus on dataflow in the system.
How is a state diagram different from an activity diagram?
Abstraction
How is complexity in Software Systems handled?
Assuming that similar objects have attributes and methods in common, these common attributes and methods are associated with a "super-class" which generalizes all of the objects sharing these attributes/methods.
How is generalization used to simplify the models of s system with many similar objects?
try { // TO DO...} catch(ExceptionA ea) { // Handle ea } catch(ExceptionB eb) { // Handle eb } catch(ExceptionC ec) { // Handle ec } catch(Exception e) { // Handle e }
If ExceptionA is a subclass of ExceptionB, and ExceptionB is a subclass of ExceptionC then which is the most appropriate way to handle ExceptionA, ExceptionB, ExceptionC, and Exception?
Y describes an alternative route to X's main success scenario.
If a use case X has an extension use case Y, then which of the following is true?
the compiler will issue an error message indicating that the exception must be caught or declared
If the catch-or-declare requirement for a checked exception is not satisfied:
Driver
In the context of Integration Testing, a component that calls the TestedUnit and controls the test cases is called __.
Stub
In the context of Integration Testing, a component the TestedUnit depends on and is a partial implementation that returns fake values is called __.
pluralistic and cognitive walk-throughs
In the software development process, when the emphasis is on users' participation then what kind of inspection method is essential:
True
Javadoc comments begin with a special marker /**
Program Size Time Spent by phase Defects found and injected by phase
Select the basic PSP1 data measures that are tracked and estimate:
Writing/adding a test
Test-driven development starts with __.
TestID Description Expected Results Actual Results
The anatomy or format of a test case consists of which of the following:
Socket s = new Socket(ServerName, port);
The client requests a connection to a server using the following statement:
Socket s = severSocket.accept();
The server listens for a connection request from a client using the following statement:
specifies the exceptions a method throws
The throws clause of a method:
Static Analysis
Tools such as Eclipse, FindBugs, Metrics, CheckStyle, etc. cab be used for __ of code.
major decision points are tested early no drivers need to be written
Top-down integration testing has as it's major advantage(s) that __.
False
Unit Testing is the same as Refactoring.
Activity diagrams Use case diagrams Class diagrams State diagrams
What UML diagram types may be used to represent the essential features of a system?
Process of reviewing one's own code using a well-defined and structured process
What are Personal reviews in PSP
Walkthroughs Full reviews Inspections
What are some of the different ways to conduct Peer Reviews
Design Review form Java Programming style Method header format
What are some of the product standards defined and used in software quality management?
Engineers can work at a high level of abstraction without concern for implementation details Errors are reduced and the design and implementation process is faster. By using powerful generation tools, implementation of the same system can be automatically generated for different platforms.
What are the claimed benefits of model-driven engineering?
The actors involved A description of the interactions Preconditions of the usecases Postconditions of the use case Special requirements and other information
What are the principal components of a textual use-case description?
PSP0 PSP1 PSP2
What are the three steps in PSP
A computation-independent model (CIM) A platform-independent model (PIM) One of more platform-specific models (PSMs)
What are the three types of abstract system model that are recommended by the Model-driven Architecture (MDA) method?
Big Bang Testing Bottom Up Testing Top Down Testing
What are the types of integration Testing?
Identifying the classes in an existing system
What is Reegineering
A collection of techniques, methodologies and tools that help with the production of a high quality software system.
What is Software Engineering?
Process of checking for deviations between observed behavior of a system and its specification
What is Validation (in testing terminology)?
Mechanical or algorithmic cause of an error
What is a fault or bug?
An aggregate is an object (the whole) composed of different parts (other objects)
What is aggregation?
That the system can be represented as a model with a finite number of discrete states and external and internal events trigger a transition from one state to another
What is the basic assumption that underlines event-driven modeling?
assign null to Thread variable
What is the best way to release a thread object once you are done using it?
Inheritance
What is the most appropriate type of association for modeling different types of Doctors (HospitalDoctor, TraineeDoctor, GeneralPractioner, TeamDoctor, etc.) in a Hospital Management system?
c. Unit Testing a. Integration testing b. System testing d. Acceptance testing c, a, b, d
What is the normal order of activities in which traditional software testing is organized
White boxing Blackbox testing
What is the opacity of Integration Testing?
Blackbox testing
What is the opacity of System Testing?
Whitebox testing
What is the opacity of Unit Testing?
ro evaluate the extent to which a user can learn to operate, prepare inputs for, and interpret outputs of a system
What is the purpose of Usability testing?
puts the thread to sleep for the specified time in milliseconds
What is the purpose of the sleep method of the Thread class?
thrown
When an exception occurs it is said to have been:
It is an open source framework Provides Annotation to identify the test methods Unit tests can be run automatically Unit tests can be organized into test suites
Which of the following are important features of JUnit?
Equivalence Class Partitioning Boundary Value Analysis Decision Table Testing
Which of the following are strategies of Black box testing?
Fault Detection Fault Tolerance Fault Avoidance
Which of the following are ways to deal with faults?
IndexOutOfBounds
Which of the following exceptions is an Unchecked Exception?
Exception Handling
Which of the following is a fault tolerance technique?
/** Hello! */
Which of the following is a valid javadoc comment
Instructions on handling the exception
Which of the following is not included in an exception's stack trace?
a. Involves following simple process scripts b. Involves collecting 3 basic measures of the work (time spent, size of products produced, defects corrected) c. Involved performing a simple post-project analsis All three statements are true
Which of the following statement(s) about PSP0 are true?
The throw statement is used to throw an exception
Which of the following statements is true?
Branch Coverage Statement Coverage
Which of these are different types of code coverage?
Virtual Logging meeting Limited Logging meeting Pair review No-Logging Meeting review
Which of these are types of review meeting conducted for Software Quality?
Spiral
Which one of the following SDLC models works well for high-risk projects with complex requirements?
Waterfall
Which one of the following SDLC models works well for repeatable processes and well-defined requirements?
Rational Unified Process (RUP)
Which one of the following is an Agile SDLC model?
looking under the covers and into the implementation details of the subsystem of an application
White box testing methodology involves __.
Structural testing
Whitebox testing is also known as
HTML
javadoc is a documentation generator for generating API documentation in __ format from Java source code