1 1
Colorado State University Yashwant K Malaiya CS559 L 17
Quantitative Cyber-Security
CSU Cybersecurity Center Computer Science Dept
Quantitative Cyber-Security Colorado State University Yashwant K - - PowerPoint PPT Presentation
Quantitative Cyber-Security Colorado State University Yashwant K Malaiya CS559 L 17 CSU Cybersecurity Center Computer Science Dept 1 1 Topics Questions (lecture only) Testing Partitioning, Input mix Random testing,
1 1
CSU Cybersecurity Center Computer Science Dept
2
7 7
CSU Cybersecurity Center Computer Science Dept
8
October 23, 2020
8
9
10
October 23, 2020
10
11
October 23, 2020
11
12
October 23, 2020
12
Total number of elements
13
Assumptions:
create an error
all the faults.
14
15
exercised during testing
for detecting the defects in different sections of the code.
program.
– For example, if a program performs five separate operations, its input space can be partitioned into five partitions. – Functional partitioning only requires the knowledge of the functional description of the program, the actual implementation of the code is not required.
code level.
– If a software is composed of ten modules (which may be classes, functions or
16
– Random testing within the partition pi will randomly select from {pi1, pi2 …pin}. It is possible that some of them will get selected more often in a non-optimal manner. – Code within a sub-partition may be correlated relative to the probability of exercising some faults. Thus the effectiveness of testing may be diluted if the same sub-partition frequently gets chosen. – Sub-partitioning has a practical disadvantage when the operational profile is constructed, it will require estimating the operational probabilities of the associated sub-partitions.
17
10/23/20
17
18
10/23/20
18
– A. Find bugs fast? or –
– Quick & limited testing: Use operational profile (next slide) – High reliability: Probe input space evenly
main cause of failures in highly reliable systems. – Very high reliability: corner cases and rare combinations
– Vulnerability finders / exploiters look for these.
Software Reliability Engineering, Nov. 1994, pp. 196-205.
Reliability and Maintainability Symposium, 1994, pp. 334-337
19
20
21
10/23/20 FTC YKM
21
22
10/23/20 FTC YKM
22
– h1 is the number of faults that are hardest to find. – As testing and debugging continues, harder to find faults will tend to
Applicable to software and hardware
Y.K. Malaiya and S. Yang, ""The Coverage Problem for Random Testing”
23
10/23/20 FTC YKM
23
Adam's data (Product 1) 5 10 15 20 25 30 35 40 0.017 0.053 0.167 0.526 1.667 5.263 16.67 52.63 Detection rate Defects with this detection rate
Adams, IBM Journal of Research and Development, Jan. 1984
24
10/23/20 FTC YKM
24
become asymmetric.
likely to remove most easy to test bugs, while leaving almost all hardest to test bugs still in.
25
10/23/20 FTC YKM
25
What fault coverage is achieved by applying L test vector?
probability k/N
) 1 ( 1 C(L)
1
=
N k k L
M h N k
) 1 ( N k
N k ) 1 ( -
k L h
N k ) 1 ( -
0.975 0.274 Cr L ( ) 16 1 L 5 10 15 20 0.25 0.5 0.75 1 vectors expexted coverage
26
10/23/20 FTC YKM
26
3
L
1 k
10 ] ... 03 . 84 . 3 . 6 9 . 4 . 6 1 [4.2
C(15) Adder, Full CECL For estimated. be to need H
elements lower
Thus impact. an have test) to hard are that faults (i.e. k low
with terms L, large For Random) (for ) 1 ( 1
C(L) 87) (McClusky tests PR For
+ + + + + + + =
=
= =
k k L k k N k L N
M h N k M h C C
0.999 0.274 Cr L ( ) Cpr L ( ) 16 1 L 5 10 15 20 0.5 1
c11/10
Pseudorandom (PR) testing: a vector cannot repeat, unlike in true Random testing.
27
10/23/20 FTC YKM
27
– Inspection, unit testing, integration testing, system testing, ..
0.2 0.4 0.6 0.8 1 1.2 5 10 15 20 k
Hard to test Low hanging fruit
As testing time progresses, more of the faults are clustered to the left.
28
10/23/20 FTC YKM
28
Testing may be directed rather than random because
by random testing (for example recovery code)
be greater or less than k/N. P{a defect with dp pi not detected by L vectors} = (1 − 𝑞!)"
$ if the previous tests are not repeated, or the test
has a good idea of where to look.
P{a defect with dp pi not detected by ES} ≈ 0
– Unlikely in most real situations.
29
30
𝜇 𝑢 = 𝛾!𝛾"𝑓#$!%
31
10/23/20
31
An interpretation has been given by Malaiya and Denton (What Do the Software Reliability Growth Model Parameters Represent?).
1
1 1
Y.K. Malaiya, A. von Mayrhauser and P. Srimani, “An Examination of Fault Exposure Ratio,” IEEE Trans. Software Engineering, Nov. 1993, pp. 1087-1094.
32
10/23/20
32
Conference 1984, pp. 237-245.
Computers, 1990, pp. 582-586.
and Development, vol. 28, no. 1, pp. 2-14, Jan. 1984.
1986, pp. 110 - 123
combined ATE and BIST environment," Instrumentation and Measurement, IEEE Transactions on , vol.53, no.2, pp.300,307, April 2004.
33 33
CSU Cybersecurity Center Computer Science Dept
34
10/23/20 FTC YKM
34
35
10/23/20 FTC YKM
35
36
10/23/20 FTC YKM
36
Malaiya, Li, Bieman, Karcich, Skibbe, 1994 Li, Malaiya, Denton, 1998
37
10/23/20 FTC YKM
37
38
10/23/20 FTC YKM
38
1
1
i i i i i
39
10/23/20 FTC YKM
39
2 1 2 1
i i i i i i i i
i i i
40
10/23/20 FTC YKM
40
10 20 30 40 50 60 70 80 90 100 Coverage Defects
i knee i i i i
Linear Approximation after the knee
C0
95%
41
10/23/20 FTC YKM
41
42
10/23/20 FTC YKM
42
43
10/23/20 FTC YKM
43
Data Set: Pasquini
5 10 15 20 25 30 35 40 45 50 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 Branch Coverage Defects Model Data
Defects Expected Fitted Model
44
10/23/20 FTC YKM
44 Data Set: Pasquini
10 20 30 40 50 60 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 P-Use Coverage Defects Model Data
Defects Expected Fitted Model
Q: Will linear relation hold at very high coverage?
45
10/23/20 FTC YKM
45
46
10/23/20 FTC YKM
46
Data Set: Vouk 3
2 4 6 8 10 12 14 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 P-Use Coverage Defects Model Data
Defects Expected Fitted Model
47
10/23/20 FTC YKM
47
Data Set: Pasquini et al
10 20 30 40 50 60 2 62 123 184 246 307 368 427 488 549 611 672 733 792 853 914 976 1037 1098 1157 1218 Test Cases Defects Defects
Estimates are stable
48
10/23/20 FTC YKM
48
49
10/23/20 FTC YKM
49
Data Set: Pasquini et al
5 10 15 20 25 30 5 65 126 187 249 310 371 430 491 552 614 675 736 795 856 917 979 1040 1101 1160 1221 Test Cases Defects Estimate Defects Found
Estimate rises as new defects found Estimates very close to actual faults
50
51
10/23/20 FTC YKM
51
– 8 versons of European Space Agency program, 10K LOC, Single fault reinsertion
– "Code coverage, what does it mean in terms of quality?,“ – analysis from first principles
– A related model, unreachable code
verification defects: A multiple case study," ESEM 2009. – Avaya lab data – “The test effort increases exponentially with test coverage, but the reduction in field problems increases linearly with test coverage.”
52
verification defects: A multiple case study," Empirical Software Engineering and Measurement, 2009. ESEM 2009. 3rd International Symposium on , vol., no., pp.291,301, 15-16 Oct. 2009
in field problems increases linearly with test coverage.”
10/23/20 FTC YKM
52