Knowledge-Based Search's Guide

Index

1. Overview
1.1. Introduction to This Document
1.2. Introduction to This Tool
2. Operating Environment
2.1. Hardware Requirements
2.2. Software Requirements
2.3. Prerequisite
3. Installing the Tool
3.1. Installing the Tool
4. How to Use
4.1. Operating Procedures
4.1.1. Search Function
4.1.1.1. Creating Your Eclipse Project
4.1.1.2. Conducting a Search
4.1.2. Feature for Editing Search Results
4.1.2.1. Checking Search Results
4.1.2.2. Editing Search Results
4.1.2.3. Exporting Editing Results
5. Uninstalling the Tool
5.1. Uninstalling the Tool
6.Appendix
6.1.Installing Python and lxml module
6.1.1.Instructions for installing on Linux
6.1.2.Instructions for installing on Windows

1. Overview


1.1. Introduction to This Document


This manual provides a brief description of procedures from installation through to use of the Knowledge-Based Search.



1.2. Introduction to This Tool


Operating as an Eclipse plug-in, this tool makes a rough estimate of the scale of rewriting required of programmers in migrating to JBoss. It comes with the following major features.

Table 1. Major tool features

FeatureDescription
Search functionFeature for finding code that must be rewritten in porting software to JBoss.
Feature for editing search resultsEnables editing of a visual representation of search results. It allows you to individually adjust the need for porting of search results. This improves the accuracy in extracting the scale of porting based on the requirements of each application.
Conversion functionFinds and converts code that can be converted.




2. Operating Environment


2.1. Hardware Requirements


It has been confirmed that the tool can operate in the following hardware environment.

Table 1. Hardware Requirements

ItemRequirements
CPUPentium (R) Dual-Core CPU E5400 @2.70GHz (2 CPU) or the equivalent
RAM2012MB RAM or more



2.2. Software Requirements


It has been confirmed that the tool can operate in the following software environment.

Table 1. Software Requirements

ItemRequirements
OSWindows XP/7, RHEL6(*)Other Linux Compatible
Java VM Oracle JRE 1.6 or more
IDE Eclipse 3.7 Indigo or Eclipse 4.3 Kepler
ScriptPython 2.6 or 2.7 + lxml module

[Note]Note

When Python and lxml module are not installed, please install it with reference to Appendix "Installing Python and lxml module".



2.3. Prerequisite


This tool assumes that the following file is present.



3. Installing the Tool


3.1. Installing the Tool


Set up the operating environment described above. Perform the steps below after the required environment has been set up.

  1. Download

    Download the plug-in.

    [Note]Note

    https://github.com/TUBAME/migration-tool/releases

  2. Unzip

    Unzip the downloaded file. Unzipping the file creates the tubame.portability_* directory.

    [Note]Note

    The * part of the name varies with the version.

    [Important]Important

    Unzipping the file in Windows may fail due to path length limitations. If it fails, use a short path such as C:\temp for unzipping.

  3. Set Python runtime.

    Use a text editor to open resources/properties/application*.properties under the unzipped directory. As shown below, set the path where Python is installed.

    # Example showing installation under Windows
    PYTHON_RUNTIME_PATH=C:/Python27/python.exe
    					

  4. Install in Eclipse.

    Move or copy the unzipped directory to the plugins directory under the Eclipse installation directory.

  5. Confirm installation.

    Select the Eclipse menu as shown below.

    HelpAbout EclipseInstallation DetailsPlug-ins

    Confirm that the Plug-in Id column contains the tubame.portability plug-in name.

  6. Complete installation.

    This completes the installation.



4. How to Use


4.1. Operating Procedures


The following describes how to use the features of each tool.



4.1.1. Search Function


This feature finds the code that has to be rewritten when porting to JBoss.



4.1.1.1. Creating Your Eclipse Project


Perform the following steps.

  1. Start up Eclipse.

  2. Start up the project creation wizard.

    FileNewProject...

  3. Create a Java Project.

    Java ProjectNext

    Use the New Java Project wizard to make the appropriate settings required by the environment of the item to be ported to create a project.

  4. Position the source files that need to be ported.

    Position the source files that need to be ported in the created project.

    [Note]Note

    Position not only *.java, but also *.jar, *.xml, *.jsp, *.properties, *.xsd and all other files that are required for running the application.

    [Note]Note

    There is no need to make all the preparations required for a successful build.



4.1.1.2. Conducting a Search


Perform the following steps.

  1. Select search resource.

    Right-click a resource you want to search and select the following menu.

    tubameKnowledge-Based Search

  2. Set search conditions.

    Make the following entries.

    Knowledge XML file selection: Specify the Knowledge XML file to be searched.
    Destination of output results: Specify a jbm file to which to save the search results

  3. Conduct a search.

    Click Finish to start the search.



