SlideShare a Scribd company logo
Variability,
Bugs,
and Cognition
Jean Melo
Iago Abal
Claus Brabrand
Stefan Stanciulescu
Andrzej W ˛asowski
@AndrzejWasowski
pyrrhocoris apterus (firebug)
c Andrzej W ˛asowski, IT University of Copenhagen 1
Bug-finding is a time-consuming and tedious task
in the presence of variability.
c Andrzej W ˛asowski, IT University of Copenhagen 2
Bug-finding is a time-consuming and tedious task
in the presence of variability.
Managing variability can become complex.
c Andrzej W ˛asowski, IT University of Copenhagen 2
Bug-finding is a time-consuming and tedious task
in the presence of variability.
Managing variability can become complex.
Variability specifications and realizations tend to
erode [..and..] become overly complex.
c Andrzej W ˛asowski, IT University of Copenhagen 2
Bug-finding is a time-consuming and tedious task
in the presence of variability.
Managing variability can become complex.
Variability specifications and realizations tend to
erode [..and..] become overly complex.
Understandability and maintainability may be
negatively affected.
c Andrzej W ˛asowski, IT University of Copenhagen 2
Problem → Solution
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
Why variability bugs appear ?
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
Why variability bugs appear ?
Why #ifs research ? Aren’t #ifs just ifs?
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
Why variability bugs appear ?
Why #ifs research ? Aren’t #ifs just ifs?
Special bug finding tools for variability?
c Andrzej W ˛asowski, IT University of Copenhagen 3
Problem → Solution
Problem ← Understanding
Why variability bugs appear ?
Why #ifs research ? Aren’t #ifs just ifs?
Special bug finding tools for variability?
Does the sheer # of configurations contribute to errors ?
c Andrzej W ˛asowski, IT University of Copenhagen 3
AGENDA
An artifact study of historical bugs (sketchy)
c Andrzej W ˛asowski, IT University of Copenhagen 4
AGENDA
An artifact study of historical bugs (sketchy)
Controlled Experiment I
Does variability affects time and accuracy of bug finding?
c Andrzej W ˛asowski, IT University of Copenhagen 4
AGENDA
An artifact study of historical bugs (sketchy)
Controlled Experiment I
Does variability affects time and accuracy of bug finding?
Controlled Experiment II
How does variability affects time and accuracy of bug finding?
c Andrzej W ˛asowski, IT University of Copenhagen 4
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1
2 if (inode->i_sb->s_magic == ... ) . . .
3
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
2 if (inode->i_sb->s_magic == ... ) . . .
3 #endif
void pts_sb_from_inode(struct inode * inode)
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
2 if (inode->i_sb->s_magic == ... ) . . .
3 #endif
void pts_sb_from_inode(struct inode * inode)
4
5 pts_sb_from_inode (tty->driver_data);
6
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
2 if (inode->i_sb->s_magic == ... ) . . .
3 #endif
void pts_sb_from_inode(struct inode * inode)
4 #ifdef CONFIG_UNIX98_PTYS
5 pts_sb_from_inode (tty->driver_data);
6 #endif
void pty_close(struct tty_struct * tty)
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
2 if (inode->i_sb->s_magic == ... ) . . .
3 #endif
void pts_sb_from_inode(struct inode * inode)
4 #ifdef CONFIG_UNIX98_PTYS
5 pts_sb_from_inode (tty->driver_data);
6 #endif
void pty_close(struct tty_struct * tty)
7
8 pty_close (tty)
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
Let’s look at a bug
Dereferencing uninitialized pointer causes Kernel crash
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES
2 if (inode->i_sb->s_magic == ... ) . . .
3 #endif
void pts_sb_from_inode(struct inode * inode)
4 #ifdef CONFIG_UNIX98_PTYS
5 pts_sb_from_inode (tty->driver_data);
6 #endif
void pty_close(struct tty_struct * tty)
7 tty = kzalloc(sizeof (*tty), GFP_KERNEL);
8 pty_close (tty)
· · ·
Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
A Study of Known Variability Bugs
(Sizes below as of December 2015)
System Domain LOC #Features #Commits
Marlin 3D-printer firmware 0.04M 821 2,783
BusyBox UNIX utilities 0.20M 551 13,878
Apache Web Server 0.20M 681 27,677
Linux kernel Operating system 12.70M 14,295 448,314
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
A Study of Known Variability Bugs
(Sizes below as of December 2015)
System Domain LOC #Features #Commits
Marlin 3D-printer firmware 0.04M 821 2,783
BusyBox UNIX utilities 0.20M 551 13,878
Apache Web Server 0.20M 681 27,677
Linux kernel Operating system 12.70M 14,295 448,314 interview
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
A Study of Known Variability Bugs
(Sizes below as of December 2015)
System Domain LOC #Features #Commits
Marlin 3D-printer firmware 0.04M 821 2,783
BusyBox UNIX utilities 0.20M 551 13,878
Apache Web Server 0.20M 681 27,677
Linux kernel Operating system 12.70M 14,295 448,314 interview
The original research questions:
RQ1: Are variability bugs limited to specific type of bugs, features, or locations?
RQ2: In what ways does variability affect bugs?
But today, I will fish answers to other RQs ...
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
Let’s have a look at a bug
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=7acf6cd80b201f77371a5374a786144153629be8
c Andrzej W ˛asowski, IT University of Copenhagen 7
Let’s have a look at a bug
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=7acf6cd80b201f77371a5374a786144153629be8
c Andrzej W ˛asowski, IT University of Copenhagen 7
See http://vbdb.itu.dk/, and add your own bugs
c Andrzej W ˛asowski, IT University of Copenhagen 8
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
The interviewed developer: cross-cutting features are a frequent source of
problems; Developers are often experts only in a particular subsystem.
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
The interviewed developer: cross-cutting features are a frequent source of
problems; Developers are often experts only in a particular subsystem.
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
The interviewed developer: cross-cutting features are a frequent source of
problems; Developers are often experts only in a particular subsystem.
“Code cluttered with ifdefs is difficult to read and maintain. Don’t do it.
Instead put your ifdefs in a header, and conditionally define ‘static inline’
functions or macros, which are used in the code.” [submitting patches]
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
What do we find in these variability bugs ?
A quick extract
Bugs “in” the correct code (in some correct configuration)
The programmer got his configuration right
Bugs appear in unanticipated configurations
The programmer did not think about other configurations
Essentially all 98 bugs appear to be such ...
Bugs may involve non-locally defined features (defined in other subsystems)
30 out of 43 Linux bugs in VBDB have this feature
The interviewed developer: cross-cutting features are a frequent source of
problems; Developers are often experts only in a particular subsystem.
“Code cluttered with ifdefs is difficult to read and maintain. Don’t do it.
Instead put your ifdefs in a header, and conditionally define ‘static inline’
functions or macros, which are used in the code.” [submitting patches]
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
In Linux commit 60e233a5660 function
add_uevent_var with HOTPLUG disabled overflows a
buffer
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
In Linux commit 60e233a5660 function
add_uevent_var with HOTPLUG disabled overflows a
buffer
Originally we spinned this for testing and sampling
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
In Linux commit 60e233a5660 function
add_uevent_var with HOTPLUG disabled overflows a
buffer
Originally we spinned this for testing and sampling
Second thought: isn’t this a symptom of forgetting
to “mentally” enable/disable a feature?
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
An interesting pattern with negative conditions
(a presence conditions for a bug to trigger)
49 some-enabled
21 a
21 a ∧ b
6 a ∧ b ∧ c
1 a ∧ b ∧ c ∧ d ∧ e
45 some-enabled-one-disabled
20 ¬a
20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b
4 a ∧ b ∧ ¬c
1 a ∧ b ∧ c ∧ d ∧ ¬e
4 other configurations
1 ¬a ∧ ¬b
1 a ∧ ¬b ∧ ¬c
2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e
structure of the sufficient presence condition for the bug
pattern frequency in our bug collection
In Linux commit 60e233a5660 function
add_uevent_var with HOTPLUG disabled overflows a
buffer
Originally we spinned this for testing and sampling
Second thought: isn’t this a symptom of forgetting
to “mentally” enable/disable a feature?
The kernel developer: you hardly can think of more
than 5 involved configs (features) when coding,
debugging or profiling.
Iago Abal. Claus Brabrand. Andrzej W ˛asowski.
42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
What are
the cognitive
challenges?
c Andrzej W ˛asowski, IT University of Copenhagen 11
This program contains a
simple coding bug
How would you debug it?
Where is the bug?
What configurations
contain the bug?
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
c Andrzej W ˛asowski, IT University of Copenhagen 12
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programs: 3 programs from 3 systems
Linux, open source, 12MLOC/13K features
Busy Box, open source, 204KLOC/600 features
Best Lap, Commercial game, 15 KLOC
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programs: 3 programs from 3 systems
Linux, open source, 12MLOC/13K features
Busy Box, open source, 204KLOC/600 features
Best Lap, Commercial game, 15 KLOC
Subjects: N=69 [31×Msc+32×Phd+6×post-doc]
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programs: 3 programs from 3 systems
Linux, open source, 12MLOC/13K features
Busy Box, open source, 204KLOC/600 features
Best Lap, Commercial game, 15 KLOC
Subjects: N=69 [31×Msc+32×Phd+6×post-doc]
Task: find the bug
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programs: 3 programs from 3 systems
Linux, open source, 12MLOC/13K features
Busy Box, open source, 204KLOC/600 features
Best Lap, Commercial game, 15 KLOC
Subjects: N=69 [31×Msc+32×Phd+6×post-doc]
Task: find the bug
Metrics: time and accuracy
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Controlled Experiment I
How does the degree of variability affect ...
... the time of bug finding?
... the accuracy of bug finding?
RQs public class Netpoll {
boolean UNK_FALSE = true;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if (UNK_FALSE)
type = false;
if (type){
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NO (|F| = 0)
P1
public class Netpoll {
boolean UNK_FALSE = false;
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
if(UNK_FALSE)
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
LO (|F| = 1)
public class Netpoll {
boolean IPV4_SUPPORT = true;
public String netpollSetup() {
String errMessage;
boolean type = true;
type = false;
if (type) {
errMessage = "Destination address required";
//...
return errMessage;
}
if (IPV4_SUPPORT)
return errMessage;
return "done";
}
public static void main(String[] args) {
Netpoll netpoll = new Netpoll();
netpoll.netpollSetup();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HI (|F| = 3)
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = false;
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P2
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
boolean LARGE_FORMAT = false;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
private void sendHeaders(int responseNum) {
int buf = 0;
if (LARGE_FORMAT) {
buf = totalLength - responseNum;
subject = "Response";
}
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Random;
public class Http {
String subject = null;
int totalLength = 600;
final int HTTP_UNAUTHORIZED = 401;
final int HTTP_NOT_IMPLEMENTED = 501;
String REQUEST_GET = "GET";
public void sendHeaders(int responseNum) {
int buf = 0;
buf = totalLength - responseNum;
subject = "response header";
if (subject.isEmpty())
subject = "Void response";
System.out.println("Done");
}
private void handleIncoming(String requestType) {
boolean http_unauthorized = new
Random().nextBoolean();
if (http_unauthorized)
sendHeaders(HTTP_UNAUTHORIZED);
if (!requestType.equals(REQUEST_GET))
sendHeaders(HTTP_NOT_IMPLEMENTED);
}
public static void main(String[] args) {
Http http = new Http();
http.handleIncoming("POST");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore != 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
P3
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class GameScreen {
private int totalScore = 0;
private int penalty;
private final int TIME_BONUS = 2;
private final int PERFECT_CURVE = 4;
private final int PERFECT_STRAIGHT = 1;
private void setScore(int score) {
if(score >= 0) {
totalScore = score;
} else {
totalScore = 0;
}
}
private void setPenalty(int penalty) {
this.penalty = penalty;
}
private void gc_computeLevelScore() {
assert totalScore == 0;
totalScore = PERFECT_CURVE + PERFECT_STRAIGHT;
totalScore += TIME_BONUS;
totalScore -= penalty;
assert totalScore < 0;
setScore(totalScore);
assert totalScore < 0;
}
public static void main(String[] args) {
GameScreen game = new GameScreen();
game.setPenalty(10);
game.gc_computeLevelScore();
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programs: 3 programs from 3 systems
Linux, open source, 12MLOC/13K features
Busy Box, open source, 204KLOC/600 features
Best Lap, Commercial game, 15 KLOC
Subjects: N=69 [31×Msc+32×Phd+6×post-doc]
Task: find the bug
Metrics: time and accuracy
Small, fit on screen—no scrolling (25-35 LOC)
Cross-over Design
Jean Melo. Claus Brabrand. Andrzej W ˛asowski.
How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition
Variability, Bugs, and Cognition

More Related Content

What's hot

An Empirical Study on Bounded Model Checking
An Empirical Study on Bounded Model CheckingAn Empirical Study on Bounded Model Checking
An Empirical Study on Bounded Model Checking
Stefano Dalla Palma
 
La préservation des logiciels: défis et opportunités pour la reproductibilité...
La préservation des logiciels: défis et opportunités pour la reproductibilité...La préservation des logiciels: défis et opportunités pour la reproductibilité...
La préservation des logiciels: défis et opportunités pour la reproductibilité...
Roberto Di Cosmo
 
SAST and Application Security: how to fight vulnerabilities in the code
SAST and Application Security: how to fight vulnerabilities in the codeSAST and Application Security: how to fight vulnerabilities in the code
SAST and Application Security: how to fight vulnerabilities in the code
Andrey Karpov
 
Reproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and AndurilReproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and Anduril
Christian Frech
 
2013 oct 2 rna sequencing
2013 oct 2 rna sequencing2013 oct 2 rna sequencing
2013 oct 2 rna sequencing
Anne Deslattes Mays
 
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaIDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
CODE BLUE
 
LUGM-Update of the Illumina Analysis Pipeline
LUGM-Update of the Illumina Analysis PipelineLUGM-Update of the Illumina Analysis Pipeline
LUGM-Update of the Illumina Analysis Pipeline
Hai-Wei Yen
 

What's hot (7)

An Empirical Study on Bounded Model Checking
An Empirical Study on Bounded Model CheckingAn Empirical Study on Bounded Model Checking
An Empirical Study on Bounded Model Checking
 
La préservation des logiciels: défis et opportunités pour la reproductibilité...
La préservation des logiciels: défis et opportunités pour la reproductibilité...La préservation des logiciels: défis et opportunités pour la reproductibilité...
La préservation des logiciels: défis et opportunités pour la reproductibilité...
 
SAST and Application Security: how to fight vulnerabilities in the code
SAST and Application Security: how to fight vulnerabilities in the codeSAST and Application Security: how to fight vulnerabilities in the code
SAST and Application Security: how to fight vulnerabilities in the code
 
Reproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and AndurilReproducible bioinformatics pipelines with Docker and Anduril
Reproducible bioinformatics pipelines with Docker and Anduril
 
2013 oct 2 rna sequencing
2013 oct 2 rna sequencing2013 oct 2 rna sequencing
2013 oct 2 rna sequencing
 
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaIDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
 
LUGM-Update of the Illumina Analysis Pipeline
LUGM-Update of the Illumina Analysis PipelineLUGM-Update of the Illumina Analysis Pipeline
LUGM-Update of the Illumina Analysis Pipeline
 

Similar to Variability, Bugs, and Cognition

Finding Resource Manipulation Bugs in Linux Code
Finding Resource Manipulation Bugs in Linux CodeFinding Resource Manipulation Bugs in Linux Code
Finding Resource Manipulation Bugs in Linux Code
Andrzej Wasowski
 
What is Software Engineering Research Good For?
What is Software Engineering Research Good For?What is Software Engineering Research Good For?
What is Software Engineering Research Good For?
Andrzej Wasowski
 
Dependency Bugs The Dark Side Of Variability, Reuse, and Modularity
Dependency Bugs The Dark Side Of Variability, Reuse, and ModularityDependency Bugs The Dark Side Of Variability, Reuse, and Modularity
Dependency Bugs The Dark Side Of Variability, Reuse, and Modularity
Andrzej Wasowski
 
An Empirical Study on Inconsistent Changes to Code Clones at Release Level
An Empirical Study on Inconsistent Changes to Code Clones at Release LevelAn Empirical Study on Inconsistent Changes to Code Clones at Release Level
An Empirical Study on Inconsistent Changes to Code Clones at Release Level
Nicolas Bettenburg
 
My life as a cyborg
My life as a cyborg My life as a cyborg
My life as a cyborg
Alexander Serebrenik
 
Got Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringGot Myth? Myths in Software Engineering
Got Myth? Myths in Software Engineering
Thomas Zimmermann
 
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-StudioArcheology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Andrey Karpov
 
Tools and Methods for Continuously Expanding Software Applications
Tools and Methods for Continuously Expanding Software ApplicationsTools and Methods for Continuously Expanding Software Applications
Tools and Methods for Continuously Expanding Software Applications
InfinIT - Innovationsnetværket for it
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method Names
Dongsun Kim
 
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
Iosif Itkin
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysis
Tamas K Lengyel
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
MichaelM85042
 
The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...
Michael Vorburger
 
Role of locking- cds
Role of locking- cdsRole of locking- cds
Role of locking- cds
Aravindharamanan S
 
Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...
Research Data Alliance
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
lior mazor
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
Yury Chemerkin
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...
Roberto Di Cosmo
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - Irill
Scilab
 
Containers in Science: neuroimaging use cases
Containers in Science: neuroimaging use casesContainers in Science: neuroimaging use cases
Containers in Science: neuroimaging use cases
Krzysztof Gorgolewski
 

Similar to Variability, Bugs, and Cognition (20)

Finding Resource Manipulation Bugs in Linux Code
Finding Resource Manipulation Bugs in Linux CodeFinding Resource Manipulation Bugs in Linux Code
Finding Resource Manipulation Bugs in Linux Code
 
What is Software Engineering Research Good For?
What is Software Engineering Research Good For?What is Software Engineering Research Good For?
What is Software Engineering Research Good For?
 
Dependency Bugs The Dark Side Of Variability, Reuse, and Modularity
Dependency Bugs The Dark Side Of Variability, Reuse, and ModularityDependency Bugs The Dark Side Of Variability, Reuse, and Modularity
Dependency Bugs The Dark Side Of Variability, Reuse, and Modularity
 
An Empirical Study on Inconsistent Changes to Code Clones at Release Level
An Empirical Study on Inconsistent Changes to Code Clones at Release LevelAn Empirical Study on Inconsistent Changes to Code Clones at Release Level
An Empirical Study on Inconsistent Changes to Code Clones at Release Level
 
My life as a cyborg
My life as a cyborg My life as a cyborg
My life as a cyborg
 
Got Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringGot Myth? Myths in Software Engineering
Got Myth? Myths in Software Engineering
 
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-StudioArcheology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
Archeology for Entertainment, or Checking Microsoft Word 1.1a with PVS-Studio
 
Tools and Methods for Continuously Expanding Software Applications
Tools and Methods for Continuously Expanding Software ApplicationsTools and Methods for Continuously Expanding Software Applications
Tools and Methods for Continuously Expanding Software Applications
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method Names
 
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysis
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
 
The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...The End of the world as we know it - AKA your last NullPointerException $1B b...
The End of the world as we know it - AKA your last NullPointerException $1B b...
 
Role of locking- cds
Role of locking- cdsRole of locking- cds
Role of locking- cds
 
Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...Reproducibility challenges in computational settings: what are they, why shou...
Reproducibility challenges in computational settings: what are they, why shou...
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
 
Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...Software Preservation: challenges and opportunities for reproductibility (Sci...
Software Preservation: challenges and opportunities for reproductibility (Sci...
 
ScilabTEC 2015 - Irill
ScilabTEC 2015 - IrillScilabTEC 2015 - Irill
ScilabTEC 2015 - Irill
 
Containers in Science: neuroimaging use cases
Containers in Science: neuroimaging use casesContainers in Science: neuroimaging use cases
Containers in Science: neuroimaging use cases
 

Recently uploaded

The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
kejapriya1
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
HongcNguyn6
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
University of Hertfordshire
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
Leonel Morgado
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
MAGOTI ERNEST
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
TinyAnderson
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
European Sustainable Phosphorus Platform
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Texas Alliance of Groundwater Districts
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Leonel Morgado
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 

Recently uploaded (20)

The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
 

Variability, Bugs, and Cognition

  • 1. Variability, Bugs, and Cognition Jean Melo Iago Abal Claus Brabrand Stefan Stanciulescu Andrzej W ˛asowski @AndrzejWasowski pyrrhocoris apterus (firebug) c Andrzej W ˛asowski, IT University of Copenhagen 1
  • 2. Bug-finding is a time-consuming and tedious task in the presence of variability. c Andrzej W ˛asowski, IT University of Copenhagen 2
  • 3. Bug-finding is a time-consuming and tedious task in the presence of variability. Managing variability can become complex. c Andrzej W ˛asowski, IT University of Copenhagen 2
  • 4. Bug-finding is a time-consuming and tedious task in the presence of variability. Managing variability can become complex. Variability specifications and realizations tend to erode [..and..] become overly complex. c Andrzej W ˛asowski, IT University of Copenhagen 2
  • 5. Bug-finding is a time-consuming and tedious task in the presence of variability. Managing variability can become complex. Variability specifications and realizations tend to erode [..and..] become overly complex. Understandability and maintainability may be negatively affected. c Andrzej W ˛asowski, IT University of Copenhagen 2
  • 6. Problem → Solution c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 7. Problem → Solution Problem ← Understanding c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 8. Problem → Solution Problem ← Understanding c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 9. Problem → Solution Problem ← Understanding Why variability bugs appear ? c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 10. Problem → Solution Problem ← Understanding Why variability bugs appear ? Why #ifs research ? Aren’t #ifs just ifs? c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 11. Problem → Solution Problem ← Understanding Why variability bugs appear ? Why #ifs research ? Aren’t #ifs just ifs? Special bug finding tools for variability? c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 12. Problem → Solution Problem ← Understanding Why variability bugs appear ? Why #ifs research ? Aren’t #ifs just ifs? Special bug finding tools for variability? Does the sheer # of configurations contribute to errors ? c Andrzej W ˛asowski, IT University of Copenhagen 3
  • 13. AGENDA An artifact study of historical bugs (sketchy) c Andrzej W ˛asowski, IT University of Copenhagen 4
  • 14. AGENDA An artifact study of historical bugs (sketchy) Controlled Experiment I Does variability affects time and accuracy of bug finding? c Andrzej W ˛asowski, IT University of Copenhagen 4
  • 15. AGENDA An artifact study of historical bugs (sketchy) Controlled Experiment I Does variability affects time and accuracy of bug finding? Controlled Experiment II How does variability affects time and accuracy of bug finding? c Andrzej W ˛asowski, IT University of Copenhagen 4
  • 16. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 2 if (inode->i_sb->s_magic == ... ) . . . 3 Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 17. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 2 if (inode->i_sb->s_magic == ... ) . . . 3 #endif void pts_sb_from_inode(struct inode * inode) Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 18. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 2 if (inode->i_sb->s_magic == ... ) . . . 3 #endif void pts_sb_from_inode(struct inode * inode) 4 5 pts_sb_from_inode (tty->driver_data); 6 Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 19. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 2 if (inode->i_sb->s_magic == ... ) . . . 3 #endif void pts_sb_from_inode(struct inode * inode) 4 #ifdef CONFIG_UNIX98_PTYS 5 pts_sb_from_inode (tty->driver_data); 6 #endif void pty_close(struct tty_struct * tty) Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 20. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 2 if (inode->i_sb->s_magic == ... ) . . . 3 #endif void pts_sb_from_inode(struct inode * inode) 4 #ifdef CONFIG_UNIX98_PTYS 5 pts_sb_from_inode (tty->driver_data); 6 #endif void pty_close(struct tty_struct * tty) 7 8 pty_close (tty) Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 21. Let’s look at a bug Dereferencing uninitialized pointer causes Kernel crash 1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES 2 if (inode->i_sb->s_magic == ... ) . . . 3 #endif void pts_sb_from_inode(struct inode * inode) 4 #ifdef CONFIG_UNIX98_PTYS 5 pts_sb_from_inode (tty->driver_data); 6 #endif void pty_close(struct tty_struct * tty) 7 tty = kzalloc(sizeof (*tty), GFP_KERNEL); 8 pty_close (tty) · · · Bug 7acf6cd, see http://vbdb.itu.dk/#bug/linux/7acf6cd Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 5
  • 22. A Study of Known Variability Bugs (Sizes below as of December 2015) System Domain LOC #Features #Commits Marlin 3D-printer firmware 0.04M 821 2,783 BusyBox UNIX utilities 0.20M 551 13,878 Apache Web Server 0.20M 681 27,677 Linux kernel Operating system 12.70M 14,295 448,314 Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
  • 23. A Study of Known Variability Bugs (Sizes below as of December 2015) System Domain LOC #Features #Commits Marlin 3D-printer firmware 0.04M 821 2,783 BusyBox UNIX utilities 0.20M 551 13,878 Apache Web Server 0.20M 681 27,677 Linux kernel Operating system 12.70M 14,295 448,314 interview Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
  • 24. A Study of Known Variability Bugs (Sizes below as of December 2015) System Domain LOC #Features #Commits Marlin 3D-printer firmware 0.04M 821 2,783 BusyBox UNIX utilities 0.20M 551 13,878 Apache Web Server 0.20M 681 27,677 Linux kernel Operating system 12.70M 14,295 448,314 interview The original research questions: RQ1: Are variability bugs limited to specific type of bugs, features, or locations? RQ2: In what ways does variability affect bugs? But today, I will fish answers to other RQs ... Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 6
  • 25. Let’s have a look at a bug http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=7acf6cd80b201f77371a5374a786144153629be8 c Andrzej W ˛asowski, IT University of Copenhagen 7
  • 26. Let’s have a look at a bug http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=7acf6cd80b201f77371a5374a786144153629be8 c Andrzej W ˛asowski, IT University of Copenhagen 7
  • 27. See http://vbdb.itu.dk/, and add your own bugs c Andrzej W ˛asowski, IT University of Copenhagen 8
  • 28. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 29. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 30. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 31. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 32. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 33. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 34. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature The interviewed developer: cross-cutting features are a frequent source of problems; Developers are often experts only in a particular subsystem. Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 35. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature The interviewed developer: cross-cutting features are a frequent source of problems; Developers are often experts only in a particular subsystem. Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 36. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature The interviewed developer: cross-cutting features are a frequent source of problems; Developers are often experts only in a particular subsystem. “Code cluttered with ifdefs is difficult to read and maintain. Don’t do it. Instead put your ifdefs in a header, and conditionally define ‘static inline’ functions or macros, which are used in the code.” [submitting patches] Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 37. What do we find in these variability bugs ? A quick extract Bugs “in” the correct code (in some correct configuration) The programmer got his configuration right Bugs appear in unanticipated configurations The programmer did not think about other configurations Essentially all 98 bugs appear to be such ... Bugs may involve non-locally defined features (defined in other subsystems) 30 out of 43 Linux bugs in VBDB have this feature The interviewed developer: cross-cutting features are a frequent source of problems; Developers are often experts only in a particular subsystem. “Code cluttered with ifdefs is difficult to read and maintain. Don’t do it. Instead put your ifdefs in a header, and conditionally define ‘static inline’ functions or macros, which are used in the code.” [submitting patches] Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 9
  • 38. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 39. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 40. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 41. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection In Linux commit 60e233a5660 function add_uevent_var with HOTPLUG disabled overflows a buffer Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 42. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection In Linux commit 60e233a5660 function add_uevent_var with HOTPLUG disabled overflows a buffer Originally we spinned this for testing and sampling Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 43. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection In Linux commit 60e233a5660 function add_uevent_var with HOTPLUG disabled overflows a buffer Originally we spinned this for testing and sampling Second thought: isn’t this a symptom of forgetting to “mentally” enable/disable a feature? Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 44. An interesting pattern with negative conditions (a presence conditions for a bug to trigger) 49 some-enabled 21 a 21 a ∧ b 6 a ∧ b ∧ c 1 a ∧ b ∧ c ∧ d ∧ e 45 some-enabled-one-disabled 20 ¬a 20 a ∧ ¬b incl.: (a ∨ a ) ∧ ¬b 4 a ∧ b ∧ ¬c 1 a ∧ b ∧ c ∧ d ∧ ¬e 4 other configurations 1 ¬a ∧ ¬b 1 a ∧ ¬b ∧ ¬c 2 a ∧ ¬b ∧ ¬c ∧ ¬d ∧ ¬e structure of the sufficient presence condition for the bug pattern frequency in our bug collection In Linux commit 60e233a5660 function add_uevent_var with HOTPLUG disabled overflows a buffer Originally we spinned this for testing and sampling Second thought: isn’t this a symptom of forgetting to “mentally” enable/disable a feature? The kernel developer: you hardly can think of more than 5 involved configs (features) when coding, debugging or profiling. Iago Abal. Claus Brabrand. Andrzej W ˛asowski. 42 variability bugs in the Linux kernel: A qualitative analysis. ASE 2014 + a journal submission c Andrzej W ˛asowski, IT University of Copenhagen 10
  • 45. What are the cognitive challenges? c Andrzej W ˛asowski, IT University of Copenhagen 11
  • 46. This program contains a simple coding bug How would you debug it? Where is the bug? What configurations contain the bug? import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 c Andrzej W ˛asowski, IT University of Copenhagen 12
  • 47. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 48. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 49. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 50. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 51. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 52. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 53. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 54. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 55. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 56. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 57. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 58. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Programs: 3 programs from 3 systems Linux, open source, 12MLOC/13K features Busy Box, open source, 204KLOC/600 features Best Lap, Commercial game, 15 KLOC Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 59. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Programs: 3 programs from 3 systems Linux, open source, 12MLOC/13K features Busy Box, open source, 204KLOC/600 features Best Lap, Commercial game, 15 KLOC Subjects: N=69 [31×Msc+32×Phd+6×post-doc] Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 60. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Programs: 3 programs from 3 systems Linux, open source, 12MLOC/13K features Busy Box, open source, 204KLOC/600 features Best Lap, Commercial game, 15 KLOC Subjects: N=69 [31×Msc+32×Phd+6×post-doc] Task: find the bug Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 61. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Programs: 3 programs from 3 systems Linux, open source, 12MLOC/13K features Busy Box, open source, 204KLOC/600 features Best Lap, Commercial game, 15 KLOC Subjects: N=69 [31×Msc+32×Phd+6×post-doc] Task: find the bug Metrics: time and accuracy Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13
  • 62. Controlled Experiment I How does the degree of variability affect ... ... the time of bug finding? ... the accuracy of bug finding? RQs public class Netpoll { boolean UNK_FALSE = true; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if (UNK_FALSE) type = false; if (type){ errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 NO (|F| = 0) P1 public class Netpoll { boolean UNK_FALSE = false; boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; if(UNK_FALSE) type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 LO (|F| = 1) public class Netpoll { boolean IPV4_SUPPORT = true; public String netpollSetup() { String errMessage; boolean type = true; type = false; if (type) { errMessage = "Destination address required"; //... return errMessage; } if (IPV4_SUPPORT) return errMessage; return "done"; } public static void main(String[] args) { Netpoll netpoll = new Netpoll(); netpoll.netpollSetup(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 HI (|F| = 3) public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = false; if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 P2 import java.util.Random; public class Http { String subject = null; int totalLength = 600; boolean LARGE_FORMAT = false; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; private void sendHeaders(int responseNum) { int buf = 0; if (LARGE_FORMAT) { buf = totalLength - responseNum; subject = "Response"; } if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import java.util.Random; public class Http { String subject = null; int totalLength = 600; final int HTTP_UNAUTHORIZED = 401; final int HTTP_NOT_IMPLEMENTED = 501; String REQUEST_GET = "GET"; public void sendHeaders(int responseNum) { int buf = 0; buf = totalLength - responseNum; subject = "response header"; if (subject.isEmpty()) subject = "Void response"; System.out.println("Done"); } private void handleIncoming(String requestType) { boolean http_unauthorized = new Random().nextBoolean(); if (http_unauthorized) sendHeaders(HTTP_UNAUTHORIZED); if (!requestType.equals(REQUEST_GET)) sendHeaders(HTTP_NOT_IMPLEMENTED); } public static void main(String[] args) { Http http = new Http(); http.handleIncoming("POST"); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore != 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 P3 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 public class GameScreen { private int totalScore = 0; private int penalty; private final int TIME_BONUS = 2; private final int PERFECT_CURVE = 4; private final int PERFECT_STRAIGHT = 1; private void setScore(int score) { if(score >= 0) { totalScore = score; } else { totalScore = 0; } } private void setPenalty(int penalty) { this.penalty = penalty; } private void gc_computeLevelScore() { assert totalScore == 0; totalScore = PERFECT_CURVE + PERFECT_STRAIGHT; totalScore += TIME_BONUS; totalScore -= penalty; assert totalScore < 0; setScore(totalScore); assert totalScore < 0; } public static void main(String[] args) { GameScreen game = new GameScreen(); game.setPenalty(10); game.gc_computeLevelScore(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Programs: 3 programs from 3 systems Linux, open source, 12MLOC/13K features Busy Box, open source, 204KLOC/600 features Best Lap, Commercial game, 15 KLOC Subjects: N=69 [31×Msc+32×Phd+6×post-doc] Task: find the bug Metrics: time and accuracy Small, fit on screen—no scrolling (25-35 LOC) Cross-over Design Jean Melo. Claus Brabrand. Andrzej W ˛asowski. How does the degree of variability affect bug finding? ICSE 2016 c Andrzej W ˛asowski, IT University of Copenhagen 13