Saturday, 12 January 2013

Computer-Aided Code Refactoring in Eclipse: Start tackling Technical Debt with @Scertify


  • (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();


  • (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

In order to start tackling Technical Debt through Code Refactoring with with Scertify?, please follow the installation steps described below.

1. Create an account into the Tocea cloud

You need to create an account in http://cloud.tocea.com. If you already have created your account to try other products, please skip this step and go to step #2.

Click to enlarge

Fill the registration form with your information. Once you submit the form, 2 emails will be sent to you:

  • The first one (?Your license key for product Scertify demo?) contains your trial license key?that will be used for the trial version of Scertify?
  • The second one contains login/password for your account at cloud.tocea.com.
    Think about checking your spam folder if you did not get these messages within 5 minutes.

2. Install Scertify? Refactoring Eclipse plugin

NOTE: In order to ensure the best experience with our products, you?ll need Eclipse Juno to proceed to Scertify Eclipse plugins installation.

To install Scertify? Refactoring Eclipse plugin, simply install the new update site (in Eclipse menu Help ?
Install new software ? Add) :

? Name: Scertify Refactoring plugin
? Location: http://dl.tocea.fr/refactoring/update_site/repository/

Click to enlarge

If you have already installed the Scertify? Eclipse plugin in your Eclipse you can simply update it by clicking on (Help ? Check for update to obtain the update).

In some cases, a warning message might prompt about authenticity of the software. Click OK to continue the installation.

Once plugin is installed and your Eclipse restarted, go to the Scertify? preferences (menu Window ? Preferences ? Scertify Refactoring).

IMPORTANT: If you have an internet connection through a proxy, be sure to have it well configured in Eclipse.

3. Authentification

Add your login/password for the Tocea cloud account :

? Login: the e-mail address used when creating your account to Cloud.Tocea.com
? Password: the Scertify? trial license key you received (?Your license key for product Scertify demo?)

Specify Local Scertify?s url to: http://cloud.tocea.com/ScertifyDL/api/install/demo/

Click to enlarge

4.?Performing a Code Refactoring

To perform a code refactoring of a file or set of files, right-click on a file (or Shift+Click on files, then right-click) in the Package Explorer view, ? Scertify Refactoring ? Refactor My Code.

Click to enlarge

Select the programming rules you wish to apply for code refactoring. In the trial version, 4 refactoring rules are available:

  • PositionLiteralsFirstInComparisons

    In case of String comparison with a literal, place the literal first. e.g:

    String str = "here";

    //Before refactoring

    str.equals("there");

    //After refactoring

    "there".equals(str);

  • InefficientNumberConstructor

    Replace new Integer(value) by Integer.valueOf(value)

    //Before refactoring

    Integer i = new Integer(4);

    //After refactoring

    Integer i = Integer.valueOf(4);

  • IfElseStmtsMuseUseBraces

    Add braces to conditions not using ones

    //Before refactoring

    if(true)

    System.out.println(";)");

    //After refactoring

    if(true) {

    System.out.println(";)");

    }

  • LocalVariablesCouldBeFinal

    Add a final to local variable

Click to enlarge

For a given code statement, only one rule is applied at a time. So, if a code statement needs two corrections, you need to perform two refactoring.

Requirements

In order to ensure the best experience with our products, you?ll need Eclipse Juno to proceed to Scertify Eclipse plugins installation.

Comments are closed.

Source: http://feeds.dzone.com/~r/dzone/frontpage/~3/qMMMnOjfils/computeraided_code_refactoring_in_eclipse_start_t.html

billy joel bent new york jets etch a sketch romney sean payton saints bounty program toulouse france

No comments:

Post a Comment