SlideShare a Scribd company logo
ÉCOLE POLYTECHNIQUE DE MONTRÉAL



  Concept Location with Genetic
Algorithms: A Comparison of Four
    Distributed Architectures


             Fatemeh Asadi
            Giuliano Antoniol
          Yann-Gaël Guéhéneuc
Content
 Motivations
 Literature Review
 Background
    Getting Traces, Trace Pruning and Compression
    Textual Analysis of Method Source Code
    Applying Search-based Optimization Technique
 Parallelizing GAs
    Rationale of the Architectures
    Simple Client Server Architecture
    Database Configuration
    Hash-database Configuration
    Hash Configuration
 Summery of Results
 Conclusion and Future Work

                                                    2
Motivations

 Genetic algorithms (GAs) are attractive to solve many search-based
 software engineering problems
 GAs are effective in finding approximate solutions when
   The search space is large or complex
   No mathematical analysis or traditional methods are available
   The problem to be solved is NP-complete or NP-hard


 GAs allow the parallelization of computations
   The evaluation of the fitness function is often performed on each
   individual in isolation
   Parallelizing the computations improves scalability and reduces
   computation time
                                                                       3
Motivations


 In this paper, we report our experience in distributing the
 computation of a fitness function to parallelize a GA to
 solve the concept location problem.

 We developed, tested, and compared four different
 configuration of distributed architectures to resolve the
 scalability issues of our concept location approach
     A client (master) performs GA operations and distributes the
    individuals among servers
    Servers (slaves) perform the computations of the fitness
    function
                                                                    4
Literature Review


 Mitchal et al. used a distributed hill-climbing to re-modularize large
 systems by grouping together related components by means of
 clustering techniques
 Mahdavi et al. used a distributed hill-climbing for module clustering


 Parallel GAs are classified into three categories (Stender et al.)
    Global parallelization: only the evaluation of the individuals’ fitness is
    parallelized (our approach)
    Coarse-grained parallelization (island model): a computer divides a
    population into subpopulations and assigns each to another computer.
    A GA is executed on each sub-population
    Fine-grained parallelization: each individual is assigned to a computer
    and all the GA operations are performed in parallel
                                                                                 5
Background

 Our proposed concept location approach consists of the
 following steps:
   Step I – System instrumentation
   Step II – Execution trace collection
   Step III – Trace pruning and compression
   Step IV – Textual analysis of method source code
   Step V – Search-based concept location




                                                          6
Step I and Step II – Getting the Traces


 Step I – System instrumentation
    It is performed to generate the trace of method invocations
      We used our instrumentor, MoDeC



 Step II – Execution trace collection
    We exercise the system following scenarios taken from user
    manuals or use-case descriptions



                                                                  7
Step III – Trace Pruning and Compression
  Trace pruning
     Too frequent methods occurring in many scenarios are not related to any
     particular concept (they are often utility methods)
        We remove methods having a frequency
        Q3 + 2 × IQR (75% percentile + 2 × the inter-quartile range)


  Trace compression
     We “collapse” repetitions in execution traces to reduce the search space
     Examples:
        m1(); m1(); m1();                =>          m1();
        m1(); m2(); m1(); m2();          =>          m1(); m2();
     We perform the collapsing using the Run Length Encoding (RLE)
     We apply the RLE for sub-sequences having an arbitrary length

                                                                                8
Step IV- Textual Analysis of Method Source Code

   The data provided in this part are used to calculate conceptual
   cohesion and coupling as described by Marcus et al. in 2008 and
   Poshyvanyk et al. in 2006.


   Our assumptions are
    1) Methods helping to implement a concept are likely to share
       some linguistic information (see Poshyvanyk et al., 2006)

    2) Methods responsible to implement a concept are likely to be
       called close to each other in an execution trace.

                                                                     9
Step IV – Textual Analysis of Method Source Code
Steps:
   Extraction of identifiers and comment words
   Camel-case splitting of composed identifiers: visitedNode -> visited & node
   Stop word removal (English + Java keywords)
   Stemming using the Porter stemmer: Visited -> visit
   Term-document matrix generation
     Considering each method is as a document
     Indexing using tf–idf
   Reducing the term-document space into a concept-document space using
   Latent Semantic Indexing (LSI)
     To cope with synonymy and polysemy
                                                                            10
