SER216 Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

______ Javadoc tag describes an argument of method or constructor

@param

What is a Test Fixture?

A test fixure is a set of known objects in which a program will test against to review its functionality.

Which of the following exceptions is a checked exception? -ArithmeticException. -IOException. -RuntimeException. -InputMismatchException.

IOException

Which of the following UML diagrams model a system's responses to internal and external stimuli/events?

State diagram

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

gathers a limited group together from among the total set of reviewers

The throws clause of a method: -specifies the exceptions a method catches. -specifies the exceptions thrown by the calling method. -specifies the exceptions a method throws. -specifies the exceptions a method throws and catches.

specifies the exceptions a method throws.

Which of the following are strategies of Black box testing? -Acceptance Testing -Decision Table Testing -Regression Testing -Boundary Value Analysis -Equivalence Class Partitioning -Test Automation

-Decision Table Testing -Boundary Value Analysis -Equivalence Class Partitioning

The anatomy or format of a test case consists of which of the following: -Description -Exceptions -Special Cases -TestID -Actual Results -Expected Results

-Description -TestID -Actual Results -Expected Results

What are some of the product standards defined and used in software quality management? -Java Programming style -Test Recording process -Version Release process -Change control process -Design Review form -Method header format

-Java Programming style -Design Review form -Method header format

What are some of the process standards defined and used in software quality management? -Java Programming style -Design Review form -Version Release process -Change control process -Method header format -Test Recording process

-Version Release process -Change control process -Test Recording process

Consider the following method and test case. How much statement coverage is achieved? public int returnInput (int input, boolean condition1, boolean condition2, boolean condition3) { int x = input; int y = 0; if (condition1) x++; if (condition2) x--; if (condition3) y=x; return y; } TestCase: returnInput(x, true, true, true) -25 -50 -75 -100

100

Consider the following method and test case. How much branch coverage is achieved? public int returnInput (int input, boolean condition1, boolean condition2, boolean condition3) { int x = input; int y = 0; if (condition1) x++; if (condition2) x--; if (condition3) y=x; return y; } TestCase: returnInput(x, true, true, true) -25 -50 -75 -100

50

Consider the following method and its path coverage tree. How many test cases are required to test returnInput method and achieve 100% path coverage? public int returnInput (int input, boolean condition1, boolean condition2, boolean condition3) { int x = input; int y = 0; if (condition1) x++; if (condition2) x--; if (condition3) y=x; return y; } 4 6 8 16

8

Consider the class Calculation below. It has 3 static methods findMax, cube, and reverseWords. Also provided is the test class TestCalculation which has all the library imports and some of the methods predefined. Add test methods that test all static methods of Calculation class. For findMax method, ensure that you test for both positive and negative integers. You can assume that all necessary imports are already provided.