4.1.2. Feature for Editing Search Results


This feature allows you to edit a visual representation of the search results. Sometimes it may be necessary to individually check what search results need to be ported. Visual checks or inquiries are made regarding such results to determine whether they need to be ported. This process is completed when all items that need to be ported have been found.

Perform the following steps.

  1. Open the search result files.

  2. Check the source code.

  3. Check the visual check items.

  4. Check the inquiry check items.

  5. Link to the porting guideline.

  6. Display the check list information.

  7. Delete items that need not be ported.

  8. Display work progress status.

  9. Calculate the total number of lines.

  10. Display the number of hits or all items.

  11. Output a report.



4.1.2.1. Checking Search Results


The following describes a method for confirming search results.

  1. Open the jbm file.

    Double click the saved jbm file that contains the search results.

    [Note]Note

    This step is not necessary since the search result file automatically opens after a search has been conducted.

  2. Check the screen for editing search results.

    The screen for editing search results shows a list of items that may have to be ported. An overview of the displayed items is provided below. Double click a line to open an editor with an associated extension to display the relevant file.

    [Note]Note

    The Switch display button in the Eclipse toolbar allows you to switch between display of all search items and hit items.

    Table 1. Items displayed in the screen for editing search results

    ItemDescription
    No.Number of the searched condition.
    Hit countThe number of items that matched the search conditions.
    Major item-
    Minor item-
    File namePath from project route of the relevant file.
    LineLine number of the relevant file.
    Degree of difficulty Difficulty icons indicate the degree of difficulty that porting involves.
    [Note]Note

    There are the following classifications.

    • High

      Requires major rewriting of the implementation involving major changes to the implementation, settings and other changes.

    • Middle

      Requires minor rewriting of the implementation.

    • Low

      Can be handled by minor rewriting that does not affect implementation.

    • Unknown

      Unknown difficulty

    • NOT_TRN

      Cannot be ported.

    Guide chapter The number of the chapter in the Portability Examination Guideline.

    Click an item to link to the Portability Examination Guideline.

    [Note]Note

    To use this feature, the HTML created using the Knowledge Manager must be placed in the resources/guide/index.html.

    The GUIDE_FILE_PATH parameter of the resources/properties/application*.properties can be used to change the location.

    Visual check detailsDescribes the details of a visual check (indicated by 0 column width when initially displayed).
    Inquiry check detailsDescribes the details of an inquiry check (indicated by 0 column width when initially displayed).
    Visual status Current status of visual check.
    [Note]Note

    There are the following classifications.

    • Blank

      There is no need for a visual check.

    • Not completed

      There are still items that require visual checking.

    • Not checked

      The visual check has not been conducted.

    • Completed

      The visual check has been completed.

    • Checked (no need for porting)

      The visual check has been completed (the check determined that there were no issues).

    • Checked (need to be ported)

      The visual check has been completed (the check determined that porting was required).

    Inquiry status Current status of inquiry check
    [Note]Note

    There are the following classifications.

    • Blank

      There is no need for an inquiry check.

    • Not completed

      There are still items that require inquiry checking.

    • Not checked

      The inquiry check has not been conducted.

    • Completed

      The inquiry check has been completed.

    • Checked (no need for porting)

      The inquiry check has been completed (the check determined that there were no issues).

    • Checked (need to be ported)

      The inquiry check has been completed (the check determined that porting is necessary).

    Line count The approximate number of lines that must be rewritten.
    [Note]Note

    There are the following classifications.

    • Numeric value

      The approximate number of lines that must be rewritten.

    • TODO: Code manually calculated by SE

      Items that should be calculated separately according to the commentary.

    • Unknown

      Items that require separate calculation because the number of lines are not known.

    • Checked (no need for porting)

      The inquiry check has been completed (the check determined that there were no issues).

    • Checked (need to be ported)

      The inquiry check has been completed (the check determined that porting is necessary).

    Line count basisProvides a reason for why the stated number of lines need to be ported.
    Total linesHit count times line count

  3. Check using Checklist Information view.

    The Checklist Information view allows you to check detailed information regarding items selected in the screen for editing search results. It allows you to check the following information.

    Table 2. Items that Checklist Information view displays.

    ItemDescription
    Major item-
    Minor item-
    Visual check detailsInvestigation method or criteria relying on visual checks when a search is not enough to identify items that need to be migrated.
    Inquiry check detailsInquiries made to the developer when the need for migration cannot be determined otherwise.
    Search methodDescribes the method used for searching items that need to be ported.
    Porting factorsThe reasons that make migration necessary.
    Difficulty detailsThe details of difficulties involved in performing migration work.
    Reason for not calculatingReason given for not calculating the number of lines that need to be rewritten.
    Investigation methodInvestigation method used to calculate the number of lines that need to be rewritten.

  4. Check using Work Status view.

    The Work Status view allows you to check current edit work status.

    Table 3. Items displayed in Work Status view

    ItemDescription
    Current work statusDisplays current work status.
    [Note]Note

    There are the following classifications.

    • The check item work has been completed.

    • Check visual check and inquiry check items.

    • Unknown/TODO: Check code manually calculated by SE.

    • Overwrite the file.

    Current visual check/inquiry check statusIndicates the remaining and total number of items in the visual check status and inquiry check status displayed in the screen for editing search results.
    Unknown/TODO: Rewriting status of code manually calculated by SE Indicates the remaining and total number of items in the rewriting status of unknown items and rewriting status of code manually calculated by SE displayed in the screen for editing search results.



