Saturday, May 28, 2016

Detecting and Preventing Code Clones Mercilessly - workshop guide

Please follow these steps:

First: Open the code project

We will be working on the example project provided by ConQAT:
  1. Open Eclipse
  2. Goto: New Project > Examples > ConQAT Examples > ConQAT Examples Project
Second: Run the code clones analysis tools
  1. Double click the clonedetection-example-junit.cqr 
  2. Click Launch ConQAT analysis
  3. After it finishes, goto Menu: Clone Detection > Open Clone Report, and select the clones.xml file in the output directory
Third: Detecting exact code clones
  1. Back to the clonedetection-example-junit.cqr page
  2. Scroll all the way to the right and click the 'New' button
  3. Add the field 'equality', and enter value 1 in the threshold
  4. Launch the analysis and reload the clones.xml file
Forth: Detecting similar code clones
  1. Back to the clonedetection-example-junit.cqr page
  2. Scroll all the way to the right and click the 'New' button
  3. Add the field 'similarity', and enter value 1 in the threshold
  4. Remove the 'equality' parameter
  5. Launch the analysis and reload the clones.xml file
Fifth: Detecting gapped clones
  1. Goto the 'ConQat blocks' section at the top right of the configuration file
  2. Click on 'Change' button
  3. Select 'Code Clones > JavaGappedClonesAnalysis'
  4. Add a parameter called 'errors' and enter the value = 2
  5. Add a parameter called 'gap' and enter the ratio = 0.2 
  6. Launch the analysis and reload the clones-gapped.xml file (notice the file name is different than the previous ones)

Tuesday, May 3, 2016

I'm Speaking at Agile2016


I'm glad to announce that I will be speaking at the Agile Conference - Agile2016 organized by Agile Alliance. This is the biggest agile gathering in the world, featuring more than 2000 attendees and 200 sessions.

I will be running a technical workshop titled: Detecting and Preventing Code Clones Mercilessly, at which I will go through different types of code clones and how to detect and prevent them.