Black box Flashcards

Software testing is an important technique for assessing the quality of a software product. In this chapter, we will explain the following: 1 • • • • • the basics of software testing, a verification and validation practice, throughout the entire software development lifecycle the two basic techniques of software testing, black-box testing and white-box testing six types of testing that involve both black- and white-box techniques. strategies for writing fewer test cases and still finding a

1
Q

What is black box testing?

A

Testing in which the tester does not know or have access to source code itself. It is derived from the box being ‘black’ or ‘opaque’. Tester knows inputs and expected output and tests.

Black box testing (also called functional testing) is testing that ignores the internal mechanism of a system or component and focuses solely on the outputs generated in response to selected inputs and execution conditions.

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

What is white box testing?

A

Testing where the tester knows or has access to source code, this would be the software developer. This is in reference that the box is invisible e.g.: white.

White box testing (also called structural testing and glass box testing) is testing that takes into account the internal mechanism of a system or component.

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

Software testing is part of what two processes?

A

Verification and Validation.

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

What is an informal definition of verification?

A

Verification: Are we building the product right?

Through verification, we make sure the product behaves the way we want it to. For example, on the left in Figure 1, there was a problem because the specification said that players should collect $200 if they land on or pass Go. Apparently a programmer implemented this requirement as if the player had to pass Go to collect. A test case in which the player landed on Go revealed this error.

Verification (the first V) is the process of evaluating a system or component to determine whether the products of a given development phase satisfy the conditions imposed at the start of that phase [11]. Verification activities include testing and reviews. For example, in the software for the Monopoly game, we can verify that
two players cannot own the same house.

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

What is an informal definition of validation?

A

Validation: Are we building the right product?

Through validation, we check to make sure that somewhere in the process a mistake hasn’t been made such that the product build is not what the customer asked for; validation always involves comparison against requirements. For example, on the right in Figure 1, the customer specified requirements for the Monopoly game – but the programmer delivered the game of Life. Maybe the programmer thought he or she “knew better” than the customer that the game of Life was more fun than Monopoly and wanted to “delight” the customer with something more fun than the specifications stated. This example may seem exaggerated – but as programmers we can miss the mark by that much if we don’t listen well enough or don’t pay attention to details – or if we second guess what the customer says and think we know better how to solve the customer’s problems.

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

What is software testing?

A

Software testing is the process of analyzing a software item to detect the differences between existing and required conditions (that is, bugs) and to evaluate the features of the software item [9, 12].

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

Verification vs Validation.

A

Verification
Are we building the product right?
“I landed on “Go” but didn’t get my $200!”

Validation
Are we building the right product?
“I know this game has money and players and “Go” – but this is not the game I wanted.”

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

What are the 5 ways software may not be incorrect?

A

Mistake – a human action that produces an incorrect result

Fault [or Defect] – an incorrect step, process, or data definition in a program

Failure – the inability of a system or component to perform its required function within the specified performance requirement.

Error – the difference between a computed, observed, or measured value or condition and the true, specified, or theoretically correct value or condition

Specification – a document that specifies in a complete, precise, verifiable manner, the requirements, design, behavior, or other characteristic of a system or component, and often the procedures for determining whether these provisions have been satisfied.

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

Define ‘mistake’

A

a human action that produces an incorrect result.

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

Define ‘fault’ (aka ‘defect’)

A

an incorrect step, process, or data definition in a program.

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

Define ‘failure’

A

the inability of a system or component to perform its required function
within the specified performance requirement.

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

Define ‘error’

A

the difference between a computed, observed, or measured value or
condition and the true, specified, or theoretically correct value or condition.

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

Define ‘specification’

A

a document that specifies in a complete, precise, verifiable
manner, the requirements, design, behavior, or other characteristic of a system or component, and often the procedures for determining whether these provisions have been satisfied.

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

What is the order that errors, faults, and mistakes occur?

A

mistake > fault > failure > error

A mistake committed by a person becomes a fault (or defect) in a software artifact, such as the specification, design, or code.

This fault, unless caught, propagates as a defect in the executable code. When a defective piece of code is executed, the fault may become a visible anomaly (a variance from the specification or desired behavior) and a failure is observed

Otherwise, the fault remains latent. Testing can reveal failures, but it is the faults that must be found and removed [3]; finding a fault (the cause of a failure) can be time consuming and unpredictable. Error is a measure of just how incorrect the results are.

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

What do we try to cause during testing?

A

A purpose of testing is to cause failures in order to make faults visible [10] so that the faults can be fixed and not be delivered in the code that goes to customers. Another purpose of testing is to assess the overall quality level of the code. For example, a test team may determine a project with too many high-severity defects should be sent back to development for additional work to improve the quality before the testing effort should continue. Or, the management may have a policy that no product can ship if testing is continuing to reveal high-severity defects.

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

What are the two expense cases of testing?

A

To test, or not to test.

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

To minimize costs of testing, what is one goal of testing?

A

To minimize the costs associated with testing and with software failures, a goal of testing must be to uncover as many defects as possible with as little testing as possible

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

We want to write test cases that what likelyhood of uncovering how many faults?

