Chapter 4 Flashcards

1
Q

Test Techniques

A

Dynamic Testing

Analysis → what to test

Design → how to test

  • Used in test analysis, test design and test implementation activities
  • Depends on context, test maturity and development maturity
  • Help in identifying
    • Test conditions
    • Test Cases
    • Test Procedures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Black Box or Behavioral-based

A
  • Don’t care about the code
  • Based on an Analysis of the appropriate ttest basis
  • SRS → software requirements document
  • BRD → business requirements document
  • FRD → functional requirements document
  • Non-functional requirement document

Common characteristics of black-box test techniques include the following:
• Test conditions, test cases, and test data are derived from a test basis that may include software
requirements, specifications, use cases, and user stories
• Test cases may be used to detect gaps between the requirements and the implementation of the
requirements, as well as deviations from the requirements
• Coverage is measured based on the items tested in the test basis and the technique applied to
the test basis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

White Box or Structural or Architectural

A
  • Understand the programming language
  • Internal structure
  • Code
  • Software architectural
  • We care about the processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Experience-based

A
  • Understand
  • Knowledge and experience
  • No documentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the definition of “test technique”?

A

→ A procedure used to define test conditions, design test cases, and specify test data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

“Use cases’ are examples of test basis for

A

→ Black-box test technique

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

“Knowledge of testers and developers” is one of the test basis for

A

→ Experience-based test technique

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which one of the following options is categorized as a black-box test technique?

A

→ Techniques based on formal requirements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Black Box Techniques

A
  • Test condition, test cases and test data are derived from a test basis
  • -Software requirements
  • Specifications
  • Use cases
  • User Stories
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Equivalence Partitioning
A
  • All testing levels
  • Divide (partition)
  • Also known as equivalence classes
  • Execute representatives from ALL equivalence partitions
  • If one condition in a partition works we assume they all work
  • Invalid equivalence partitions should be tested individually
  • Partitions are called equivalence classes
  • Partition that contains values is called a valid equivalence partition
  • Partition that contains invalid values is called an invalid equivalence partition
  • Each value must belong to one and only one equivalence partition
  • Any partition may be divided into sub-partitions if required

To achieve 100% coverage with this technique, test cases must cover all identified partitions (including
invalid partitions)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. Boundary-value Analysis
A
  • We need two test cases per boundary
  • A place between two partition
  • Is an extension of equivalence partitioning, but can only be used when the partition is ordered. The minimum and maximum values of partition are its boundary values.
  • Some variations of this technique identify three boundary values per boundary: the values before, at, and just over the boundary
  • Analysis can be applied at all test levels
  • Generally used to test requirements that call for a range of numbers
  • Is measured as the number of boundary values tested, divided by the total number of identified boundary test values.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

2-value

Boundary

A
  • Focused on testing at the minimum and maximum values of each partition
  • Take:
    • The min and max (boundary) values of each valid partition
    • The first or last value respectively in each of the invalid partitions bordering the valid partition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

3-value

Boundary

A
  • Full boundary value
  • Focused on testing at the boundaries between partitions PLUS both one value on either side of each boundary (as close as you can get)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. Decision Table Testing
A
  • Each column corresponds to a decision rule that defines a unique combination of conditions which results in the execution of the actions associated with that rule
  • The value of the conditions and actions are usually shown as Boolean values (true or false) or discrete values (red, green and blue)
  • The common minimum coverage standard for decision table testing is to have at least one test case per decision rule in the table.
  • Coverage is measured as the number of decision rules tested by at least one test case, divided by the total number of decision rules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. State Transition Testing
A
  • Used when an aspect of the system is in a ‘finite state machine’
    • Limited number of states
    • State is determined by the rules of the machine
  • State transition diagram shows the possible software states, as well as how the software enters, exists, and transitions between states
  • A transitions is initiated by an event. The event results in a transition
  • The state change may result in the software taking an action
  • A state transition table shows all valid transitions and potentially invalid transitions between states
  • State transition diagrams normally show only the valid transitions and exclude the invalid transitions
  • Tests can be designed to cover a typical sequence of states, to exercise all states, to exercise every transition, to exercise specific sequences of transitions
  • Coverage is commonly measured as the number of identified states or transitions tested, divided by the total number of identified states or transitions in the test object, normally expressed as a percentage.

States are the squares

