SER 216MIDTERM

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is the opacity of Unit Testing? A. Whitebox testing B. Blackbox testing C. Both of the above D. None of the above

A

Which of the following are JUnit classes? A. TestCase B. Assert C. Math D. Refactor E. UnitTest F. Listener G. TestSuite E. Event F. None of the above

A, B, G

What are the claimed benefits of model-driven engineering? A. Engineers can work at a high level of abstraction without concern for implementation details. B. Errors are reduced and the design and implementation process is faster. C. By using powerful generation tools, implementation of the same system can be automatically generated for different platforms. There is no need to test the system

A,B,C

A kind of System Model that provides abstraction based on the structure of the system is called ____________. A. Functional Model B. Object Model C. Task Model D. Issues Model

B

Annotating a public void method with @AfterClass causes that method to be run after each Test method. Is it True or False? A. True B. False

B

Javadoc is a documentation generator for generating API documentation in ________ format from Java source code. A.Portable Document Format B. HTML C. OpenDocument D. ECMA script

B

Which of these are types of review meetings conducted for Software Quality? A. Secondary inspection B. Virtual Logging meeting C. Limited Logging meeting D. Pair review E. Kick-off meeting F. No-Logging Meeting review

B, C, D, F

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 __________. A. Object Model B. Functional Model C. Dynamic Model D. Issues Model

C

In the software development process, when the emphasis is on users' participation then what kind of inspection method is essential: A. heuristic evaluation B. guideline reviews C. pluralistic and cognitive walk-throughs D. inspection of standards

C

Activity Diagram

Describe dynamic behavior of system, in particular workflow

State Chart diagrams

Describe the dynamic behavior of an individual object

Class Diagram

Describe the static structure of the system Objects, attributes and associations.

use case diagram

Describes the functional behavior of the system as seen by the user.

UML diagrams are composed of:

Nodes and Edges

UML objects and instances are:

underlined

What are the 6 parts of a use case description?

1. Unique Name 2.Participating Actors 3. ENtry Conditions 4. Exit conditions 5. Flow of events 6. Special requirements

2 important kinds of Hierarchy are _______________ and ________________. A. part-of and is-kind-of B. functional and object C. object and class D. inheritance and association

A

Blackbox testing is also known as A. Functional testing B. Structure testing C. Glassbox testing D. Stress testing

A

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" A. V-shaped Model B. Spiral Model C. Rapid Application Development (RAD) Model D. Structured Evolutionary Prototyping Model

A

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 system that replaces an existing system" A. Waterfall model B. Spiral model C. V-shaped model D. Rapid Application Development (RAD) model

A

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)? A. change if condition to: x[i] > 0 B. change for loop to: for (int i=0; i <= x.length; i++) C. You Answered change for loop to: for (int i=x.length; i >= 0; i--) D. None of the above

