Please use this identifier to cite or link to this item: http://hdl.handle.net/1843/ESBF-9ZPNCF
Type: Dissertação de Mestrado
Title: Understanding the shape of feature code
Authors: Rodrigo Barbosa de Queiroz
First Advisor: Marco Tulio de Oliveira Valente
First Referee: Andre Cavalcante Hora
Second Referee: Eduardo Magno Lages Figueiredo
Third Referee: Mariza Andrade da Silva Bigonha
Abstract: Feature annotations (por exemplo, diretivas do preprocessador C, na forma de #ifdefs) são usadas para controlar extensões de código relacionadas a uma feature. Por muito tempo, tais anotações têm sido consideradas indesejáveis. Seu uso excessivo pode aumentar o risco de ripple effects, desorganizar o código e dificultar sua compreensão e manutenção. Para prevenir esses problemas, desenvolvedores devem monitorar o uso de feature annotations, por exemplo, estabelecendo thresholds (valores de referência). No entando, pouco se sabe sobre como extrair thresholds na prática, ou quais valores são representativos para métricas relacionadas a features. Para contribuir comuma solução para esse problema, nós analizamos a distribuição estatística de métricas relacionadas a feature annotations, extraídas de umcorpus de 20 sistemas baseados no preprocessador C, amplamente conhecidos, com longo histórico de evolução e que abrangem diferentes domínios de função. O estudo considera 3 métricas: scattering degree (espalhamento de feature constants), tangling degree (entrelaçamento de feature expressions) e nesting depth (profundidade das anotações). Os resultados mostram que feature scattering possui uma distribuição com elevada assimetria. Em 14 sistemas (70 %), a distribuição de scattering degree segue uma distribuição power-law, tornando medidas de média e desvio padrão não confiáveis para estabelecer limites. Em relação a tangling e nesting, os valores tendem a seguir uma distribuição uniforme. Embora existam outliers, eles pouco impactam a média, sugerindo que medidas de tendência central podem gerar thresholds confiáveis. Com base nestes resultados, nós propomos thresholds gerados a partir de nosso benchmark como base para trabalhos futuros. Adicionalmente, nós realizamos uma revisão sistemática da literatura para identificar descobertas e suposições reportadas na literatura sobre o uso de ifdefs. Os resultados mostram que os estudos disponíveis não realizam análise estatística de métricas relacionadas a features, e nem propõem thresholds.
Abstract: Feature annotations (e.g., code fragments guarded by ifdef C-preprocessor directives) are widely used to control code extensions related to features. Feature annotations have long been said to be undesirable. When maintaining features guarded by annotations, there is a high risk of ripple effects. Also, excessive use of feature annotations may lead to code clutter, hinder program comprehension and harden maintenance. To prevent such problems, developers should monitor the use of feature annotations, for example, by setting acceptable thresholds. Interestingly, little is known about how to extract thresholds in practice, and which values are representative for feature-related metrics. To address this issue, in this master dissertation we analyze the statistical distribution of three feature-related metrics collected from a corpus of 20 well-known and long-lived C-preprocessor-based systems from different domains. We consider three metrics: scattering degree of feature constants, tangling degree of feature expressions, and nesting depth of preprocessor annotations. Our findings show that feature scattering is highly skewed; in 14 systems (70%), the scattering distributions match a power law, making averages and standard deviations unreliable limits. Regarding tangling and nesting, the values tend to follow a uniform distribution; although outliers exist, they have little impact on the mean, suggesting that central statistics measures are reliable thresholds for tangling and nesting. Following our findings, we then propose thresholds from our benchmark data, as a basis for further investigations. We also report in this work the result of a systematic literature review, conducted to identify empirical findings and assumptions on the usage of ifdefs as reported in the literature. The inspection of the assumptions and findings shows that studies do not investigate the statistical distributions that better describe feature-related metric values, and also do not propose thresholds for such metrics.
Subject: Computação
Software Reutilização
Engenharia de linha de produto de software
language: Português
Publisher: Universidade Federal de Minas Gerais
Publisher Initials: UFMG
Rights: Acesso Aberto
URI: http://hdl.handle.net/1843/ESBF-9ZPNCF
Issue Date: 31-Jul-2015
Appears in Collections:Dissertações de Mestrado

Files in This Item:
File Description SizeFormat 
rodrigobarbosaqueiroz.pdf2.37 MBAdobe PDFView/Open


Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.