遇见数据集

Comprehensibility of feature dependency in configurable system using #ifdef

收藏
Zenodo2025-09-24 更新2026-05-26 收录
官方服务:

资源简介:

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 take 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: We conducted two complementary empirical studies. In Study 1 we carried out an experiment in which 30 developers debugged programs with different types of feature dependency. Each program included a different type of feature dependency: global, intraprocedural or interprocedural. We used an eye-tracking device to record developers' gaze movements while they debugged programs. Study 1, however, has two main limitations. Firstly, its programs contain only one type of feature dependency each, while, in real systems, a same program file usually includes more than one type of feature dependency. Secondly, Study 1 does not compare programs with and without feature dependency. In Study 1 we did not compare pieces of source code with and without feature dependency. To minimize those limitations, in this paper we complement Study 1 by means of Study 2. Forty-six developers responded to a web-based study. 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: In Study 1, debugging programs with #ifdef and global or interprocedural dependency required more time and higher visual effort than intraprocedural dependency. Study 2, 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 or type of feature dependency.

条件编译(Conditional compilation)常被用于实现可配置系统的可变性,该技术借助#ifdef来界定特性代码。既往研究表明,#ifdef可能会阻碍代码的可理解性,但并未明确考量特性依赖(feature dependency)的影响。特性依赖指的是不同特性引用同一程序元素(如变量)的情形。当存在特性依赖时,代码可理解性可能会受到更显著的负面影响,因为开发者需要推理影响同一变量的各类不同场景。 研究目标:本研究旨在阐明特性依赖如何影响可配置系统源代码的可理解性。 研究方法:我们开展了两项互补的实证研究。在研究1中,我们实施了一项实验,招募30名开发者调试带有不同类型特性依赖的程序。每个程序仅包含一种特性依赖类型:全局(global)、过程内(intraprocedural)或过程间(interprocedural)。我们采用眼动追踪设备(eye-tracking device)记录开发者在调试过程中的眼球运动轨迹。然而,研究1存在两项主要局限:其一,每个程序仅涵盖一种特性依赖类型,而在真实可配置系统中,单个程序文件通常会包含多种类型的特性依赖;其二,研究1未对存在与不存在特性依赖的程序进行对比,即未比较包含与不包含特性依赖的源代码片段。为弥补上述局限,本研究通过研究2对研究1进行补充。共有46名开发者参与了基于网页的在线研究,他们需要完成分析包含#ifdef且存在/不存在特性依赖的程序的任务。每个包含特性依赖的程序均覆盖了真实可配置系统中常见的全部三种特性依赖类型。 研究结果:在研究1中,与过程内特性依赖相比,调试包含#ifdef且存在全局或过程间特性依赖的程序需要花费更多时间,且视觉认知负荷更高。在研究2中,分析包含#ifdef且存在特性依赖的程序所需时间显著长于仅包含#ifdef但无特性依赖的程序。 研究结论:本研究表明,#ifdef对可配置系统可理解性的影响程度,取决于特性依赖的存在与否,或是特性依赖的具体类型。

提供机构:
Zenodo
创建时间:
2023-05-29
二维码
社区交流群
二维码
科研交流群
商业服务