A Qualitative Analysis of Variability Weaknesses in Configurable Systems with #ifdefs

Raphael Muniz, Rohit Gheyi, Larissa Braz, Wilkerson Andrade, Baldoino Fonseca, Márcio Ribeiro



Abstract


A number of critical configurable systems are implemented using #ifdefs, such as Linux. Some tools and strategies are proposed to avoid them. However, these systems still have weaknesses, leading to vulnerable code, and may impact millions of users. There is a lack of studies regarding the perception of developers of configurable systems with #ifdefs related to weaknesses, and the strategies and tools they use to remove them. Moreover, few works study the characteristics of weaknesses. To better understand the problem, we conduct two studies. In the first one, we qualitatively analyze 29 variability weaknesses of Apache HTTPD, Linux and OpenSSL reported on their bug trackers. In the second study, we conduct a survey with 110 developers of the previous configurable systems. Overall, our results show evidences that, although developers care about weaknesses, they may not detect some weaknesses reported in the bug trackers, and do not use proper tools to deal with them. They take on median 15 days and 4 discussion messages to solve them. Some weaknesses occur due to two or three feature interactions, and most of them can be detected by the all macros enabled sampling approach.



Study I: Variability Weaknesses

approach
Table 1: Configurable systems analyzed in our study. LOC(Avg) = Average of lines of code; Total = Total of macros; Avg = Average of macros; Median = Median of macros.

approach
Table 2: Analyzed Variability Weaknesses. CS = Configurable Systems; IM = Involved Macros; VL = Variability Level.

approach
Table 3: Median and total of time and discussion messagesto fix a variability weakness per analyzed configurable systems. NOM = Number Of Macros; Disc. Messages = Discussion Messages.


Study II: Survey

results
(a) Weakness in option “A”.

results
(b) Weakness in option “B”.

results
(c) Weakness in option “B”.


results
(d) Weakness in option “A”.

results
(e) Weakness in option “B”.


Figure 1: Results of the questions about code style preference regarding weaknesses: (a) Format String (CWE-134), (b) IntegerOverflow (CWE-190), (c) Null Pointer Dereference (CWE-476), (d) Buffer Overflow (CWE-120), (e) Integer Overflow (CWE-190).

results
(a) How much do you care about weaknesses when performing a commit?

results
(b) What is your background/knowledge about weaknesses in configurable systems with #ifdefs?

results
(c) For how long have you been working/have worked with preprocessor directives #ifdefs?


results
(d) Do you use any tool(s) to detect weaknesses in the code? Which one(s)?

results
(e) When you verify the presence ofbugs/weaknesses in the code, whichconfigurations do you usually check?


Figure 2: Results of our survey about developers’ background and tools to detect weaknesses.


Contact

This work has been developed at the Federal University of Campina Grande (UFCG), Brazil. If you have any question, please contact the researcher:  Larissa Braz

SPG - Software Productivity Group