19
OPUS Group LES | DI |PUC-Rio - Brazil Understanding the Longevity of Code Smells Preliminary Results of an Exploratory Survey Roberta Arcoverde – [email protected] Alessandro Garcia – [email protected] rio.br Eduardo Figueiredo – [email protected] ICSE.11

Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

Embed Size (px)

DESCRIPTION

my presentation at the 4th Workshop on Refactoring Tools, May 2011

Citation preview

Page 1: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

OPUS GroupLES | DI |PUC-Rio - Brazil

Understanding the Longevity of Code SmellsPreliminary Results of an Exploratory Survey

Roberta Arcoverde – [email protected] Garcia – [email protected]

Eduardo Figueiredo – [email protected]

ICSE.11

Page 2: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

why?

April 8, 2023 Roberta @ OPUS Group 2

code smells entail evidence of bad quality code harder to read and maintain

some [patterns of] smells seem to be “ignored”

Page 3: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

why?

April 8, 2023 Roberta @ OPUS Group 3

code smells entail evidence of bad quality code harder to read and maintain

some [patterns of] smells seem to be “ignored”

? refactoring habits

smell longevity

[1] How we refactor and how we know it. Murphy-Hill et al. [ICSE 2010]

Page 4: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

objective

April 8, 2023 Roberta @ OPUS Group 4

perform a first exploratory study to identify

which factors influence longevity of code smells, based on refactoring habits

Page 5: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

refactoring habits

how often code is refactored? which refactorings are prioritized? is refactoring applied as an isolate activity? which refactorings are considered to be harder to

apply? how often and when refactoring tools are used?

April 8, 2023 Roberta @ OPUS Group 5

? refactoring habits

smell longevity

Page 6: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

which factors influence refactoring habits

nature of software being developed reusable assets (frameworks, libraries, software

product lines) standalone applications

use of TDD developer’s experience

April 8, 2023 Roberta @ OPUS Group 6

? refactoring habits

smell longevity

Page 7: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

survey setting - questionnaire

April 8, 2023 Roberta @ OPUS Group 7

1 - identification of developer profile• experience• kind of projects they work with• use of TDD

2 - refactoring habits• use of refactoring tools• commonly found smells• floss refactoring

3 - classifying refactorings• difficulty• frequency• importance (priority)

Page 8: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

participants

April 8, 2023 Roberta @ OPUS Group 8

agile development teams framework developers = 33 answers

Page 9: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

participants distribution

April 8, 2023 Roberta @ OPUS Group 9

Page 10: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

participants distribution - TDD

April 8, 2023 Roberta @ OPUS Group 10

Page 11: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

most recurring smells

April 8, 2023 Roberta @ OPUS Group 11

duplicated code – 78% (26) long methods – 78% (26) inadequate naming – 69% (23) god classes – 42% (14)

same results for developers of reusable assets and standalone applications...

...regardless of experience level

Page 12: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

how often refactoring tools are used...

April 8, 2023 Roberta @ OPUS Group 12

Page 13: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

...and reasons for not using them

April 8, 2023 Roberta @ OPUS Group 13

tool does not support the desired refactoring – 41% they did not know any refactoring tool – 37% tools do not allow them to easily follow the effects of

refactoring – 28% it’s not easy to test whether the system’s behaviour

was preserved – 22%

Page 14: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

classifying refactorings - difficulty

April 8, 2023 Roberta @ OPUS Group 14

Page 15: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

concluding remarks

April 8, 2023 15Roberta @ OPUS Group

nature of the software being developed influences refactoring habits

reusable assets developers consider the possibility of breaking APIs before refactoring

refactoring prioritization is fairly different when we consider reusable assets versus standalone applications

refactoring scope is considered

Page 16: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

concluding remarks

visualization mechanisms improvements are needed

testing whether the code transformation preserved behaviour is not easy

specific tools or features could be investigated for refactorings of libraries, frameworks and software product lines

April 8, 2023 Roberta @ OPUS Group 16

Page 17: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

thank you

questions?

April 8, 2023 Roberta @ OPUS Group 17

Page 18: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

classifying refactorings - priority

April 8, 2023 Roberta @ OPUS Group 18

Page 19: Understanding the Longevity of Code Smells - Preliminary Results of an Explanatory Survey

classifying refactorings - frequency

April 8, 2023 Roberta @ OPUS Group 19