Step V – Search-based Concept Location
    We use a search-based optimization technique based on a GA to split traces into
    segments that, we believe, represent concepts
    Representation: a bit-vector where 1 indicates the end of a segment

                  Trace splitting       m1 m2 m1 m3 m4 m1 m4 m6 m1

                  Representation        0    1   0   0   1   0       0       0       1

    Mutation: randomly flips a bit (i.e., splits or merge segments)
0    1   0    0    1    0   0       0    1                       0       0
                                                                         1       0       0   1   0   0   0    1

    Crossover: two-points
0    1   0    0    1    0   0       0    1                       0       1       0       0   0   1   0   0    1

0    0   1    0    0    1   0       0    1                       0       0       1       0   1   0   0   0    1

                                                                                                             11
    Selection: roulette wheel
Step V – Search-based Concept Location
  Fitness Function:



  Segment Cohesion is the average (textual) similarity between any pair
  of methods in a segment
  Segment Coupling is the average (textual) similarity between a segment
  and all other segments in the trace
  Other GA parameters
     200 individuals
     2,000 generations for JHotDraw and 3,000 for ArgoUML
     5% mutation probability, 70% crossover probability
                                                                     12
Parallelizing the GA
 Single-computer architecture come from an optimized implementation of our
 approach.
     We modified GALib to compute only the fitness values of individuals that
     have changed between the last generation and the current one.
     We thus obtained about 30% of computation-time decrease

 The computations were still time consuming
     Running an experiment with a short trace, containing 240 method invocations
     (Start–DrawRectangle–Stop), with 2,000 iterations lasted about 12 hours

 Solution: Parallelizing the computations

 Global parallelization:
     A master computer (client)
     Several slave computers (servers)

 Client server architectural style, on a TCP/IP network, with 9 servers
                                                                                   13
Rationale behind the Architectures

 Several individuals share some segments
    The first two segments of individuals Id1, Id2, and Id5 are
    identical, as shown below




 Once the fitness value of one individual is computed, if
 segment cohesion and coupling are stored, then they can
 be reused to compute the fitness values of others                14
Simple Client Server Architecture
that the
computations are have
 The servers very time consuming.
    No local memory
    No global shared memory
    No communication between themselves
 Each server uses its own local LSI matrix

 In the case of Start-DrawRectangle-
 stop trace, this architecture reduces
 the execution time to about two hours



                                             15
Database Configuration
 A large fragment of segments are preserved unchanged in the next
 generation

A central storage keeps a history of
the previous computations and share
the computation results
No calculation is done more than
once
Each computer benefits from others’
computations and does not repeat
what has been done once by others




                                                                    16
Database Configuration

 In the case of Start-
 DrawRectangle-stop trace, this
 architecture increases the
 computation time to 13 hours!


 Accessing to a database located on a
 different server is time consuming
 Database access issues
    Reading, writing, locking




                                        17
Hash-Database Configuration
A centralized and local storage are put together to decrease the numbers of
accesses to the central database by keeping cached data in a local storage
structure
Not much better than the last one




                                                                              18
Hash Configuration

A local storage
    Only local data is stored in the local
    hash table of servers.
    No data is shared among servers
    Servers only communicate with the
    client
    There is no access policy using locking
    algorithms
    The access to the already-computed
    data as well as their storage is efficient
    It enormously reduces the time.
    In the case of Start-DrawRectangle-
    stop trace, this architecture reduces
    the execution time to about 5
    minutes                                      19
Summery of Results

Computation time for desktop solution
and the distributed architectures with
the Start-DrawRectangle-stop trace



                                         Computation time for desktop solution
                                         and a hash-table distributed architecture
                                         with the Start-Spawn-Window-Draw-
                                         Circle-Stop”trace




                                                                                     20
Conclusion
 We presented and discussed four client–server architectures conceived
 to improve performance and reduce GA computation times to solve
 the concept location problem


 We discovered that on a standard TCP/IP network, the overhead of
 database accesses, communication, and latency may impair dedicated
 solutions


 In our experiments, the fastest solution was an architecture where each
 server kept track only of its computations without exchanging data
 with other servers
     This simple architecture reduced GA computation by about 140 times
     when compared to a simple implementation, in which all GA
                                                                           21
     operations are performed on a single machine
