Black-box and White-box Testing : Week 3 Quiz answers

Writing Requirements for Testability

1) A good requirement properly defines system functionality.

a) False b) True

ANS - b) True

2) Good requirements should be...(Choose all that apply)

a) Unambiguous
b) Complete
c) Vague
d) Consistent
e) Modifiable
f) Final
g) Prioritized
h) Traceable
i) Verifiable
j) Unquantifiable

ANS -

a) Unambiguous
b) Complete
d) Consistent
e) Modifiable
g) Prioritized
h) Traceable
i) Verifiable

3) If you cannot test a requirement..

a) the System is certainly not easy to use.
b) the tests must be incorrect.
c) there is no way to know if you have successfully completed the project.
d) the customer will never know.

ANS -
c) there is no way to know if you have successfully completed the project.

Bad Requirements for Testability

1) Which of the following is not true: Requirements should be..

a) Unambiguous
b) Clear
c) Vogue
d) Precise
e) Understandable

ANS c) Vogue

2) What is one way to help ensure that your requirements are clear, precise, and unambiguous?

a) Ask your boss if they are okay requirements.
b) Make assumptions about the input.
c) Develop test cases for each requirement.
d) Check the expected output and see if it matches actual output.

ANSc) Develop test cases for each requirement.

3) Border cases can occur when requirements are vague.

a) True b) False

ANS - a) True.

Writing Test Cases for Requirements

1) Say you want to do test-driven development (TDD), what three things must you define to construct your tests?

a) Input, Procedure, Actual Output.
b) Input, Requirement, Expected output.
c) Input, Test Procedure, Expected Output.
d) Input, Expected Procedure, Actual Output.

ANS - c) Input, Test Procedure, Expected Output.

2) Is the following a good requirement: 'When showing user information, all relevant information about the user must be shown'?

a) Yes b) No

ANS - b) No

3) There are some vague and ambiguous words that should automatically raise a red flag when reading requirements, What are some of those words? (Check all that apply)

a) Eventually
b) Sometimes
c) Bad
d) Clearly
e) At some point
f) Effective
g) Similar
h) Always
i) None of the above

ANS - 
a) Eventually
b) Sometimes
c) Bad
d) Clearly
e) At some point
f) Effective
g) Similar
h) Always

4) Poor requirements can be better written by first writing test cases.

a) True b) False

ANSa) True

5) Test consist of {Input, Test Procedure, and Expected Output}. Which of these three components are used to induce the conditions you are seeking to test?

a) Input
b) Output
c) Test Procedure

ANSa) Input

6) When speaking of Input, Test Procedure, and Output, which is these is described by the following statement. What and how will you measure?

a) Test Procedure
b) Input
c) Output

ANSa) Test Procedure

7) When Speaking of Input, Test Procedure, and Output, which of these is described by the following statement: What and how will you measure?

a) Test Procedure
b) Input
c) Output

ANS -a) Test Procedure

Fixing Requirements for Testability

1) Fill in the blanks: Use ______ , ______ and ______ to help redefine requirements.

a) Expected Output, Common Sense, Input.
b) Input, Test Procedure, Expected Output.
c) Test Cases, Requirements, Test Procedure.

ANSb) Input, Test Procedure, Expected Output.

2) Developing test cases for requirements can..

a) increase fault avoidance.
b) help write better requirements.
c) decrease fault tolerance.
d) create bad requirements.

ANS b) help write better requirements.

3) You should analyze your requirements for testability.

a) False b) True

ANSb) True

4) Sometimes in requirements, you have to have placeholders: words/concepts that you assume are defined somewhere else. Given the requirement: "When temperature reaches threshold, an alarm will be raised within 2 seconds", what are the placeholders? (Check all that apply)

a) Seconds
b) Threshold
c) Temperature
d) Alarm

ANS -
b) Threshold
d) Alarm

Are these Requirements Testable?

1) Is the following requirement testable for a web browser? 'When concurrent requests arrive in high volume, the server shall allocate more threads and handle all requests successfully'. (Check all that apply).

a) Testable as is
b) Not testable. No indication of how many threads will be allocated
c) Not testable. What does 'Successfully' mean?

ANS - b) Not testable. No indication of how many threads will be allocated
c) Not testable. What does 'Successfully' mean?

2) Is the following requirements testable for a web-based word processor? 'When the application loses  network connectivity on a PC with sufficient local filesystem space, it shall save a draft of the current document to local storage in the user's home folder'.(Check all that apply)

