A survey on how feature dependency affects program comprehensibility.

 

Author : Djan Santos, Cláudio Sant'Anna and Márcio Ribeiro

Abstract :


Background:Conditional compilation is often used to implement variability in configurable systems. This technique relies on \#ifdefs to delimit feature code. Previous studies have shown that \#ifdefs may hinder code comprehensibility. However, they did not explicitly took feature dependencies into account. Feature dependency occurs when different features refer to the same program element, such as a variable. Comprehensibility may be even more affected in the presence of feature dependency, as the developer must reason about different scenarios affecting the same variable. Aim: Our goal is to understand how feature dependency affects the comprehensibility of configurable system source code. Method: Forty-six developers responded an online survey. They executed tasks in which they had to analyze programs containing \#ifdef with and without feature dependency. Each program with feature dependency contained all the three types of features dependency as frequently occurs in real configurable systems. Results: Participants analyzing programs containing \#ifdef and feature dependency required more time than programs containing \#ifdef but without feature dependency. Conclusion: Our study showed that \#ifdefs affect comprehensibility of configurable systems in different degrees depending on the presence of feature dependency.
 
Procedure:

1 - The participants chooses the language she or he prefers.
2 - We explained the goal of the survey and our research goals. We also informed the participants about the time estimated to finish the survey, and then, asked the respondents for their informed consent.
3 - Each participant had to understand and realize the mental execution of two programs. Each participant also had to execute three tasks concerning each program. The participants were not allowed to proceed to the next task until they correctly answered the task in progress.
4 - After the question, there is a field and a button for the participant to enter his or her answer.
5 - After answering the three tasks of one of the programs in Domain 1, participants were redirected to one of the two programs in Domain 2.
6 - Finally, when a participant finished all the tasks, the survey asked her or him some questions to obtain qualitative feedback on how she or he performed the tasks. We have also asked participants about their profiles.

link to access the survey (new answers not be considered)
Source codes of our experiment:
Rows = Participants,
Column = Domains,
Four squares: programs with and without feature dependency.

SOURCE CODES OF PROGRAMS

Latin Square 2 x2:

Domain 1 - Product control program
Domain 2 - Vaccine control program
Developer 1 with feature dependency. without feature dependency.
Developer 2 without feature dependency. with feature dependency.

TASKS OF PROGRAMS

Tasks

with feature dependency.

without feature dependency.

Domain 1- Product control program Task 1 Task 1
Task 2 Task 2
Task 3 Task 3
Domain 2 - Vaccine control program Task 1 Task 1
Task 2 Task 2
Task 3 Task 3

TASKS AND SOURCE CODES OF PROGRAMS

Domain 1- Product control program Task + source code Task + source code
Domain 2 - Vaccine control program Task + source code Task + source code