ON THE USE OF GENETIC PROGRAMMING Adam C. Jensen and Betty H.C. - - PDF document

on the use of genetic programming
SMART_READER_LITE
LIVE PREVIEW

ON THE USE OF GENETIC PROGRAMMING Adam C. Jensen and Betty H.C. - - PDF document

2/27/2014 ON THE USE OF GENETIC PROGRAMMING Adam C. Jensen and Betty H.C. Cheng. 2010. In Proceedings of FOR AUTOMATED REFACTORING AND THE the 12th annual conference on Genetic and evolutionary INTRODUCTION OF DESIGN PATTERNS computation


slide-1
SLIDE 1

2/27/2014 1

ON THE USE OF GENETIC PROGRAMMING FOR AUTOMATED REFACTORING AND THE INTRODUCTION OF DESIGN PATTERNS

Adam C. Jensen and Betty H.C.

  • Cheng. 2010. In Proceedings of

the 12th annual conference on Genetic and evolutionary computation (GECCO '10

Motivation

  • Metrics enable a software engineer

to evaluate various characteristics

  • f design quality
  • Design patterns provide

contextual-driven solution template for solving design problems that occur frequently in large software projects

  • Reduce the cognitive labor for

software engineers by suggesting design changes that are tailored to the software design in question

Presented by Rodrigo Morales

slide-2
SLIDE 2

2/27/2014 2

Objective

  • Automates the use of software engineering metrics to generate

refactoring strategies that introduce design patterns

  • Using a an evolutionary computation-based approach REMODEL

Presented by Rodrigo Morales

Components

  • Solution representation Refactored software design
  • Mechanism for making changes to that solution
  • Means of measuring the solution’s quality

Presented by Rodrigo Morales

slide-3
SLIDE 3

2/27/2014 3

Solution Representation

  • Refactored software design
  • A design graph that represents the software design that is being refactored
  • The set of steps to transform the original design into the refactored

design

  • A transformation tree whose nodes represents minitransformations1

Presented by Rodrigo Morales

Metrics

  • QMOOD[2] metric suite
  • 11 individual metrics
  • Evaluates distinct characteristics of OO design quality

Presented by Rodrigo Morales

slide-4
SLIDE 4

2/27/2014 4

What is REMODEL?

  • Genetic programming environment
  • Guided by Software metrics
  • To determine the optimal set of refactoring's to apply to a software

design

Presented by Rodrigo Morales

It looks for

  • Improve the quality of the design as measured by the QMOOD
  • Introduce design patterns when appropriate

Presented by Rodrigo Morales

slide-5
SLIDE 5

2/27/2014 5

How individuals are represented?

  • The individuals are represented as a pair that includes
  • A design graph
  • Transformation tree

Presented by Rodrigo Morales

Design graph

  • Represents the software design that is being refactored

Presented by Rodrigo Morales

slide-6
SLIDE 6

2/27/2014 6

Transformation tree

  • Set of changes to the individual’s design graph
  • Executing the tree involves visiting each of its nodes and executing

that node’s children recursively from left to right

  • Each node is
  • Transformation node (implementation of minitransformations)
  • Information node
  • Root node that

Presented by Rodrigo Morales Presented by Rodrigo Morales

slide-7
SLIDE 7

2/27/2014 7

REMODEL Benefits

  • The use of graph to represent target software design enables efficient

computation of metrics

  • The order of the nodes describe a step-by-step series of refactoring

Presented by Rodrigo Morales

Design change mechanisms

  • Abstraction
  • Abstract Access
  • Delegation
  • Encapsulate construction
  • Partial abstraction
  • Wrapper

Presented by Rodrigo Morales

slide-8
SLIDE 8

2/27/2014 8

Mutation Operations

  • To explore the space of refactoring strategies:
  • After being selected 90% of individuals undergo
  • Subtree CrossOver
  • Point mutation

Presented by Rodrigo Morales Presented by Rodrigo Morales

slide-9
SLIDE 9

2/27/2014 9

Design Evaluation

  • Prolog-based design pattern detector

Presented by Rodrigo Morales

Abstract Factory

  • Abstract Factory
  • Concrete Factory
  • Abstract produt
  • Conret Product
  • Client

Optimizations

  • 1. Encourages individuals to evolve transformation trees with fewer

transformation nodes

  • 2. Rewards individuals that incorporate sequences of transformations

nodes produce design pattern fragments

Presented by Rodrigo Morales

slide-10
SLIDE 10

2/27/2014 10

Fitness Function

Presented by Rodrigo Morales

Where: Q is quality PR: amount of fitness bonus of at least one design pattern NCP fitness penalty proportionate to the number of transformation nodes in Transformation tree MSR: fitness bonus given for the presence of specific sequences of transformation nodes C: coefficient that determines the relative weight of that term

Validation

  • 4 empirical experiments (58 published software designs 5-15 classes

each)

  • Case study ReMoDD Web-based software system
  • Each experiment comprises 100 generations
  • Tournament selection with a tournament size of 7
  • REMODEL was applied 5 times

Presented by Rodrigo Morales

slide-11
SLIDE 11

2/27/2014 11

Case Study: ReMoDD

  • Repository for Model-Driven development containing model-driving

engineering artifacts (test cases, documentation, model and code)

  • Comprises 23 classes

Presented by Rodrigo Morales

Discussion

Presented by Rodrigo Morales