a) Testable as is
b) No testable. No indication of where on the filesystem the document will be stored.
c) Not testable. No indication of how long it takes to detect loss of connectivity.

ANS -a) Testable as is

3) Is the following requirements testable for a web server? ' If the web server is breached by an attacker, it can be partitioned into multiple processes with different privileges to prevent the attack from spreading'. (Check all that apply).

a) Testable as is.
b) Not testable because wo don't know how the system is partitioned.
c) Not testable because it is unclear how privileges are allocated or how they would keep the attack from spreading.
d) Not testable because you can't prevent an attacker from breaking into your system.

ANS
b) Not testable because wo don't know how the system is partitioned.
c) Not testable because it is unclear how privileges are allocated or how they would keep the attack from spreading.

4) Is the following requirements testable for a door security system? 'Given a locked door, When a user presents an invalid authorization token to the door sensor, the door shall remain locked and an audible sound will be played from a piezo buzzer'. (Check all that apply).

a) Testable as is
b) Not testable because we don't state how loud the sound is.
c) Not testable because the requirement does not describe what happens if the door is unlocked.

ANSa) Testable as is

Introduction to User Stories and Behavior-Driven Development

1) Why are User Stories important in software testing?

a) They allow the system's user to provide important feedback regarding system testing.
b) They provide a way of developing software requirements by viewing the system from a user's perspective.

ANS
b) They provide a way of developing software requirements by viewing the system from a user's perspective.

2) User Stories are mainly expressed using the rule...

a) The < role > should not be able to < feature > because < reason >
b) As a < role >, I want < feature > so that < reason >
c) When I < action>, I expect < result>

ANSb) As a < role >, I want < feature > so that < reason >

3) Why are roles used in User Stories?

a) To define the role that each component has in the system under test
b) To identify the role of each engineer involved in the system's development.
c) To identify all the different kinds of users in the end product.

ANSc) To identify all the different kinds of users in the end product.

4) Why are reason useful in User Stories? (Check all that apply)

a) To prioritize features
b) To improve testing by providing context
c) To convince the leading engineer regarding the implementation of a feature.
d) To detect overlapping functionality between features.
e) To justify the importance of testing a specific feature.

ANS -
a) To prioritize features
b) To improve testing by providing context
d) To detect overlapping functionality between features.

5) Epics are different from detailed User Stories because...

a) they involve a story that applies to a broad range of users.
b) they are very detailed in describing how a feature should be implemented, for a broad range users.

ANS -
a) they involve a story that applies to a broad range of users.

6) The Gherkin language is an effective way to...

a) express a User Story in such a way that it can be used to generate an implementation of the desired feature.
b) express a User Story in such a way that it can be used to generate tests.

ANSb) express a User Story in such a way that it can be used to generate tests.

7) Behavior-driven development puts the user at the center of the testing cycle.

a) True b) False

ANSa) True

Regular Expressions 101

1) Consider the Regular Expression(Hello World)*. Which of the following strings does it match? (Check all that apply)

a) Hello world
b) Nothing (empty string)
c) hello world
d) World Hello
e) Hello WorldHello World

ANS - 
a) Hello world
b) Nothing (empty string)
e) Hello WorldHello World

2) 123-454 It was the best of times, "it was the worst of times", it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair.
The Regular Expression [ a-zA-Z] + s matches 18 places in the text. How many places does the Regular Expression [a-zA-Z]*?s match?

a) 15
b) 18
c) 20
d) 24
e) 30

ANS - d) 24

3) Which on of the strings does the following Regular Expression match?

(\a*(cu(((?i)kes)|cumber)+))){2}

a) cuKeScucumbercumber
b) cucumberCUKES
c) 34cukes
d) cu123cumbercukes

ANS - a) cuKeScucumbercumber

4) At what kinds of strings will the Regular Expression \\\\A-Z(?i)(a-z)*find a match in Java? (Check all that apply)

a) Strings that start with one backslash, then a capital letter, then any number of case-insensitive letters.
b) Strings that start with two backslashes, then a capital letter, then any number of case-insensitive letters.
c) Strings that start with two backslashes, any number of capital letters, ans one or zero case-insensitive letters.
d) Strings that start with four backslashes, then a capital letter, then any number of case-insensitive letters.

ANS - 
b) Strings that start with two backslashes, then a capital letter, then any number of case-insensitive letters.
d) Strings that start with four backslashes, then a capital letter, then any number of case-insensitive letters.

Comments

Popular Posts