Future Work


 We intend to experiment different communication
 protocols (e.g., UDP) and synchronization strategies

 We will carry out other empirical studies to evaluate the
 approach on more traces, obtained from different systems,
 to verify the generality of our findings

 We will reformulate other search-based software
 engineering problems to exploit parallel computation to
 verify further our findings
                                                             22
Thank You!




             Questions?
                          23
Implementation and Environment
Two traces collected by instrumenting JHotDraw and executing the scenarios Start-
DrawRectangle-Quit and Start-Spawn-Window-Draw-Circle-Stop
Final length of the traces after removing utility methods and compression are
respectively 240 and 432 method invocations
Computations are distributed over a sub-network of 14 workstations
 Five high-end workstations, the most powerful ones, are connected in a Gigabit
Ethernet LAN
 Low-end workstations are connected to a LAN segment at 100 MBit/s and talk
among themselves at 100 Mbit/s
 Each experience was run on a subset of ten computers: nine servers and one client
Workstations run CentOS v5 64 bits
Memory varies between four to 16 Gbytes
Workstations are based on Athlon X2 Dual Core Processor 4400
The five high-end workstations are either single or dual Opteron
Workstations run basic Unix services and user processes
The client computer was also responsible to measure execution times and to verify the
liveness of connections
Connections to servers as well as connections to the database were implemented on
                                                                                        24
top of TCP/IP (AF INET) sockets
All components have been implemented in Java 1.5 64bits
The database server was MySQL server v5.0.77

More Related Content

PDF
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
IJERD Editor
 
PDF
An Optimized Parallel Algorithm for Longest Common Subsequence Using Openmp –...
IRJET Journal
 
PDF
Objective Evaluation of a Deep Neural Network Approach for Single-Channel Spe...
csandit
 
PDF
IRJET- Performance Analysis of RSA Algorithm with CUDA Parallel Computing
IRJET Journal
 
PDF
Parallel k nn on gpu architecture using opencl
eSAT Publishing House
 
PDF
E035425030
ijceronline
 
PDF
C0312023
iosrjournals
 
PDF
An Efficient Low Complexity Low Latency Architecture for Matching of Data Enc...
IJERA Editor
 
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
IJERD Editor
 
An Optimized Parallel Algorithm for Longest Common Subsequence Using Openmp –...
IRJET Journal
 
Objective Evaluation of a Deep Neural Network Approach for Single-Channel Spe...
csandit
 
IRJET- Performance Analysis of RSA Algorithm with CUDA Parallel Computing
IRJET Journal
 
Parallel k nn on gpu architecture using opencl
eSAT Publishing House
 
E035425030
ijceronline
 
C0312023
iosrjournals
 
An Efficient Low Complexity Low Latency Architecture for Matching of Data Enc...
IJERA Editor
 

What's hot (18)

PDF
B0330811
iosrjournals
 
PDF
A0360109
iosrjournals
 
PDF
On The Application of Hyperbolic Activation Function in Computing the Acceler...
iosrjce
 
PPTX
Hardware Implementation of Cascade SVM
Qian Wang
 
PDF
Optimized Design of 2D Mesh NOC Router using Custom SRAM & Common Buffer Util...
VLSICS Design
 
PDF
A NEW ALGORITHM FOR DATA HIDING USING OPAP AND MULTIPLE KEYS
Editor IJMTER
 
PDF
DSR Routing Decisions for Mobile Ad Hoc Networks using Fuzzy Inference System
cscpconf
 
PDF
THRESHOLD BASED VM PLACEMENT TECHNIQUE FOR LOAD BALANCED RESOURCE PROVISIONIN...
IJCNCJournal
 
PDF
4213ijaia02
ijaia
 
PPTX
Seminar_New -CESG
Qian Wang
 
PDF
Producer consumer-problems
Richard Ashworth
 
PDF
Efficient algorithm for rsa text encryption using cuda c
csandit
 
PDF
Paper on experimental setup for verifying - "Slow Learners are Fast"
Robin Srivastava
 
PDF
MAP REDUCE BASED ON CLOAK DHT DATA REPLICATION EVALUATION
IJDMS
 
PDF
A046020112
IJERA Editor
 