4.1.2.2. Editing Search Results


To calculate the scale of porting required, the need for porting among all the search results must be determined. Steps for doing that are described below.

  1. Check the visual status.

    Items whose visual status has not been checked must be visually checked to determine whether or not they require porting. Check the relevant files to determine whether porting is required. When it becomes clear that porting is necessary, use the result to change the status of the visual status column. Right-click the relevant code to change the status to any of those listed below.

    [Note]Note

    There are the following classifications.

    • Not checked

      Not checked

    • Checked (no need for porting)

      No issues

    • Checked (need to be ported)

      Porting is required

    [Note]Note

    Use the Shift and Ctrl keys to select multiple items. (Note that the above menu will not appear when lines not subject to visual checks are included in the selection range.)

  2. Check the inquiry status.

    It is necessary to make inquiries to the developer regarding items whose inquiry status has not been checked to determine whether they require porting. Contact the developer to check whether or not the relevant code requires porting. When it becomes clear that porting is necessary, use the result to change the status of the inquiry status column. Right-click the relevant code to change the status to any of those listed below.

    [Note]Note

    There are the following classifications.

    • Not checked

      Not checked

    • Checked (no need for porting)

      No issues

    • Checked (need to be ported)

      Porting is required

    [Note]Note

    Use the Shift and Ctrl keys to select multiple items. (Note that the above menu will not appear when lines not subject to visual checks are included in the selection range.)

  3. Delete items that need not be ported.

    This feature allows you to delete items not related to porting from the screen. You can either select single lines to delete them one at a time or select all lines to delete them at one time.

    Table 1. Deletion method

    ItemDescription
    Delete selected lineClick the Delete Line button in the Eclipse toolbar to delete the selected line.
    Delete all linesClick the Delete items need not be ported button in the Eclipse toolbar.

    [Note]Note

    Use the Shift and Ctrl keys to select multiple items.



4.1.2.3. Exporting Editing Results


You can create totals and final reports by exporting edited results as a CSV file.

  1. Export

    Select Export to CSV from the Eclipse menu to output a CSV file.

  2. Analyze CSV files.

    This tool does not provide a tool for analyzing CSV files. The user should create an analyzing tool or some other suitable tool.



5. Uninstalling the Tool


5.1. Uninstalling the Tool


Delete the installed tubame.portability_*. This completes the uninstallation.

[Note]Note

The * part of the name varies with the version.

[Note]Note

Add the -clean option when starting up Eclipse after deletion.



6.Appendix


6.1.Installing Python and lxml module


The following describes an installation procedure of Python and lxml module.



6.1.1.Instructions for installing on Linux


The following describes an installation procedure using yum on Linux.

  1. confirming the installed package

    execute rpm command and confirm whether Python and lxml module are installed. When it is not installed, install it.

    $ rpm –q python python-lxml
    python-*
    python-lxml-*
    					

  2. Installation

    execute yum command and install Python and lxml module.

    $ su -
    # yum install python python-lxml
    					



6.1.2.Instructions for installing on Windows


The following describes an installation procedure using installer on Windows.

  1. downloading the installer file.

    download an installer from the following links.

    [Note]Note

    Python2.7.6: http://python.org/download/releases/2.7.6

    lxml3.2.4: https://pypi.python.org/pypi/lxml/3.2.4

  2. Python installation

    run the installer "python-2.7.6.*.msi" and Follow the wizard instructions to install.

  3. lxml installation

    run the installer "lxml-3.2.4.*-py2.7.exe" and Follow the wizard instructions to install.