A

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++) { i f (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). A. for loop is incorrect: it is iterating from low to high B. if conditional is incorrect: it should consider values less than 0 as well C. if conditional is incorrect: it is testing for 0 D. placing of return statement is incorrect

A

How is complexity in Software Systems handled? A. Abstraction B. Testing C. Pair Programming D. Engineering

A

How is generalization used to simplify the models of a system with many similar objects? A. 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. B. Assuming that different objects have nothing in common C. By overloading methods

A

In the context of Integration Testing, a component that calls the TestedUnit and controls the test cases is called __________. A. Driver B. Stub C. Test Class D. Test Fixture

A

In the context of Integration Testing, a component the TestedUnit depends on and is a partial implementation that returns fake values is called __________. A. Stub B. Driver C. Test Class D. Test Fixture

A

The client requests a connection to a server using the following statement: A. Socket s = new Socket(ServerName, port); B. Socket s = serverSocket.accept(); C. Socket s = serverSocket.getSocket(); D. Socket s = new Socket(ServerName);

A

What is Software Engineering? A. A collection of techniques, methodologies and tools that help with the production of a high quality software system. B. Writing code C. Building a game D. Understanding the problem

A

What is the best way to release a thread object once you are done using it? A. assign null to Thread variable B. use stop() method of Thread class C. use suspend() method of Thread class D. use resume() method of Thread class

A

What perspectives may be used for system modeling? A. External, interaction, behavioral, structural perspectives B. Rule, object, actor perspective C. Functional, role, communication perspective D. None of the above

A

Which of the following is a valid javadoc comment? A. /**Hello!*/ B. //**Hello!**/ C. /* * * Hello! * */ D. /**Hello!**/

A

Which of the following statements is true? A. The throw statement is used to throw an exception. B. The throw statement is used to specify that a method will throw an exception. C. The throw statement is used to access an exception parameter. D. All of the above.

A

Which of the following are strategies of Black box testing? Test Automation A. Equivalence Class Partitioning B. Boundary Value Analysis C. Testing D. Regression Testing

A, B, C

The anatomy or format of a test case consists of which of the following: A. TestID B. Description C. Expected Results D. Actual Results E. Exceptions F. Special Cases

A, B, C, D

Which of the following are important features of JUnit? A. It is an open source framework. B. Provides Annotation to identify the test methods. C. Provides testing for the entire software system. D. JUnit tests can be run automatically. E. JUnit tests can be organized into test suites. F. Provides fixes for test cases that failed. G. Provides mechanism for customers to test the system.

A, B, D, E

What are the three types of abstract system model that are recommended by the Model-driven Architecture (MDA) method? A. A computation-independent model (CIM) B. A platform-independent mdoel (PIM) C. One or more platform-specific models (PSMs) D. Functional model E. Architectural model F. Behavioral model

A,B,C

What UML diagram types may be used to represent the essential features of a system? A. Activity diagrams B. Use case diagrams C. Class diagrams D. State diagrams

A,B,C,D

What are the principal components of a textual use-case description? A. The actors involved B. A description of the interactions C. Preconditions of the use case D. Postconditions of the use case E. Classes F. Answer Special requirements and other information

A,B,C,D,F

What are some of the product standards defined and used in software quality management? A. Design Review form B. Java Programming style C. Change control process D. Method header format E. Version Release process F. Test Recording process

A,B,D

Defect logging in PSP involves logging what kind of information about a defect? A. Defect Type B. Phases injected and removed C. Time when defect is introduced D. Fix Time E. Defect Line # F. Developer Name G. Description

A,B,D,G

Select the basic PSP1 data measures that are tracked and estimated: A. Program Size B. Time Spent by phase C. Resources spent by phase D. Budget spent by phase E. Defects found and injected by phase

A,B,E

What are some of the different ways to conduct Peer Reviews? A. Walkthroughs B. Meetings C. Discussions D. Full reviews E. Pair programming F. Inspections

A,D,F

What are the three steps in PSP? A. PSP0 B. TSP C. Develop D. Test E. PSP1 F. PSP2

A,E,F

A limited logging meeting A. consists of only two persons who are very familiar with the material being reviewed B. gathers a limited group together from among the total set of reviewers C. consists of limited persons who are very familiar with the material being reviewed D. is held with reviewers using a communication channel such as an internet

B

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). A. Test Input: x=[0, 0, 0]; Expected output = 0 B. Test Input: x=[-4, 1, 5]; Expected output = 2 C. Test Input: x=[0, 4, 7]; Expected output = 2 D. No test case possible

B

How are activity diagrams used in describing the context of use of a system? A. Activity diagrams may be used to describe actors and functions of the system. B. Activity diagrams may be used to describe the business processes in which the system is used and the other systems which are also used in these processes. C. Activity diagrams can be used to describe various objects and their interaction

B

If possible, identify a test case that does not execute the fault (in the above program Code Analysis 2). A. Test Input: x=[1, 2, 3]; Expected output = -1 B. No test case possible C. Test Input: x=null; Expected output = Null Pointer Exception D. Test Input: x=[1, 0, 3]; Expected output = 1

B

