Quiz
Software and Quality Testing Midtem 2017
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (40)
1Suppose that the police stands at the side of the road, measuring passing cars’ speed in
integers. If a car has a velocity of above 50 km/h, its driver gets a warning. If, however, the speed reaches
60 km/h, the driver gets a traffic penalty. When doing boundary-value analysis of such a system, what are
the off-points?- A51 and 61.
- B49 and 59.
- C51 and 59.
- D49 and 61.
2Consider the following statements about traceability in relationship to Cucumber:
I: Cucumber helps business stakeholders to trace requirements to acceptance tests.
II: Cucumber helps testers to trace scenarios to test implementations.
III: Cucumber helps developers to trace implementation classes back to requirements via step definitions.
Which of the following holds:- AStatement I is false, but the others are true
- BStatement II is false, but the others are true.
- CStatement III is false, but the others are true.
- DAll of the statements are true.
3Which of the following best describes integration testing?
- ATesting to verify that a integration component meets the requirements.
- BTesting performed to expose faults in the interaction between integrated components.
- CIntegration of automated software test suites with the product
- DTesting that simulates the interaction between components to expose faults.
4In what way do the Mockito methods verify and when...then improve controllability and
observability?- AThe when...then method improves both observability as well as controllability, but the
verify method only improves observability. - BThe verify methods only improve controllability, and the when...then methods only improve
observability. - CThe verify and when...then both improve observability as well as controllability
- DThe verify methods only improve observability, and the when...then methods only improve
controllability.
- AThe when...then method improves both observability as well as controllability, but the
5In real life, classes are coupled to each other, which makes unit testing challenging. From
the testability perspective, which of the following are reasons why we want to have controllability over
dependencies in our unit tests?- ATo simulate exceptional behavior and to make test assertions simpler.
- BTo decrease test execution time and to improve test readability.
- CTo not depend on external infrastructure and to simulate exceptional behavior
- DTo not depend on external infrastructure and to make tests isolated from each other.
6Which of the following test design techniques is most focused on validation and least on
verification?- AUnit testing.
- BBoundary value analysis.
- CExploratory testing
- DDecision table testing
7Consider a domain matrix with N conditions for variable x and M conditions for variable y.
Which of the following claims is correct?- AThe number of test cases required by the one by one strategy is N ∗ M.
- BThe number of on points in the derived test suite is equal to the number of conditions.
- CThe number of test cases required by the one by one strategy is N + M.
- DIf the value for one variable is an off point, the value for the other variable must be an on point.
8The key reason to adopt a continuous integration server (such as DevHub as used in the
labwork) is:- ATo ensure that the system can be built and executed in a clean environment using only source
code that is under revision control. - BTo relieve the individual developers from the need to execute test cases themselves.
- CTo build up a history of build successes and failures over time.
- DTo make it easy to share code among team members.
- ATo ensure that the system can be built and executed in a clean environment using only source
9If you apply the one by one testing strategy to the condition x >= 100 && y < 200, what
are the off points for x and y?- Ax = 101 and y = 201.
- Bx = 101, and y = 199.
- Cx = 99, and y = 201.
- Dx = 99, and y = 199.
10What should in general not be included in a git repository?
- AConfiguration files such as pom.xml or checkstyle.xml.
- BResource files.
- CThe .gitignore file
- DBinary files
11Which of the following statements is true in the ISTQB test design process?
- ATest conditions are the outcome of test design.
- BTest scripts implement test cases which are derived from test conditions.
- CThe test conditions are the starting point for test analysis.
- DTest scripts form the test basis.
12Which of the following IS NOT a possible fix for a test that fails because it depends on other
tests, i.e., a non isolated test?- ADo not reuse instances of objects among tests.
- BMake sure dependencies are in a clean state before test execution.
- CFollow the One Assert per Test rule in the problematic test.
- DAbstract away infrastructure-specific details, e.g., file system, clock
13A software developer implemented a fix for a bug. What test suites need to be ran in order
to test whether the bug was succesfully resolved?- AConfirmation tests
- BMaintenance tests.
- CRegression tests.
- DAcceptance tests.
14In the ISTQB terminology, which of the following is a test level?
- AStructural testing.
- BRegression testing
- CFunctional testing.
- DIntegration testing.
15Which of the following sentences is not about the Tell, Don’t Ask principle?
- AObject-orientation is about bundling data with the functions that operate on that data.
- BOne should tell objects what to do instead of asking objects and then decide what to do.
- CPut the behavior inside the class it belongs.
- DLow coupling eases the testability of a class
16There is a subsumption relationship among different coverage strategies. Strategy X subsumes
strategy Y if all elements that Y exercises are also exercised by X. Which of the following sentence
shows the correct order? A > B means A subsumes B.- AMC/DC > Branch + Condition Coverage > Branch Coverage > Statement Coverage
- BMC/DC > Branch Coverage > Statement Coverage > Condition Coverage
- CMC/DC > Branch + Condition Coverage > Statement Coverage > Statement Coverage
- DBranch + Condition Coverage > Statement Coverage > Branch Coverage > MC/DC
17Cucumber makes use of regular expressions to match a feature definition and a Java method
that makes it work. Which one of the following regular expressions is able to match the following steps: 1)
generate 5 invoices with Mauricio as customer, 2) generate 50 invoices with Arie as customer:- A@When("generate \\d? invoices with (.*) as customer")
- B@When("generate (\\d*) invoices with (.*) as customer")
- C@When("generate (\\d) invoices with (.*) as customer")
- D@When("generate \\d invoices with \\s as customer")
18Consider the method from Figure 3 (page 11) . What is the minimum number of test cases
needed to achieve 100% statement coverage?- A1
- B4
- C2
- D3
19The typical way to use a mocking framework (such as Mockito) when testing a class C is:
- ATo mock selected classes C depends on
- BTo mock selected subclasses of C.
- CTo mock selected methods in C.
- DTo mock selected interfaces implemented by C.
20For which of the following code fragments is the minimum number of paths needed to achieve 100% statement coverage different from the minimum number of paths needed to achieve 100% decision coverage?
- Aint i = 0;
while (i < 10) {
i ++;
} - Bif ( invoice . paid ) {
invoice . addTransaction (new Transaction ( invoice . amount ));
} - Cswitch ( invoice . status ) {
case " paid ":
return " Invoice has been paid ";
case " unpaid ":
return " Invoice has not been paid ";
default:
return " The status of this invoice is unknown ";
} - Dfor (int i = 0; i < 10; i ++) {
System . out . println (" This is the " + i + " th iteration " );
}
- Aint i = 0;
21Which one of the following characterizations of the Pragmatic Testing with JUnit’s FIRST
principles is INCORRECT?- AT Missing tests for old code should be added as soon as possible.
- BI The order of tests should not matter for the test result.
- CS A succeeded test doesn’t need a human double check.
- DF The programmer should focus on low test execution time
22Consider the code snippet as shown in Figure 2. What is the minimum number of test cases
needed in order to achieve 100% branch coverage?- A5
- B3
- C4
- D2
23A regression test:
- AIs obtained through linear regression analysis between the coverage and the number of defects
found. - BWill check unchanged functionality of the software to see if it has been inadvertently affected
by a change. - CWill always be automated.
- DWill check changed functionality the software to verify that modifications have been applied
correctly.
- AIs obtained through linear regression analysis between the coverage and the number of defects
24Which one of the following is a clear example of a Fake object (and not a Mock or a Stub)?
- AA class that provides an in-memory implementation of a database.
- BA class that returns a fixed value (e.g. “42”) when calculate() is invoked.
- CA class that provides the same interface as the concrete implementation of a web service.
- DA class that counts the number of times a method is invoked during the test execution.
25Which statement best characterizes the two legs of the V-model? The V-model contains:
- ATest conditions at its left leg, and test outcomes at its right leg.
- BValidation activities at its left leg, and verification activities at its right leg.
- CLife cycle activities at its left leg, and test levels at its right leg.
- DTest levels at its left leg, and test types at its right leg.
26In Figure 5, we show the control flow graph (CFG) of the collapseNewLine method. What
is the branch coverage after exercising the method with the input ABC?- A5/10
- B8/10
- C7/10
- D6/10
27A test team consistently finds between 90% and 95% of the defects present in the system
under test. While the test manager understands that this is a good defect-detection percentage for her test
team and industry, senior management and executives remain disappointed in the test group, saying that
the test team misses too many bugs. Given that the users are generally happy with the system and that the
failures which have occurred have generally been low impact, which of the following testing principles is
most likely to help the test manager explain to senior management and executives why some defects are
likely to be missed?- AThe absence-of-errors fallacy.
- BDefect clustering.
- CPesticide paradox.
- DExhaustive testing is impossible.
28Consider the code snippet as shown in Figure 1. How could mock objects best be used in
order to test this method?- Areader should be mocked to improve observability, and connection should be mocked to
improve controllability. - Breader and connection should both be mocked, yet only to improve their observability.
- Creader and connection should both be mocked, to improve their controllability as well as
their observability - Dreader should be mocked to improve controllability, and connection should be mocked to
improve observability
- Areader should be mocked to improve observability, and connection should be mocked to
29When practicing ATDD (Acceptance Test-Driven Development), developers:
- Acollaboratively discuss acceptance criteria, with examples, and then distills them into a set of
concrete acceptance tests before development begins. - Bfocus on system and integration tests first; later, they then make use of TDD to develop the
classes that actually implement the feature. - Cwrite unit tests based on the acceptance criteria of the functionality to be implemented.
- Dare divided in two teams: one team focuses on implementing production code, while the other
focuses on writing acceptance tests at system level.
- Acollaboratively discuss acceptance criteria, with examples, and then distills them into a set of
30Consider the decision table for the expression ((A and B) or C) in the table below.
If we aim to achieve 100% Modified Condition / Decision Coverage (MC/DC), the minimum set of
tests we should select is:- A2, 3, 5, 6
- B3, 4, 7, 8
- C2, 3, 4, 6
- D1, 3, 4, 6
31Is it possible to write a program that can check any other Java program and ensure that it
never prints the string “Stop Censorship Now”?- ANo, this cannot be done because of the combinatorial explosion problem.
- BNo, this cannot be done as this would require solving the halting problem.
- CYes, this is trivial, just search for the requested string.
- DYes, but this would require a powerful symbolic execution engine.
32Suppose a variable int a that has to be asserted against the number 42. Which one of the
following asserts DO NOT work at all?- AJUnit: assertTrue(a == 42);
- BJUnit: assertEquals(42, a);
- CAssertJ: assertThat(a == 42);
- DAssertJ: assertThat(a).isEqualTo(42);
33Consider the decision table for admitting late students to TU Delft exams, as given below:
A tester is trying to turn the columns (rules) into test cases, aiming at achieving 100% Modified Condition
/ Decision Coverage (MC/DC). Which of the following statements is true?- AAchieving full MC/DC is possible given the existing five rules, but requires careful subsitution
of DC values by either T or F. - BAchieving full MC/DC does not require all columns provided, but a carefully selected subset
of fewer than 5 columns. - CAchieving full MC/DC requires just one extra test case that does not correspond to any of the
columns in the table. - DAchieving full MC/DC coverage requires that all condition combinations are tested, which
requires more than five test cases.
- AAchieving full MC/DC is possible given the existing five rules, but requires careful subsitution
34Suppose we need to test a loop that performs N iterations. Which one of the following
criteria better represents the loop boundary adequacy?- AA test case exercises the loop zero, one, and multiple times.
- BA test case exercises the loop zero, one, and precisely N times.
- CA test case exercises the loop zero, one, and at least N+1 times.
- DA test case exercises the loop zero, one, and at least N times.
35Besides high coverage, an additional desirable characteristic of a test suite is that it has good
diagnosability: If a particular test case fails, it should be easy to debug the system and find the component
responsible for the failure.
Consider a test suite that focuses on (Cucumber) end to end testing at the cost of unit testing, thus
adhering to the software testing ice-cream cone anti-pattern. Which of the following is true?- AThe test suite reaches low coverage and poor diagnosability
- BThe test suite reaches low coverage yet high diagnosibility.
- CThe test suite reaches high coverage yet poor diagnosability
- DThe test suite reaches both high coverage and high diagnosability.
36What is a key characteristic of structure-based testing techniques?
- AThey are mainly used to assess the structure of a specification.
- BThey are based on the skills and experience of the tester.
- CThey use some model of the software or component to drive the testing process.
- DThey are used both to measure code coverage and to design tests to increase code coverage.
37What is the cyclomatic complexity of the piece of code in Figure 4?
- A1
- B2
- C4
- D3
38Regarding the test pyramid and the trade-offs a tester needs to do when deciding which test
levels to apply, which of the following sentences is true?- AAlthough more realistic, upper level tests should exist in less quantity than lower level tests.
- BDevelopers should focus only on lower level tests, and testers on upper level tests.
- CManual tests are at the bottom of the pyramid as they should be the minority
- DTests in upper levels run faster than tests in the lower levels
39The security vulnerability called gotofail in Apple’s TLS/SSL implementation is an example of:
- AA code formatting problem that could have been automatically fixed by using tools for correcting
indentation. - BA boundary value problem that could have been easily caught by the on/off domain testing
strategy - CA problem of non-reachable code that could have been easily caught through analysis of the
control flow graph. - DA fault that could have been easily caught by automated test input generation using genetic
algorithms.
- AA code formatting problem that could have been automatically fixed by using tools for correcting
40A decision table is a software model in which a response is determined based on Boolean conditions over a number of input variables. For which of the following cases is a decision table most suitable?
- AWhen all inputs are from finite domains such as integer ranges or enumerations.
- BWhen the response depends on the order in which inputs are evaluated.
- CWhen the Boolean expressions formed by the conditions are mutually exclusive.
- DWhen the response depends on prior inputs or output of the system under test.
Information
- Description
- Computer Science Quiz on Software and Quality Testing Midtem 2017, created by Bas Musters on 04/07/2017.
- Author
- Bas Musters
- Language
- English
- Views
- 112
- Tags
- Rating
- No ratings yet Rate this quiz