PDF
IRJET- Latin Square Computation of Order-3 using Open CL
IRJET Journal
 
PDF
MapReduce based SVM
Ferhat Ozgur Catak
 
PPTX
Communication costs in parallel machines
Syed Zaid Irshad
 
B0330811
iosrjournals
 
A0360109
iosrjournals
 
On The Application of Hyperbolic Activation Function in Computing the Acceler...
iosrjce
 
Hardware Implementation of Cascade SVM
Qian Wang
 
Optimized Design of 2D Mesh NOC Router using Custom SRAM & Common Buffer Util...
VLSICS Design
 
A NEW ALGORITHM FOR DATA HIDING USING OPAP AND MULTIPLE KEYS
Editor IJMTER
 
DSR Routing Decisions for Mobile Ad Hoc Networks using Fuzzy Inference System
cscpconf
 
THRESHOLD BASED VM PLACEMENT TECHNIQUE FOR LOAD BALANCED RESOURCE PROVISIONIN...
IJCNCJournal
 
4213ijaia02
ijaia
 
Seminar_New -CESG
Qian Wang
 
Producer consumer-problems
Richard Ashworth
 
Efficient algorithm for rsa text encryption using cuda c
csandit
 
Paper on experimental setup for verifying - "Slow Learners are Fast"
Robin Srivastava
 
MAP REDUCE BASED ON CLOAK DHT DATA REPLICATION EVALUATION
IJDMS
 
A046020112
IJERA Editor
 
IRJET- Latin Square Computation of Order-3 using Open CL
IRJET Journal
 
MapReduce based SVM
Ferhat Ozgur Catak
 
Communication costs in parallel machines
Syed Zaid Irshad
 
Ad

Viewers also liked (7)

PPT
Increase pinterest follower
simon220
 
PDF
ICSE12 SEE.ppt
Ptidej Team
 
PPT
Soundcloud badge
rogercana
 
PDF
WBT07.ppt
Ptidej Team
 
PDF
130531 francis nahm - on the evolution of antipatterns genealogies
Ptidej Team
 
PPTX
How to use Evernote
Julia Santos
 
PDF
AsianPLoP'14: How and Why Design Patterns Impact Quality and Future Challenges
Ptidej Team
 
Increase pinterest follower
simon220
 
ICSE12 SEE.ppt
Ptidej Team
 
Soundcloud badge
rogercana
 
WBT07.ppt
Ptidej Team
 
130531 francis nahm - on the evolution of antipatterns genealogies
Ptidej Team
 
How to use Evernote
Julia Santos
 
AsianPLoP'14: How and Why Design Patterns Impact Quality and Future Challenges
Ptidej Team
 
Ad

Similar to SSBSE10.ppt (20)

PDF
Ssbse10.ppt
Yann-Gaël Guéhéneuc
 
PDF
CSMR10a.ppt
Ptidej Team
 
PDF
TEFSE05.ppt
Ptidej Team
 
PDF
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
PDF
Anomalous symmetry succession for seek out
iaemedu
 
PDF
Version control thesis
Waleed Mohamed
 
PDF
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
Tao Xie
 
PDF
IEEE Final Year Projects 2011-2012 :: Elysium Technologies Pvt Ltd::Knowledge...
sunda2011
 
PDF
MSR populations talk v2.key
Matthew Chalmers
 
PPT
Scalability in Software Systems Engineering: The Good, the Bad, and the Ugly ...
David Rosenblum
 