If the catch-or-declare requirement for a checked exception is not satisfied: A. the compiler will issue an error message indicating that the exception must be caught. B. Answer the compiler will issue an error message indicating that the exception must be caught or declared. C. a stack trace will be displayed indicating the exception that has occurred and where it occurred. D. a stack trace will be displayed, along with a message indicating that the exception must be caught.

B

The purpose of reviews and inspections is A. to assess performance of people on development team B. to improve software quality C. to reveal mistakes made by an individual to the whole team D. none of the above

B

The server listens for a connection request from a client using the following statement: A. Socket s = new Socket(ServerName, port); B. Socket s = serverSocket.accept(); C. Socket s = serverSocket.getSocket(); D. Socket s = new Socket(ServerName);

B

What are Personal reviews in PSP? A. Can help one define their purpose and identify the objectives which he/she wish to pursue B. Process of reviewing one's own code using a well-defined and structured process C. List the activities in which you excel D. Knowing your greatest achievements allows you to build confidence and identity potential opportunities

B

What is aggregation? A. First determine the functionality the system is to provide without consideration of implementation constraints. B. An aggregate is an object (the whole) composed of different parts (other objects). C. Formal description of a system, or a detailed plan of the system at component level to guide its implementation.

B

What is the opacity of System Testing? A. Whitebox testing B. Blackbox testing C. Both of the above D. None of the above

B

What is the purpose of Usability testing? A. to evaluate the compliance of a system with specified performance requirements B. to evaluate the extent to which a user can learn to operate, prepare inputs for, and interpret outputs of a system C. to evaluate a system at or beyond the limits of its specification or requirement D. none of the above

B

What is the purpose of the sleep method of the Thread class? A. used to temporarily release time for other threads B. puts the thread to sleep for the specified time in milliseconds C. to force one thread to wait for another thread to finish D. to find out the state of a thread

B

When an exception occurs it is said to have been: A. caught B. thrown C. declared D. handled

B

Which method of Thread class is used to temporarily release time for other threads? A. sleep B. yield C. pause D. join

B

Which of the following exceptions is a checked exception? A. ArithmeticException. B. IOException. E. RuntimeException. D. InputMismatchException.

B

Which of the following method of Assert class checks that a condition is true? A. void assert(boolean condition) B. void assertTrue(boolean condition) C. void assertCheck(boolean condition) D. void assertChecks(boolean condition)

B

Which of the following statements is false? A. Exception handling enables programmers to write robust and fault-tolerant programs. B. Exception handling can catch but not resolve exceptions. C. Exception handling can resolve exceptions. D. Custom exception classes can be created if the predefined classes are not sufficient.

B

Whitebox testing is also known as A. Functional testing B. Structural testing C. Regression testing D. Stress testing

B

Unit Testing is the same as Refactoring. True or False? A. True B. False

B.

//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++) { i f (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). Which of the following is a fix for the fault (in the above program Code Analysis 2)? A. change for loop to: for (int i=0; i <= x.length; i++) B. You Answered change for loop to: for (int i=x.length; i >= 0; i--) C. Answer change for loop to: for (int i=x.length - 1; i >= 0; i--) D. change if condition to: x[i] > 0

C

All exception classes inherit, either directly or indirectly, from: A. class Error. B. class RuntimeException. C. class Throwable. D. None of the above.

C

An uncaught exception: A. is a possible exception that never actually occurs during the execution of the program. B. is an exception that occurs for which the matching catch clause is empty. C. is an exception that occurs for which there are no matching catch clauses. D. is another term for a thrown exception.

C

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 A. Test Input: x=[1, 2, 3]; Expected output = 3 B. Test Input: x=[0, 0, 0]; Expected output = 0 C. Answer Test Input: x=[]; Expected output = 0 D. No test case possible

C

Bottom-up integration testing has as it's major advantage(s) that ____________. A. major decision points are tested early B. no drivers need to be written C. no stubs need to be written D. regression testing is not required

C

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" A. Waterfall model B. V-shaped model C. Incremental model D. Rapid Application Development (RAD) Model

