C3 Flashcards

1
Q

random testing

A
  1. identify input domain of the program
  2. for each input parameter, generate a random but legal value according to some probability distribution (typically uniform)
  3. determine expected value for each complete valid input
  4. apply the inputs to system under test (SUT)
  5. determine if program achieves the appropriate outputs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

why random testing?

A
  • cheap (may need more tests, but generating tests is easy)
  • gives reliability criteria (probability theory)
  • can be used without knowledge of input space, when code is not available and when large volume of data is necessary)
  • useful complement to other testing techniques (eg. input space partitioning)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2 problems with random testing

A

prediction problems: uniform distribution for generating input values might easily be wrong, boundary cases or relevant single values might never be generated

reliability problems: criteria formally based only on number of tests, not on program size (but larger programs do have more faults)

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

the oracle problem

A

given a test case and an input, what is the expected output and how can we determine if the observed output is consistent with the expected output?

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

calculating program reliability

A

calculate for program P its failure rate theta that we assume constant
- theta is the probability that P will fail a given test
- 1 - theta is the probability that P will pass a given test

1/theta is the mean time to failure: the number of expected runs for P to fail at least once

  • C, the confidence level, is the probability that at least one failure occurs in 1/theta tests
  • 1 - C is the probability that no failure will occur in 1/theta tests
  • the probability of universal success (N independent tests) = (1 - theta)^N
  • the probability of at least one failure = 1 - (1 - theta)^N
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

we can calculate theta by upper bounding the probability of at least one failure in N tests by the confidence C

A

1 - (1 - theta)^N <= C

1/theta >= 1 / (1 - (1 - C)^(1/N))

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

number of needed tests given a failure rate theta and confidence C

A

log(1- C) / log (1 - theta)

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

criticism against random testing

A
  • oracle problem
  • unifrom-distributed based predictions can easily be wrong
  • corner faults might escape detection
  • reliability analysis does not account for program structure

in order to find most errors we should spread the test cases as much as possible using partitions (adaptive random testing)

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

P-measure

A

probability of finding at least one failing test case P_r = 1 - (1 - theta)^N

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

E-measure

A

expected number of triggering values E_r = N*theta

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

F-measure

A

expected number of test cases required to trigger an error in 1/theta runs with confidence C: F_r >= log(1- C) / log (1 - theta)

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

random versus partition testing

A

partition testing cannot perform worse than random testing

partition testing can be up to k times better than random testing, where k is the number of partitions if there are many small sub-domains and very few large ones.

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

adaptive random testing

A

spreads the test cases as much as possible

3 versions: PART, ART, MART

but requires large amounts of computations due to distance calculations and comparisons

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

Partition Based Adaptive Random Testing (PART)

A

for two dimensions:
1. R is the region delimited by C that goes from X_min, Y_min to X_max, Y_max
2. select random test T = X1, Y1 in R
3. it it is a failure, report failure and stop
4. otherwise, T splits R in 4 regions
5. select the largest of these areas and repeat from step 2

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

Bisection based Adaptive Random Testing

A

for two dimensions:
1. select random test in R
2. if it is a failure, report failure and stop
3. otherwise, split R in four EQUAL regions
4. for each region that has not been tested repeat the process from step 1

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

Basic Adaptive Random Testing (ART)

A
  1. select random test X
  2. if failure, report and stop
  3. otherwise, add X to executed tests T
  4. select k candidate random tests C = {X1, …, Xk}
  5. select X from C with the largest distance from executed tests T
  6. repeat the process from step 2
17
Q

Mirror Adaptive Random Testing (MART)

A
  1. partition input space into k disjoint subdomains, one is chosen as source subdomain, others are mirror subdomains
  2. select random test X in source subdomain, execute this test case and stop if failure
  3. apply mirror function to test case X to generate a test case for each mirror subdomain and execute test cases in sequential order, stop if failure
  4. repeat steps 2 and 3 until first failure or stopping condition