A

In other words, we want to write test cases that have a high likelihood of uncovering the faults that are the most likely to be observed as a failure in normal use

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

All software testing is performed with what type of code?

A

Executable code, that is code that runs so we can perform tests against it.

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

What type of minimal code might need to be written to perform a test against?

A

Scaffolding code (or just scaffolding)

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

How is scaffolding defined?

A

Scaffolding is defined as computer programs and data files built to support software development and testing but not intended to be included in the final product [11].

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

What does scaffolding do?

A

Scaffolding code is code that simulates the functions of components that don’t exist yet and allow the program to execute [16]

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

What are the two components of scaffolding?

A

Scaffolding code involves the creation of stubs and test drivers.

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

What’s a stub?

A

Stubs are modules that simulate components that aren’t written yet, formally defined as a computer program statement substituting for the body of a software module that is or will be defined elsewhere [11]. For example, you might write a skeleton of a method with just the method signature and a hard-coded but valid return value.

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

What is a test driver?

A

Test drivers are defined as a software module used to involve a module under test and often, provide test inputs, controls, and monitor execution and report test results [11]. Test drivers simulate the calling components (e.g. hard-coded method calls) and perhaps the entire environment under which the component is to be tested [1].

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

What is a mock object?

A

Mock objects are temporary substitutes for domain code that emulates the real code. For example, if the program is to interface with a database, you might not want to wait for the database to be fully designed and created before you write and test a partial program. You can create a mock object of the database that the program can use temporarily. The interface of the mock object and the real object would be the same. The implementation of the object would mature from a dummy implementation to an actual database.

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

Software testing should be performed against what type of software.

A

All software! But especially large software systems.

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

How many types of software testing are there?

A

6

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

Each type of testing has what that defines the correct behavior the test is examining?

A

A specification

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

The specification’s goal is what?

A

Identify the failure.

To test the correct (expected) behavior against the incorrect behavior (observed failure).

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

How often should Software Testing be performed?

A

Software testing is an activity that should be done throughout the whole development process [3].

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

What are other V&V processes?

A

inspections and pair programming.

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

What is the formal definition of Validation?

A

Validation is the process of evaluating a system or component during or at the end of the development process to determine whether it satisfies specified requirements [11]. At the end of development validation (the second V) activities are used to evaluate whether the features that have been built into the software satisfy the customer requirements and are traceable to customer requirements. For example, we validate that when a player lands on “Free Parking,” they get all the money that was collected

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

What is the formal definition of Verification?

A

Verification (the first V) is the process of evaluating a system or component to determine whether the products of a given development phase satisfy the conditions imposed at the start of that phase [11]. Verification activities include testing and reviews. For example, in the software for the Monopoly game, we can verify that
two players cannot own the same house.

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

Name the types of software testing techniques?

A

Unit testing, Integration testing, Functional and System testing, Acceptance testing, Regression testing, Beta testing

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

What is the opacity of: Unit testing?

A

White box

37
Q

What is the opacity of: Integration testing?

A

Black and White box

38
Q

What is the opacity of: Functional and system testing?

A

Black box

39
Q

What is the opacity of: Acceptance testing?

A

Black box

40
Q

What is the opacity of: Regression testing?

A

Black and White box

41
Q

What is the opacity of: Beta testing?

A

Black Box

42
Q

What is the specification of: Unit testing?

A

Low-level design and/or code structure

43
Q

What is the specification of: Integration testing?

A

Low- and high-level design

44
Q

What is the specification of: Functional and System testing?

A

high-level design, requirements specification and analysis

45
Q

What is the specification of: Acceptance testing?

A

requirements specification

46
Q

What is the specification of: Regression testing?

A

Any changed documentation, high-level design

47
Q

What is the specification of: Beta testing?

A

None.

48
Q

What is the general scope of: Unit testing?

A

Small unit of code, no larger than a class

49
Q

What is the general scope of: Integration testing?

A

Multiple classes

50
Q

What is the general scope of: Functional testing?

A

Functional = the whole product; System = whole product in representative environment

51
Q

What is the general scope of: Acceptance testing?

A

Whole product in customer’s environment

52
Q

What is the general scope of: Beta testing?

A

Whole product in customer’s environment

53
Q

What is the general scope of: Regression testing?

A

Any of above

54
Q

Who performs: Unit testing?

A

Programmer(s) who wrote code

55
Q

Who performs: Integration testing?

A

Programmer(s) who wrote code

56
Q

Who performs: Functional and System testing?

A

Independent tester

57
Q

Who performs: Acceptance testing?

A

Customer

58
Q

Who performs: Beta testing?

A

Customer

59
Q

Who performs: Regressino testing?

A

Progammer(s) OR Independent tester

60
Q

What do you see when a test case fails?

A

You see the ‘failure’ but need to find the ‘fault still.

61
Q

When is the best time to find a ‘failure’?

A

As early in the development process as possible.

62
Q

When is it harder to find ‘fault’ that caused a ‘failure’?

A

The further you go into the development process.

63
Q

What are you likely to find if you ‘Unit’ test often enough?