C

Equivalence class partitioning is used to: A. find the very-common bugs that lurk in the corner B. record complex business rules that the system must implement and that must be tested C. manage the number of test cases run D. None of the above

C

The throws clause of a method: A. specifies the exceptions a method catches. B. specifies the exceptions thrown by the calling method. C. specifies the exceptions a method throws. D. specifies the exceptions a method throws and catches.

C

What is a Test Fixture? A. code to be executed before tests are executed B. annotation used in unit testing C. fixed state of a set of objects used as a baseline for running tests D. code to be executed after tests are executed

C

What is the basic assumption that underlies event-driven modeling? A. That the system can be represented as "objects", which are data structures that contain data, in the form of fields, and behavior, in the form of methods. B. That the system allows multiple concerns to be expressed separately and automatically unified into working systems. C. 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.

C

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 A. a, d, c, b B. b, d, a, c C. c, a, b, d D. d, b, c, a

C

Which of the following annotation causes that method to be run after each Test method? A. @Test B. @Before C. @After D. @AfterClass

C

_______________ are the Testers of Unit Testing? A. Business Analysts B. Customers C. Developers D. Independent Testers

C

Which of the following method of Assert class checks that an object is null? A. void assert(Object object, boolean toCheckAsNull) B. void assertCheck(Object object, boolean toCheckAsNull) C. void assertNull(Object object) D. void assertChecks(Object object, boolean toCheckAsNull)

C.

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). for loop is incorrect: A. it is iterating from low to high B. initialization of count variable is incorrect C. if conditional is incorrect: it should consider values less than 0 as well D. if conditional is incorrect: it is testing for 0 as well

D

What are the types of Integration Testing? A. Big Bang Testing B. Bottom Up Testing C. Top Down Testing D. All of the above

D

What is Reengineering? A. decomposition B. create a class-based interface to any system C. identifying classes for a new software system D. identifying the classes in an existing system

D

What is Validation (in testing terminology)? A. Deviation of observed behavior from specified behavior B. System is in a state such that further processing by the system can lead to a failure C. Mechanical or algorithmic cause of an error D. Process of checking for deviations between observed behavior of a system and its specification

D

Which of the following is not included in an exception's stack trace? A. A descriptive message for the exception. B. The method-call stack at the time the exception occurred. C. The name of the exception. D. Instructions on handling the exception

D

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++) { i f (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). 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). A. Test Input: x=[0, 0, 0]; Expected output = 2 B. Test Input: x=[0, 2, 0]; Expected output = 2 C. No test case possible D. Test Input: x=[ 0]; Expected output = 0

D

Top-down integration testing has as it's major advantage(s) that _______. A. low level modules never need testing B. major decision points are tested early C. no drivers need to be written D. no stubs need to be written E. both b and c

E

Which of the following statement(s) about PSP0 are true: a. Involves following simple process scriptsb. I B. Involves collecting 3 basic measures of their work (time spent, size of products produced, defects corrected)c. C. Involves performing a simple post-project analysis A. a only B. b only C. c only D. a and b E. b and c F. All three statements are true

F

What is use case in Use Case Diagrams

Oval Symbol - represents a class of functionality provided by the system

Sequence Diagram

Shows Dynamic behavior between objects and system

Javadoc comments begin with a special marker /**. True False

True

To catch an exception, the code that might throw the exception must be enclosed in a A. throws block. B. catch block. C. try block. D. finally block.

c

UML - Class are represented by _________ and functions are represented by ______________

rectangles, ovals

What is an actor in Use Case Diagrams

represents a user of a system - (passenger stick figure) Any external entity interacting with the system. -user -external system -physical environment


Kaugnay na mga set ng pag-aaral

periods of nursing history - Monique

View Set

Span 102 Lección 14.2 ¿Cierto o falso?

View Set

Solving with the Distributive Property Assignment

View Set

1. A pénzügyi szektor alapvetései

View Set

CE Shop Practice Test #2 (wrong answers) w/ explanations

View Set