Transitions are the lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. Use Case Testing
A
  • Are associated with actors (human users, external hardware) and subjects (the component or system)
  • Each use case specifies some behavior that a subject can perform in collaboration with one or more actors
  • A use case can be described by interactions and activities, as well as preconditions, postconditions and natural language
  • A use case can include possible variations of its basic behavior
  • Tests are designed to exercise the defined behaviors
  • Coverage can be measured by the percentage of use case behaviors tested divided by the total number of use case behaviors, normally expressed as a percentage

Tests are designed to exercise the defined behaviors (basic, exceptional or alternative, and error handling)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which of the following best describes the behaviors defined in a use case that should be covered by tests?

A

→ Basic, exception and error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Question #4.2.01

An employee’s bonus is to be calculated. It cannot be negative, but it can be calculated down to zero. The bonus is based on the length of employment:

  • less than or equal to 2 years
  • more than 2 years but less than 5 years
  • 5 to 10 years inclusively
  • longer than 10 years

What is the minimum number of test cases required to cover all valid equivalence partitions for calculating the bonus?

A

The 4 equivalence partitions correspond to the description in the question, i.e. at least one test case must be created for each equivalence partition 1. Equivalence partition: 0 ≤ employment time ≤ 2. 2. Equivalence partition: 2 < employment time < 5. 3. Equivalence partition: 5 ≤ employment time ≤ 10. 4. Equivalence partition: 10 < employment time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Question #4.2.02

A speed control and reporting system has the following characteristics:

  • If you drive 50 km/h or less, nothing will happen.
  • If you drive faster than 50 km/h, but no more than 55 km/h, you will be warned.
  • If you drive faster than 55 km/h but not more than 60 km/h, you will be fined.
  • If you drive faster than 60 km/h, your driving license will be suspended.
  • The speed in km/h is available to the system as an integer value.

Which would be the most likely set of values (km/h) identified by applying the boundary value analysis, where only the values on the boundaries of the equivalence classes are selected?

A

The following partitions can be identified: 1. <= 50, boundary value 50 2. 51 – 55 boundary values 51, 55 3. 56 – 60 boundary values 56, 60 4. >=61 boundary value 61 Boundary value according to glossary V.3.2: A minimum or maximum value of an ordered equivalence partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which of the following statements BEST describes how test cases are derived from a use case?

A

Test cases are created to exercise defined basic, exceptional and error behaviors performed by the system under test in collaboration with actors.

This explains that each use case specifies some behavior that a subject can perform in collaboration with one or more actors. It also (later) explains that tests are designed to exercise the defined behaviors (basic, exceptional and errors)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

You are testing an unattended gasoline pump that only accepts credit cards. Once the credit card is validated, the pump nozzle placed into the tank, and the desired grade selected, the customer enters the desired amount of fuel in gallons using the keypad. The keypad only allows the entry of digits. Fuel is sold in tenths (0.1) of a gallon, up to 50.0 gallons.

Which of the following is a minimum set of desired amounts that covers the equivalence partitions for this input?

A

There are three equivalence partitions: - No sale completed (0.0 gallons) - A valid sale occurs (0.1 to 50.0 gallons) - An invalid amount is selected (50.1 or more gallons) Is correct. This set of input values has exactly one test per equivalence partition

22
Q

Question #4.2.13

You are testing an e-commerce system that sells cooking supplies such as spices, flour, and other items in bulk. The units in which the items are sold are either grams (for spices and other expensive items) or kilograms (for flour and other inexpensive items). Regardless of the units, the smallest valid order amount is 0.5 units (e.g., half a gram of cardamom pods) and the largest valid order amount is 25.0 units (e.g., 25 kilograms of sugar). The precision of the units field is 0.1 units.

Which of the following is a set of input values that cover the boundary values with two-point boundary values for this field?

A

There are three equivalence partitions, with the boundaries as shown: - Invalid too low (0.4 and below) - Valid (0.5 to 25.0) - Invalid too high (25.1 and above) Is correct. Each of those four two-point boundary values are included in this set of tests

23
Q

Question #4.2.14

Consider the following decision table for the portion of an online airline reservation system that allows frequent flyers to redeem points for reward travel:

Suppose that there are two equivalence partitions for the condition where Account/password okay is not true, one where the account is invalid and another where the account is valid but the password is invalid. Suppose that there is only one equivalence partition corresponding to the condition where Account/password okay is true, where both the account and password are valid.

If you want to design tests to cover the equivalence partitions for Account/password okay and also for this portion of the decision table, what is the minimum number of tests required?

A