A

The new failure was in the code you just wrote or tested, and will be easier to find than later on.

If you wait until system or acceptance testing, a failure could be anywhere in the system – you will have to be an astute detective to find the fault now.

64
Q

What is the formal definition of a Test Plan?

A

A test plan is a document describing the scope, approach, resources, and schedule of intended test activities. It identifies test items, the features to be tested, the testing tasks, who will do each task, and any risks requiring contingency plans [11]. An important component of the test plan is the individual test cases. A test case is a set of test inputs, execution conditions, and expected results developed for a particular objective, such as to exercise a particular program path or to verify compliance with a specific requirement [11].

65
Q

When should a Test Plan be established?

A

Early in the development cycle.

66
Q

Why is writing a Test Plan early helpful?

A

This allows you to think through a thorough set of test cases. If you wait until the end of the cycle to write and execute test cases, you might be in a very chaotic, hurried time period. Often good test cases are not written in this hurried environment, and ad hoc testing takes place.

67
Q

What is Ad Hoc testing?

A

With ad hoc testing, people just start trying anything they can think of without any rational roadmap through the customer requirements. The tests done in this manner are not repeatable.

68
Q

Name an example time when the Test Plan can be written?

A

as soon as customer requirements analysis has completed, the test team should start writing black box test cases against that requirements document.

69
Q

What’s one example of when a Test Plan should be written early?

A

By doing so this early, the testers might realize the requirements are not complete. The team may ask questions of the customer to clarify the requirements so a specific test case can be written. The answer to the question is helpful to the code developer as well. Additionally, the tester may request (of the programmer) that the code is designed and developed to allow some automated test execution to be done. To summarize, the earlier testing is planned at all levels, the better.

70
Q

Is the Test Planning and Test Execution a singular or iterative process?

A

Iterative (and essential)

71
Q

What tests should you write when the ‘requirements documentation’ is available?

A

Functional and System

72
Q

When the ‘requirements documentation’ changes which tests should change?

A

Functional and System

73
Q

Black box testing is also called what?

A

Functional testing or Behavioral testing

74
Q

What does black box testing focus on?

A

Determining whether or not a program does what it is supposed to do based on the ‘functional requirements’ based from the ‘requirements documentation’ provided by the customer of the code.

75
Q

Where do the ‘functional requirements’ come from?

A

the ‘requirements documentation’

76
Q

Where does the ‘requirements documentation’ come from?

A

provided from the ‘customer requirements analysis’ performed against the customer.

77
Q

How many categories does Black box testing attempt to find errors from?

A

5

78
Q

Black Box testing attempts to find errors from where?

A

The external behavior of the code as used by a customer.

79
Q

What are the categories Black box testing runs against?

A

(1) incorrect or missing functionality; (2) interface errors; (3) errors in data structures used by interfaces; (4) behavior or performance errors; and (5) initialization and termination errors.

80
Q

Black box testing determines if functions [blank] to work, according to the [blank]

A

APPEAR and SPECIFICATION

Through this testing, we can determine if the functions appear to work according to specifications. However, it is important to note that no amount of testing can unequivocally demonstrate the absence of errors and defects in your code.

81
Q

Who should perform the Black Box testing?

A

Independent tester, NOT the programmer who wrote code.

82
Q

Why should this person perform Black Box testing?

A

t is best if the person who plans and executes black box tests is not the programmer of the code and does not know anything about the structure of the code. The programmers
of the code are innately biased and are likely to test that the program does what they programmed it to do. What are needed are tests to make sure that the program does what the customer wants it to do. As a result, most organizations have independent testing groups to perform black box testing. These testers are not the developers and are often referred to as third-party testers. Testers should just be able to understand and specify what the desired output should be for a given input into the program, as shown in Figure 3.

83
Q

What is the flow of a Black box test?

A

Input > [program] (black box test) > output

84
Q

What part of the program and test does Black Box take into account?

A

Input and Output, without regard to internal code.

85
Q

What should the anatomy of a test case look like?

A

Test ID > Description (input) > Expected Results > Actual Results (output)

First, you give each test case a unique identifier. When you are tracking large projects, you might need to itemize those test cases that have not yet passed. This identifier is recorded in the first column. For example, you might need to say something like, “All my test cases are running except playerMovement1. I’m working on that one today.” Next
in the second column of the table, you specifically describe the set of steps and/or input for the particular condition you want to test (including what needs to be done to prepare for the test case to be run). The third column is the expected results for an input/output oracle – what is expected to come out of the “black box” based upon the input (as described in the “description”).

86
Q

What is an ‘oracle’?

A

An oracle is any program, process, or body of data that specified the expected outcome of a set of tests as applied to a tested object [1];

87
Q

What is one type of oracle for Black Box?

A

input/output oracle

88
Q

What does this Black Box oracle do?

A

This IOoracle is an oracle that specifies the expected output for a specified input [1]. In the last column, the actual results are recorded after the tests are run. If a test passes, the actual results will indicate “Pass.” If a test fails, it is helpful to record “Fail” and a description of the failure (“what came out”) in the actual results column.