T e s t i n g T e c h n i q u e s A p p l i e d t
- V
i r t D e v e l
- p
m e n t
C l e b e r R
- s
a S r . S
- f
t w a r e E n g i n e e r O c t . 2 6
T h
, 2 1 7
T e s t i n g T e c h n i q u e s A p p l i e - - PowerPoint PPT Presentation
T e s t i n g T e c h n i q u e s A p p l i e d t o V i r t D e v e l o p m e n t C l e b e r R o s a S r . S o f t w a r e E n g i n e e r T h O c t . 2 6 , 2 0 1 7
C l e b e r R
a S r . S
t w a r e E n g i n e e r O c t . 2 6
T h
, 2 1 7
2
t w a r e T e s t i n g B a s i c s
q u i v a l e n c e P a r t i t i
i n g
n d a r y V a l u e A n a l y s i s
b i n a t
i a l T e s t i n g
p p l y i n g t h e T h e
y
3
a k e s a s i n p u t : l e n g t h s
a t r i a n g l e ’ s s i d e s
u t p u t s t h e t r i a n g l e c l a s s i fi c a t i
:
q u i l a t e r a l
s
c e l e s
c a l e n e
h a r d c a n i t b e t
r i t e a c
p r e h e n s i v e s e t
t e s t c a s e s ?
4
5
I N P U T E X P E C T E D O U T C O M E 1 , 1 , 1 E q u i l a t e r a l 2 , 2 , 3 I s
c e l e s 3 , 4 , 5 S c a l e n e
6
7
I N P U T E X P E C T E D O U T C O M E 1 , 1 , 1 E q u i l a t e r a l 2 , 2 , 3 I s
c e l e s 2 , 3 , 2 I s
c e l e s 3 , 4 , 5 S c a l e n e
8
9
I N P U T E X P E C T E D O U T C O M E , 1 , 1 E r r
, 1 , 1 E r r
1 , 1 , 2 E r r
( n
i s
c e l e s ) 1 , 2 , 3 E r r
( n
s c a l e n e )
1
1 1
1 2
e r m u t a t i
s
l e n g t h s
d e r
( A + B ) < = C ” . v s . “ ( C + B ) < = A ”
n p u t i s n
a n u m b e r
i v e m e a s i d e w i t h l e n g t h “ π ”
e
l e s s t h a n 3 i n p u t v a l u e s
K A “ w h a t d
m e a n b y t r i a n g l e s m u s t h a v e t h r e e s i d e s ? ”
1 3
v e n e x p e r i e n c e d d e v e l
e r s w i l l
l y t h i n k
a s u b s e t
t h
e t e s t c a s e s
f t h e s
t w a r e w e w r i t e i s n
t h i s s i m p l e , w e s h
l d d
e t t e r t h a n i n t h i s e x a m p l e
h
i n g g
i n p u t d a t a i s k e y
i n p u t c a n b e n
e t t e r t h a n
h e r i n p u t a l r e a d y b e i n g u s e d
a l l i n p u t a r e c r e a t e d e q u a l , s
e w i l l h a v e a b e t t e r s h
a t fi n d i n g i s s u e s
1 4
’ t l e t t h e n a m e s c a r e y
h i n k
g r
p s
i n p u t t h a t s h
l d g e n e r a t e s i m i l a r
t c
e
g
p i c k i s w
t h a t l e a s t
h e r t w
n d i v i d u a l i n p u t s
t u s u a l l y t e l l s u s a b
t w h a t w
l d h a p p e n ( e r r
s ? ) w h e n v a l u e s a b
e
b e y
d i t s e l f w
l d b e u s e d
1 5
// snippets from qemu/hw/acpi/cpu_hotplug.c /* The current AML generator can cover the APIC ID range [0..255], * inclusive, for VCPU hotplug. */ QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256); ... if (pcms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) { error_report("max_cpus is too large. APIC ID of last CPU is %u", pcms->apic_id_limit - 1); exit(1); } // snippets from qemu/hw/acpi/cpu_hotplug.c /* The current AML generator can cover the APIC ID range [0..255], * inclusive, for VCPU hotplug. */ QEMU_BUILD_BUG_ON(ACPI_CPU_HOTPLUG_ID_LIMIT > 256); ... if (pcms->apic_id_limit > ACPI_CPU_HOTPLUG_ID_LIMIT) { error_report("max_cpus is too large. APIC ID of last CPU is %u", pcms->apic_id_limit - 1); exit(1); }
1 6
N u m b e r
C P U s
I N V A L I D V A L I D I N V A L I D < = 1 . . 2 5 6 > = 2 5 7
C P U I D s
I N V A L I D V A L I D I N V A L I D < =
. . 2 5 5 > = 2 5 6
1 7
l s
s c a r y
h e n i n p u t c l a s s e s a r e
d e r e d , y
c a n e a s i l y s p
t h e m
h e s e v a l u e s a r e u s u a l l y v e r y g
b e t s f
t e s t s
1 8
N u m b e r
C P U s
I N V A L I D V A L I D I N V A L I D 1 2 5 6 2 5 7
C P U I D s
I N V A L I D V A L I D I N V A L I D
2 5 5 2 5 6
1 9
// snippets from tp-qemu/qemu/tests/cfg/cpu_add.cfg smp = 4 vcpu_maxcpus = 255 variants:
cpuid_hotplug_vcpu0 = 255 qmp_error_recheck = Unable to add CPU:.*, max allowed:.*
cpuid_hotplug_vcpu0 = -1 qmp_error_recheck = Invalid parameter type.*, expected:.*
cpuid_hotplug_vcpu0 = 1 qmp_error_recheck = Unable to add CPU:.*, it already exists // snippets from tp-qemu/qemu/tests/cfg/cpu_add.cfg smp = 4 vcpu_maxcpus = 255 variants:
cpuid_hotplug_vcpu0 = 255 qmp_error_recheck = Unable to add CPU:.*, max allowed:.*
cpuid_hotplug_vcpu0 = -1 qmp_error_recheck = Invalid parameter type.*, expected:.*
cpuid_hotplug_vcpu0 = 1 qmp_error_recheck = Unable to add CPU:.*, it already exists
2
R u n a s i m p l e s e q u e n t i a l I / O b e n c h m a r k
t h e s p e c i fi e d i m a g e . ”
A t
a l n u m b e r
c
n t I / O r e q u e s t s i s p e r f
m e d ”
2 1
A c t u a l
I N V A L I D V A L I D
1 I N T _ M A X I N T _ M A X + 1
P e r c e i v e d
I N V A L I D V A L I D
1 U I N T _ M A X U I N T _ M A X + 1
2 2
l s
n
n a s “ p a i r
i s e ”
a s i c p r i n c i p l e i s t h a t t h e g e n e r a t e d t e s t c a s e s w i l l h a v e a t l e a s t a p a i r
u n i q u e v a l u e s
v a l u e s c a n u s e E q u i v a l e n t C l a s s e s a n d B
n d a r y A n a l y s i s
b i n a t
i a l w i l l
t i ma l l y t e s t a l l u n i q u e v a l u e s
a s i n g l e t e s t p l a n e x e c u t i
2 3
Source: https://en.wikipedia.org/wiki/Cockpit#/media/File:Airbus_A380_cockpit.jpg
2 4
Source: https://csrc.nist.gov/Projects/Automated-Combinatorial-Testing-for-Software
2 5
[--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename [--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename
2 6
[--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename [--object objectdef] [--image-opts] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-S sparse_size] [-m num_coroutines] [-W] filename [filename2 [...]] output_filename
2 7
i c t , a s i n “ P a i r w i s e I n d e p e n d e n t C
b i n a t
i a l T e s t i n g ”
P I C T g e n e r a t e s t e s t c a s e s a n d t e s t c
fi g u r a t i
s ”
W i t h P I C T , y
c a n g e n e r a t e t e s t s t h a t a r e m
e e f f e c t i v e t h a n m a n u a l l y g e n e r a t e d t e s t s a n d i n a f r a c t i
t h e t i m e r e q u i r e d b y h a n d s
t e s t c a s e d e s i g n . ”
t t p s : / / g i t h u b . c
/ m i c r
t / p i c t
2 8
# Interesting values (at boundaries): -1, 0b, 9223372036854775808b (== 8EiB exbibytes), 8EiB+1b # Values that shows some issues: 0b # Safe values: 2b, 1M, 1G input_size: 2b, 1M, 1G # qemu-img convert parameters fmt: parallels, qcow, qcow2, qed, raw, vdi, vhdx, vmdk, vpc
src_cache: off, writeback, unsafe, writethrough cache: off, writeback, unsafe, writethrough # Interesting values (at boundaries): -1, 0b, 9223372036854775808b (== 8EiB exbibytes), 8EiB+1b # Values that shows some issues: 0b # Safe values: 2b, 1M, 1G input_size: 2b, 1M, 1G # qemu-img convert parameters fmt: parallels, qcow, qcow2, qed, raw, vdi, vhdx, vmdk, vpc
src_cache: off, writeback, unsafe, writethrough cache: off, writeback, unsafe, writethrough
2 9
e r s a t i l e t e s t r u n n e r
g t i m e h i s t
y ( h e r i t a g e ) i n v i r t u a l i z a t i
t e s t i n g
V M A u t
e s t , v i r t
e s t , A v
a d
T
u i l t
n s u p p
t f
“ t e s t v a r i a n t s ”
r
c
c e p t i n t e g r a t i
w i t h p i c t :
t t p s : / / g i t h u b . c
/ a v
a d
r a m e w
k / a v
a d
p u l l / 2 5
e i n f
t t p : / / a v
a d
r a m e w
k . g i t h u b . i
t t p s : / / g i t h u b . c
/ a v
a d
r a m e w
k / a v
a d
t t p s : / / a v
a d
r a m e w
k . r e a d t h e d
s . i
3
a k e C
b i n a t
i a l T e s t i n g ( a n d
h e r t
s a n d t e c h n i q u e s ) e a s i l y a v a i l a b l e t
i r t d e v e l
e r s
a c k a g i n g p i c t i n f
F e d
a a n d E P E L
p s t r e a m w
k i n Q E M U
b i n a t
i a l T e s t i n g I m p l e m e n t a t i
e r g e t h e p i c t i n t e g r a t i
i n t
v
a d
s n e x t r e l e a s e
n
h e r I m p l e m e n t a t i
t
e m a d e n a t i v e t
v
a d
u r r e n t l y i n d e v e l
m e n t
l a b
a t i
w i t h t h e C z e c h t e c h n i c a l u n i v e r s i t y i n P r a g u e
e t t h e b e s t s
u t i
w i n !
p e c i a l I n t e r e s t G r
p ?