There is at least one test for each column in the decision table. However, column one requires two tests, one where the account is invalid and another where the account is valid, but the password is invalid, so the minimum number of tests is four.

24
Q

Question #4.2.16

You are testing an e-commerce system that sells cooking supplies such as spices, flour, and other items in bulk. The units in which the items are sold are either grams (for spices and other expensive items) or kilograms (for flour and other inexpensive items). Regardless of the units, the smallest valid order amount is 0.5 units (e.g., half a gram of cardamom pods) and the largest valid order amount is 25.0 units (e.g., 25 kilograms of sugar). The precision of the units’ field is 0.1 units.

Which of the following is a MINIMAL set of input values that cover the equivalence partitions for this field?

A

There are three equivalence partitions, with the boundaries as shown: - Invalid too low (0.4 and below) - Valid (0.5 to 25.0) - Invalid too high (25.1 and above)

25
Q

Question #4.2.17

Which of the following best describes the behaviors defined in a use case that should be covered by tests?

A

The basic, exception and error behaviors should be covered with tests for a use case. A good use case should define all of these.

26
Q

Question #4.2.19

Which of the following statements about use case testing are True?

  1. A use case actor may be a business user; a use case subject is the system.
  2. Error messages are tested in the main behavioural flow of the use case.
  3. Interactions may be represented by activity diagrams.
  4. Coverage cannot be measured for use case testing.
  5. Interactions may change the state of the subject.
A
  1. A use case actor may be a business user; a use case subject is the system.
  2. Interactions may be represented by activity diagrams.
  3. Interactions may change the state of the subject.
27
Q

Question #4.2.25

Which of the following BEST matches the descriptions with the different categories of test techniques?

  1. Test cases are based on test basis which may include the requirements, use cases and user stories
  2. Test cases are based on the test basis which may include the software architecture or code
  3. Test cases can show deviations from the requirements
  4. These test techniques are applicable to both functional and non-functional testing
  5. Tests are based on knowledge of developers, users, and other stakeholders

Black - Black-box test techniques

White - White-box test techniques

Experience - Experience-based test techniques

A

Black - 1,3,4
White - 2
Experience - 5

28
Q

Question #4.2.33

Which of the following statements are true for the equivalence partitioning test technique?

I. Divides possible inputs into classes that have the same behavior

II. Can be used to create both positive and negative test cases

III. Makes use of only positive test cases for the equivalence partitions

IV. Must always include at least two values from every equivalence partition

V. Can be used only for input testing

A

I. Divides possible inputs into classes that have the same behavior

II. Can be used to create both positive and negative test cases

29
Q

Which technique shows all valid transitions and potentially invalid transitions between states, as well as the events, and resulting actions for valid transitions?

A

State transition

30
Q

Question #4.2.38

Use case testing is useful for which of the following?

I. Designing acceptance tests with users or customers

II. Making sure that the mainstream business processes are tested

III. Identifying the percentage of statements exercised by a sets of tests

IV. Identifying the maximum and minimum values for every input field

A

I. Designing acceptance tests with users or customers

II. Making sure that the mainstream business processes are tested

31
Q

Question #4.2.39

Arrive-and-Go airline wants to clarify its baggage handling policy, whilst maximizing revenues, and will introduce the following tariffs for all baggage per individual customer (weights are rounded up to the nearest 0.1Kg):

The first 2Kg will be carried free of charge.

The next 10 Kg will be carried for a flat charge of $10.

An additional 15Kg will be charged a total charge of $17.

Luggage over this amount will be charged at $5 per Kg, up to a maximum of 150Kg per person.

No passenger may take more that 150Kg with them.

Which of the following would constitute boundary values for baggage weights in the price calculation?

A

2, 12.1, 27, 150.1

32
Q

Why does the boundary value analysis provide good test cases?

A

Because errors are frequently made during programming of the different cases near the ‘edges’ of the range of values

33
Q

White Box Techniques

A
  • Can be used on all levels
  • Mainly on component level, but also on integration and system / acceptance and level
  • Serves 2 purposes:
    • Test coverage measurement
    • Structural test case design
  • 100% coverage does NOT equal 100% tested

Types of coverage

  • Can be measured on all levels:
    • System Acceptance levels
      • Requirements, menu options, screens, database, files
    • Integration level
      • Interfaces, interactions, call coverage of modules
    • Component level
      • Code coverage such as statement, decision, branch
34
Q

Statement Coverage

A
  • Achieve 100% statement coverage

- Measure statement coverage

35
Q

How to measure statement coverage?