PDF
Dotnet datamining ieee projects 2012 @ Seabirds ( Chennai, Pondicherry, Vello...
SBGC
 
PDF
OpenRepGrid – An Open Source Software for the Analysis of Repertory Grids
Mark Heckmann
 
PDF
How to Find Relevant Data for Effort Estimation
CS, NcState
 
PDF
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
Pooyan Jamshidi
 
PDF
Lecture 7: Data-Intensive Computing for Text Analysis (Fall 2011)
Matthew Lease
 
PDF
Pldi09 semantics aware trace analysis
ckamdem
 
PDF
SDE - Dynamic Analysis
Jorge Ressia
 
PDF
Evolutionary Testing Approach for Solving Path- Oriented Multivariate Problems
IDES Editor
 
PDF
Featureous: An Integrated Approach To Location, Analysis And Modularization O...
Andrzej Olszak
 
PDF
ICSM05.ppt
Ptidej Team
 
CSMR10a.ppt
Ptidej Team
 
TEFSE05.ppt
Ptidej Team
 
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
Anomalous symmetry succession for seek out
iaemedu
 
Version control thesis
Waleed Mohamed
 
SCAM 2012 Keynote Slides on Cooperative Testing and Analysis by Tao Xie
Tao Xie
 
IEEE Final Year Projects 2011-2012 :: Elysium Technologies Pvt Ltd::Knowledge...
sunda2011
 
MSR populations talk v2.key
Matthew Chalmers
 
Scalability in Software Systems Engineering: The Good, the Bad, and the Ugly ...
David Rosenblum
 
Dotnet datamining ieee projects 2012 @ Seabirds ( Chennai, Pondicherry, Vello...
SBGC
 
OpenRepGrid – An Open Source Software for the Analysis of Repertory Grids
Mark Heckmann
 
How to Find Relevant Data for Effort Estimation
CS, NcState
 
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
Pooyan Jamshidi
 
Lecture 7: Data-Intensive Computing for Text Analysis (Fall 2011)
Matthew Lease
 
Pldi09 semantics aware trace analysis
ckamdem
 
SDE - Dynamic Analysis
Jorge Ressia
 
Evolutionary Testing Approach for Solving Path- Oriented Multivariate Problems
IDES Editor
 
Featureous: An Integrated Approach To Location, Analysis And Modularization O...
Andrzej Olszak
 
ICSM05.ppt
Ptidej Team
 

More from Ptidej Team (20)

PDF
From IoT to Software Miniaturisation
Ptidej Team
 
PDF
Presentation
Ptidej Team
 
PDF
Presentation
Ptidej Team
 
PDF
Presentation
Ptidej Team
 
PDF
Presentation by Lionel Briand
Ptidej Team
 
PDF
Manel Abdellatif
Ptidej Team
 
PDF
Azadeh Kermansaravi
Ptidej Team
 
PDF
Mouna Abidi
Ptidej Team
 
PDF
CSED - Manel Grichi
Ptidej Team
 
PDF
Cristiano Politowski
Ptidej Team
 
PDF
Will io t trigger the next software crisis
Ptidej Team
 
PDF
MIPA
Ptidej Team
 
PDF
Thesis+of+laleh+eshkevari.ppt
Ptidej Team
 
PDF
Thesis+of+nesrine+abdelkafi.ppt
Ptidej Team
 
PDF
Medicine15.ppt
Ptidej Team
 
PDF
Qrs17b.ppt
Ptidej Team
 
PDF
Icpc11c.ppt
Ptidej Team
 
PDF
Icsme16.ppt
Ptidej Team
 
PDF
Msr17a.ppt
Ptidej Team
 
PDF
Icsoc15.ppt
Ptidej Team
 
From IoT to Software Miniaturisation
Ptidej Team
 
Presentation
Ptidej Team
 
Presentation
Ptidej Team
 
Presentation
Ptidej Team
 
Presentation by Lionel Briand
Ptidej Team
 
Manel Abdellatif
Ptidej Team
 
Azadeh Kermansaravi
Ptidej Team
 
Mouna Abidi
Ptidej Team
 
CSED - Manel Grichi
Ptidej Team
 
Cristiano Politowski
Ptidej Team
 
Will io t trigger the next software crisis
Ptidej Team
 
Thesis+of+laleh+eshkevari.ppt
Ptidej Team
 
Thesis+of+nesrine+abdelkafi.ppt
Ptidej Team
 
Medicine15.ppt
Ptidej Team
 
Qrs17b.ppt
Ptidej Team
 
Icpc11c.ppt
Ptidej Team
 
Icsme16.ppt
Ptidej Team
 
Msr17a.ppt
Ptidej Team
 
Icsoc15.ppt
Ptidej Team
 

Recently uploaded (20)

PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Doc9.....................................
SofiaCollazos
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
The Future of Artificial Intelligence (AI)
Mukul
 

SSBSE10.ppt

  • 1. ÉCOLE POLYTECHNIQUE DE MONTRÉAL Concept Location with Genetic Algorithms: A Comparison of Four Distributed Architectures Fatemeh Asadi Giuliano Antoniol Yann-Gaël Guéhéneuc
  • 2. Content Motivations Literature Review Background Getting Traces, Trace Pruning and Compression Textual Analysis of Method Source Code Applying Search-based Optimization Technique Parallelizing GAs Rationale of the Architectures Simple Client Server Architecture Database Configuration Hash-database Configuration Hash Configuration Summery of Results Conclusion and Future Work 2
  • 3. Motivations Genetic algorithms (GAs) are attractive to solve many search-based software engineering problems GAs are effective in finding approximate solutions when The search space is large or complex No mathematical analysis or traditional methods are available The problem to be solved is NP-complete or NP-hard GAs allow the parallelization of computations The evaluation of the fitness function is often performed on each individual in isolation Parallelizing the computations improves scalability and reduces computation time 3
  • 4. Motivations In this paper, we report our experience in distributing the computation of a fitness function to parallelize a GA to solve the concept location problem. We developed, tested, and compared four different configuration of distributed architectures to resolve the scalability issues of our concept location approach A client (master) performs GA operations and distributes the individuals among servers Servers (slaves) perform the computations of the fitness function 4
  • 5. Literature Review Mitchal et al. used a distributed hill-climbing to re-modularize large systems by grouping together related components by means of clustering techniques Mahdavi et al. used a distributed hill-climbing for module clustering Parallel GAs are classified into three categories (Stender et al.) Global parallelization: only the evaluation of the individuals’ fitness is parallelized (our approach) Coarse-grained parallelization (island model): a computer divides a population into subpopulations and assigns each to another computer. A GA is executed on each sub-population Fine-grained parallelization: each individual is assigned to a computer and all the GA operations are performed in parallel 5
  • 6. Background Our proposed concept location approach consists of the following steps: Step I – System instrumentation Step II – Execution trace collection Step III – Trace pruning and compression Step IV – Textual analysis of method source code Step V – Search-based concept location 6
  • 7. Step I and Step II – Getting the Traces Step I – System instrumentation It is performed to generate the trace of method invocations We used our instrumentor, MoDeC Step II – Execution trace collection We exercise the system following scenarios taken from user manuals or use-case descriptions 7
  • 8. Step III – Trace Pruning and Compression Trace pruning Too frequent methods occurring in many scenarios are not related to any particular concept (they are often utility methods) We remove methods having a frequency Q3 + 2 × IQR (75% percentile + 2 × the inter-quartile range) Trace compression We “collapse” repetitions in execution traces to reduce the search space Examples: m1(); m1(); m1(); => m1(); m1(); m2(); m1(); m2(); => m1(); m2(); We perform the collapsing using the Run Length Encoding (RLE) We apply the RLE for sub-sequences having an arbitrary length 8
  • 9. Step IV- Textual Analysis of Method Source Code The data provided in this part are used to calculate conceptual cohesion and coupling as described by Marcus et al. in 2008 and Poshyvanyk et al. in 2006. Our assumptions are 1) Methods helping to implement a concept are likely to share some linguistic information (see Poshyvanyk et al., 2006) 2) Methods responsible to implement a concept are likely to be called close to each other in an execution trace. 9
  • 10. Step IV – Textual Analysis of Method Source Code Steps: Extraction of identifiers and comment words Camel-case splitting of composed identifiers: visitedNode -> visited & node Stop word removal (English + Java keywords) Stemming using the Porter stemmer: Visited -> visit Term-document matrix generation Considering each method is as a document Indexing using tf–idf Reducing the term-document space into a concept-document space using Latent Semantic Indexing (LSI) To cope with synonymy and polysemy 10
  • 11. Step V – Search-based Concept Location We use a search-based optimization technique based on a GA to split traces into segments that, we believe, represent concepts Representation: a bit-vector where 1 indicates the end of a segment Trace splitting m1 m2 m1 m3 m4 m1 m4 m6 m1 Representation 0 1 0 0 1 0 0 0 1 Mutation: randomly flips a bit (i.e., splits or merge segments) 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 Crossover: two-points 0 1 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 11 Selection: roulette wheel
  • 12. Step V – Search-based Concept Location Fitness Function: Segment Cohesion is the average (textual) similarity between any pair of methods in a segment Segment Coupling is the average (textual) similarity between a segment and all other segments in the trace Other GA parameters 200 individuals 2,000 generations for JHotDraw and 3,000 for ArgoUML 5% mutation probability, 70% crossover probability 12
  • 13. Parallelizing the GA Single-computer architecture come from an optimized implementation of our approach. We modified GALib to compute only the fitness values of individuals that have changed between the last generation and the current one. We thus obtained about 30% of computation-time decrease The computations were still time consuming Running an experiment with a short trace, containing 240 method invocations (Start–DrawRectangle–Stop), with 2,000 iterations lasted about 12 hours Solution: Parallelizing the computations Global parallelization: A master computer (client) Several slave computers (servers) Client server architectural style, on a TCP/IP network, with 9 servers 13
  • 14. Rationale behind the Architectures Several individuals share some segments The first two segments of individuals Id1, Id2, and Id5 are identical, as shown below Once the fitness value of one individual is computed, if segment cohesion and coupling are stored, then they can be reused to compute the fitness values of others 14
  • 15. Simple Client Server Architecture that the computations are have The servers very time consuming. No local memory No global shared memory No communication between themselves Each server uses its own local LSI matrix In the case of Start-DrawRectangle- stop trace, this architecture reduces the execution time to about two hours 15
  • 16. Database Configuration A large fragment of segments are preserved unchanged in the next generation A central storage keeps a history of the previous computations and share the computation results No calculation is done more than once Each computer benefits from others’ computations and does not repeat what has been done once by others 16
  • 17. Database Configuration In the case of Start- DrawRectangle-stop trace, this architecture increases the computation time to 13 hours! Accessing to a database located on a different server is time consuming Database access issues Reading, writing, locking 17
  • 18. Hash-Database Configuration A centralized and local storage are put together to decrease the numbers of accesses to the central database by keeping cached data in a local storage structure Not much better than the last one 18
  • 19. Hash Configuration A local storage Only local data is stored in the local hash table of servers. No data is shared among servers Servers only communicate with the client There is no access policy using locking algorithms The access to the already-computed data as well as their storage is efficient It enormously reduces the time. In the case of Start-DrawRectangle- stop trace, this architecture reduces the execution time to about 5 minutes 19
  • 20. Summery of Results Computation time for desktop solution and the distributed architectures with the Start-DrawRectangle-stop trace Computation time for desktop solution and a hash-table distributed architecture with the Start-Spawn-Window-Draw- Circle-Stop”trace 20
  • 21. Conclusion We presented and discussed four client–server architectures conceived to improve performance and reduce GA computation times to solve the concept location problem We discovered that on a standard TCP/IP network, the overhead of database accesses, communication, and latency may impair dedicated solutions In our experiments, the fastest solution was an architecture where each server kept track only of its computations without exchanging data with other servers This simple architecture reduced GA computation by about 140 times when compared to a simple implementation, in which all GA 21 operations are performed on a single machine
  • 22. Future Work We intend to experiment different communication protocols (e.g., UDP) and synchronization strategies We will carry out other empirical studies to evaluate the approach on more traces, obtained from different systems, to verify the generality of our findings We will reformulate other search-based software engineering problems to exploit parallel computation to verify further our findings 22
  • 23. Thank You! Questions? 23
  • 24. Implementation and Environment Two traces collected by instrumenting JHotDraw and executing the scenarios Start- DrawRectangle-Quit and Start-Spawn-Window-Draw-Circle-Stop Final length of the traces after removing utility methods and compression are respectively 240 and 432 method invocations Computations are distributed over a sub-network of 14 workstations Five high-end workstations, the most powerful ones, are connected in a Gigabit Ethernet LAN Low-end workstations are connected to a LAN segment at 100 MBit/s and talk among themselves at 100 Mbit/s Each experience was run on a subset of ten computers: nine servers and one client Workstations run CentOS v5 64 bits Memory varies between four to 16 Gbytes Workstations are based on Athlon X2 Dual Core Processor 4400 The five high-end workstations are either single or dual Opteron Workstations run basic Unix services and user processes The client computer was also responsible to measure execution times and to verify the liveness of connections Connections to servers as well as connections to the database were implemented on 24 top of TCP/IP (AF INET) sockets All components have been implemented in Java 1.5 64bits The database server was MySQL server v5.0.77