Software Specs Flashcards

1
Q

Key observations

A

First, program specifications have to be made explicit, or else there cannot be
effective communication between those implementing code and those testing it.
Second, development and testing of a program are often done independently. This
helps to ensure that errors in the code are caught.
Third, there are only finitely many resources available to development teams; not
every bug can be found and caught.
Fourth, program specifications are not static; they evolve over time, and programming
teams need to be able to adapt to these changes.

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

Classifications of testing

A

Manual, automated, black-box, white-box

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

Black-box testing

A

Black-box testing refers to testing where the tester can see nothing about the tested
program’s internal mechanisms: as though the program is contained inside an opaque
box. The tester can only issue inputs to the program, observe the program’s outputs,
and determine whether they meet the specifications required of the program.

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

White-box testing

A

White-box testing refers to testing in which the internal details of the program being
tested are fully available to the tester. The tester can use these internal details to
perform a more precise analysis of the tested program and uncover inputs that are
more likely to trigger buggy behavior.

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

advantages of automated testing

A

we can
potentially spot bugs more quickly through the speed advantage of a computer over a
human in issuing inputs and checking outputs. Additionally, there is no need to write
tests: they are generated by the computer itself. Moreover, if the software changes,
there is no need to update the tests by hand, as the computer will generate new tests
relevant to the updated software.

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

advantages of manual testing is

A

humans are potentially
better able to select an efficient set of tests: computer-generated test suites can be
rather bloated. Additionally, humans can potentially construct a test suite with better code coverage than a computer program could, though this is not guaranteed.

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

semi-automated approach

A

combination of automated and manual

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

advantages of Black-box testing

A

First, it does not
require modifying the code, that is, introducing probes into the code.

Second, does not need to study the code to be tested.

Third, can be performed on any format of code, whether it is
managed code, binary code, obfuscated code, etc.

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

advantages of white-box testing

A

the tester is potentially able to construct a more
efficient suite of test cases with potentially better coverage than black-box testing
could.

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

constraints that prevent us from making testing entirely automatic

A

testing is a hard enough problem even for a small piece of code.

And if
a program has a loop, there could potentially be an infinite number of routes through
the code, in which case it becomes impossible to test the code under all possible
conditions.

And if we don’t have a specification for our program, then no testing can be done at
all

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

Safety properties

A

state that something bad will never happen, for example, an
assertion violation. We will momentarily look at other forms of safety properties such
as types and type-state properties.

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

liveness properties state

A

something good will eventually happen.
Examples of liveness properties include program termination and starvation freedom.
Starvation refers to a problem in scheduling algorithms wherein a process is
perpetually denied necessary resources to process its work.

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

Type-state properties

A

another form of safety properties. They extend types to
capture temporal properties of objects. For instance, the program must not read from
an object of type java.net.Socket until it is connected.

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

Assertions

A

general form of safety properties that allow the programmer to
specify that a certain predicate must always hold at a certain point in the program.
Assertions can be implicit such as checking that a variable P is not null before
dereferencing it each time in a managed language like Java. They can also be explicit,
for example, when checking whether a variable Z equals 42 at a certain point in the
program.

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

Pre and Post conditions

A

further generalize assertions. Pre-conditions must be true
before a statement or a method while post-conditions must be true after the statement
or method is complete.

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