A

Statement coverage = Number of statements covered / Total number of statements

36
Q

What is the meaning of achieving 100% statement coverage?

A

→ Test cases are designed to pass through all the executable statements of executable code

37
Q

Which one of the following is the BEST description of statement coverage?

A

→ It is a metric, which is used to calculate and measure the percentage of statements in the source code which have been executed.

38
Q

How is statement coverage determined?

A

→ Number of executable statements tested divided by the total number of executable statements

39
Q

Decision Coverage

A
  • Achieve 100%
  • Measure decision coverage

Decision coverage is stronger than Statement coverage. Because it covers more branches.

40
Q

Question #4.3.01

The following statement refers to decision coverage:

“When the code contains only a single ‘if’ statement and no loops or CASE statements, and its execution is not nested within the test, any single test case we run will result in 50% decision coverage.”

Which of the following statement is correct?

A

The statement is true. Any single test case would cause the outcome of the “if” statement to be either true or false.

Is correct. Since any test case will cause the outcome of the “if” statement to be either TRUE or FALSE, by definition we achieved 50% decision coverage

41
Q

Question #4.3.02

Which one of the following is the description of statement coverage?

A

It is a metric, which is the percentage of statements in the source code that have been executed

42
Q

Question #4.3.04

Which of the following descriptions of statement coverage is CORRECT?

A

Statement coverage is a measure of the proportion of executable statements in the source code exercised by tests.

Is correct. Statement coverage is a measure of the proportion of executable statements exercised by tests (normally presented as a percentage)

43
Q

Question #4.3.05

Which of the following descriptions of decision coverage is CORRECT?

A

Decision coverage is a measure of the proportion of decision outcomes in the source code exercised by tests.

Decision coverage is a measure of the proportion of decision outcomes exercised (normally presented as a percentage)

44
Q

Question #4.3.07

Consider a mobile app that allows customers to access and manage their bank accounts. A user story has just been added to the set of features that checks customers’ social media accounts and bank records to give personalized greetings on birthdays and other personal milestones. Which of the following test techniques could a PROGRAMMER use during a unit test of the code to ensure that coverage of situations when the greetings ARE supposed to occur and when the greetings ARE NOT supposed to occur?

A

Decision testing

Decision testing involves test cases that follow the control flows that occur from a decision point, which in this case would be deciding whether a greeting should or should not be given

45
Q

A batch application has been in production unchanged for over two years. It runs overnight once a month to produce statements that will be e-mailed to customers. For each customer, the application goes through every account and lists every transaction on that account in the last month. It uses a nested-loop structure to process customers (outer loop), each customer’s accounts (middle loop), and each account’s transactions (inner loop).

One night, the batch application terminates prematurely, failing to e-mail statements to some customers, when it encounters a customer with one account for which no transactions occurred in the last month. This is a very unusual situation and has not occurred in the years since this application was placed in production.

While fixing the defect, a programmer asks you to recommend test techniques that are effective against this kind of defect. Which of the following test techniques would most likely have been able to detect the underlying defect?

A

Decision testing

For a loop construct, statement coverage only requires that all statements within the loop are executed, but decision coverage requires testing of both the conditions where the loop is executed and when it is bypassed

46
Q

Question #4.3.11

If you have a section of code that has one simple IF statement, how many tests will be needed to achieve 100% decision coverage?

A

2

A simple IF statement will be composed of If … then … else…. end if. There are two decision outcomes, one for the result of the If being true and one for it being false. Since 100% decision coverage requires at least one test case for each decision outcome, two tests are needed.

47
Q

Experience-based Technique

A
  • When applying experienced-based, the test cases are derived from the tester’s skill and intuition, and their experience with similar applications and technologies.
  • These techniques can be helpful in identifying tests that were not easily identified by other more systematic techniques.
  • Coverage can be difficult to assess and may not be measurable
  • Knowledge and expertise
48
Q

Error Guessing

A
  • Is a technique used to anticipate the occurrence of mistakes, defects, and failures, based on the tester’s knowledge
  • Create a list of possible mistakes, defects, and failures, and design tests that will expose those failures.
49
Q

Exploratory Testing

A
  • Informal tests are designed, executed, logged, and evaluated dynamically during test execution
  • Session-based testing to structure the activity
  • Exploratory testing is most useful when there are few or inadequate specifications or significant time pressure on testing
50
Q

Checklist-based Testing

A
  • Write some test conditions in a checklist

- Write the checklist when we are testing