@Test public void testFindMax() { System.out.println("test case find max"); assertEquals(4, Calculation.findMax(new int[]{1,3,4,2})); assertEquals(-2, Calculation.findMax(new int[]{-12,-3,-4,-2})); } @Test public void testCube(){ System.out.println("test case cube"); assertEquals(27, Calculation.cube(3)); } @Test public void testReverseWord(){ System.out.println("test case reverse word"); assertEquals("ym eman si nahk", Calculation.reverseWord("my name is khan"); }

What is the difference between a State Diagram and an Activity Diagram?

A state diagram is a form of UML diagram that shows all the possible states in which variables and methods may change throughout a program. An activity diagram depicts the path that the program should generally take for all similar test cases. Essentially, state diagrams show all the possibilities that a single program may produce.

What is Unit Testing?

A unit test is a piece of a code (usually a method) that invokes another piece of code and checks the correctness of some assumptions afterward. If the assumptions turn out to be wrong, the unit test has failed. A "unit" is a method or function. A unit test is an automated piece of code that invokes a different method and then checks some assumptions about the logical behavior of that method or class under test. A unit test is written using a unit testing framework. It can be written easily and runs quickly. It can be executed, repeatedly, by anyone on the development team.

Which of the following belongs to White box testing method? Statement Coverage Branch coverage Path Coverage All of the above

All of the above

Equivalence Partitioning belongs to which testing method?

Black box Testing

What is the opacity of System Testing? -Whitebox testing -Blackbox testing -Both of the above

Blackbox testing

What is the opacity of Integration Testing? -Whitebox testing -Blackbox testing -Both of the above

Both of the above

What is the difference between Checked and Unechecked exceptions?

Checked exceptions are default exceptions that are reviewed by your IDE at the moment that the program starts. For example, IOException is a checked exception by Java. All other exceptions that are checked during the compilation of the program, are called unchecked exceptions. These are the exceptions that programmers typically have to handle in "exception-handling". Checked- compile time Unchecked- run time

Unit Testing is usually done by Developers Customer End Users Testers

Developers

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

Exception handling can catch but not resolve exceptions.

Blackbox testing is also known as -Glassbox testing -Functional testing -Structure testing -Stress testing

Functional testing

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

Instructions on handling the exception.

What is JUnit?

JUnit is a unit testing framework for Java Programming language.

What are the 4 new types of reviews introduced in the Reading 1 paper?

Pair review Virtual Logging meeting No-Logging Meeting review Limited Logging meeting

How is Unit Testing different from Refactoring?

Refactoring can be done after writing several tests, or after each test. It is the act of changing a piece of code without changing its functionality. If you've ever renamed a method, you've done refactoring. If you've ever split a large method into multiple smaller method calls, you've refactored your code. It still does the same thing; it's just easier to maintain, read, debug, and change.

Whitebox testing is also known as -Regression testing -Stress testing -Structural testing -Functional testing

Structural testing

What is Test Driven Development (TDD)?

Test Driven Development is vastly different than "classic" development. You begin by writing a test that fails, then move on to creating the actual production code, and see the test pass, and continue on to either add functionality, refactor your code, or to create another failing test.

What is a Test Fixture?

Tests need to run against the background of a known set of objects. This set of objects is called a test fixture.

What is the purpose of finally block in exception handling? Where in the try..catch block should it be placed?

The finally block is used if the catch blocks are never executed, almost like a default case in switch statements. The finally block always gets executed in a try-catch block. The finally block is located after the catch block.

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

The throw statement is used to throw an exception.

What is the opacity of Unit Testing? -Whitebox testing -Blackbox testing -Both of the above

Whitebox testing

The best reason for using Independent software test teams is that

a test team will test the software more thoroughly

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

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

class Throwable

The mechanical or algorithmic cause of an error is a ________________ . a. Validation b. Failure c. Fault d. Defect e. Both c and d

e. Both c and d

Which of the following need to be assessed during unit testing? a. algorithmic performance b. coding standards c. error handling d. execution paths e. both c and d

e. both c and d

In the software development process, when the emphasis is on usability specialists than users then what kind of inspection method is essential: -inspection of standards -pluralistic and cognitive walk-throughs -heuristic evaluation -guideline reviews

heuristic evaluation

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

is an exception that occurs for which there are no matching catch clauses.

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

manage the number of test cases run

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

pluralistic and cognitive walk-throughs

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

the compiler will issue an error message indicating that the exception must be caught or declared.

When an exception occurs it is said to have been: -caught -thrown -declared -handled

thrown

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

to evaluate the extent to which a user can learn to operate, prepare inputs for, and interpret outputs of a system

The purpose of reviews and inspections is -to reveal mistakes made by an individual to the whole team -to assess performance of people on development team -to improve software quality

to improve software quality

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

try block.

If ExceptionA is a subclass of Exception, then which is the most appropriate way to handle ExceptionA and Exception?

try { // TO DO... } catch(ExceptionA ea) { // Handle ea } catch(Exception e) { // Handle e }


Ensembles d'études connexes

Chap 9: Managing Start-Ups and New Ventures

View Set

Chapter 19: Business Conduct Rules - Multiple Choice

View Set

Pharmacology, Chapter 87: Aminoglycosides: Bactericidal Inhibitors of Protein Synthesis

View Set

CompTIA 2.4 PC Maintenance (Test-Out)

View Set