<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>(CLSCR) Cross Language Source Code Reuse Detection using Intermediate Language</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dimpal Shah</string-name>
          <email>Dimpalshah38@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Heena Jethani</string-name>
          <email>heenahjethani@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hardik Joshi</string-name>
          <email>joshee@acm.org</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Gujarat University</institution>
          ,
          <addr-line>Ahmedabad</addr-line>
          ,
          <country country="IN">India.</country>
        </aff>
      </contrib-group>
      <fpage>15</fpage>
      <lpage>18</lpage>
      <abstract>
        <p>In today's digital era information access is just a click away. so computer science students also have easy access to all the source codes from different websites thus it has become difficult for academicians to detect source code reuse in students programming assignments. The new trend in the area of source code reuse is using the source code by translating it in another programming language popularly known as cross language plagiarism. Our CLSCR addresses this problem. CLSCR mainly has two components: A compiler that compiles and translates the language specific source code into a tool specific internal format and The Similarity calculator that computes similarity between internal formats of different programs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
      <sec id="sec-1-1">
        <title>Identifying if students programming assignments are their original</title>
        <p>work or have been plagiarized from internet is of sole importance
to the academicians. To address this problem many tools have
been developed till date. Some of the tools are Sherlock, MOSS,</p>
      </sec>
      <sec id="sec-1-2">
        <title>JPLAG etc. All of these tools detect mono language plagiarism</title>
        <sec id="sec-1-2-1">
          <title>Mono language plagiarism:</title>
        </sec>
      </sec>
      <sec id="sec-1-3">
        <title>It is the act of producing source code file from another source</title>
        <p>code file of same language just by doing text edit operation and
not understanding the granularities of the program.</p>
      </sec>
      <sec id="sec-1-4">
        <title>With advance developments and research in the field of information retrieval new techniques of plagiarism have also emerged. One such technique is cross language plagiarism it is a modern and smart way of plagiarism.</title>
      </sec>
      <sec id="sec-1-5">
        <title>Cross language plagiarism comes into picture when students want</title>
        <p>a source code for particular functionality in language A and while
surfing the internet students come across the exact source code for
the functionality but in language B so student decides to plagiarize
by translating syntax of commands on A to syntax of B without
understanding the working of the code.</p>
      </sec>
      <sec id="sec-1-6">
        <title>Our tool CLSCR detects this type of plagiarism CLSCR basically works in 3 phases that are language detection, internal format conversion, similarity computation. All are explained in Section 4. .</title>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. DEFINITION</title>
      <sec id="sec-2-1">
        <title>Cross language source code reuse:</title>
        <sec id="sec-2-1-1">
          <title>Cross language plagiarism is also known as translation plagiarism.</title>
          <p>Let A1 and A2 be two programming languages and A1!=A2.</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>Cross language source code reuse is stated as the translation of a source code P1 € A1 into P2 € A2. .</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. RELATED WORK</title>
    </sec>
    <sec id="sec-4">
      <title>3.1 Tokenization</title>
      <p>
        It is the preprocessing technique that CLSCR performs before its
actual implementation. It is the process of converting the source
code in to tokens. Token is the smallest unit that holds meaning in
a program. Tokens include:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) Identifiers (Variable types, Functions and Labels).
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) Literals.
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) Operators (For example +, -, / etc).
      </p>
      <p>
        (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) Keywords (For example for, While, If etc).
Java
      </p>
      <p>Io</p>
      <p>Class
HelloWorld</p>
      <p>{
Public
Static
.........</p>
    </sec>
    <sec id="sec-5">
      <title>4. DESIGN</title>
      <p>CLSCR mainly works in 3 phases.</p>
      <sec id="sec-5-1">
        <title>Language Detection</title>
      </sec>
      <sec id="sec-5-2">
        <title>Intermediate language generation</title>
      </sec>
      <sec id="sec-5-3">
        <title>Similarity computation</title>
        <p>The tokenized source code file is given as input to phase1. It
detects the programming language of the file by comparing it
with the predefined database consisting of keywords of different
programming languages.
import</p>
        <p>System.out.println
new
extends
........</p>
        <p>As shown in figure 4 the internal format files are in monolingual.
In short CLSCR performs translation of different programming
language source codes to an intermediate language.</p>
        <p>PHASE 3: Similarity Computation
It is the last phase of CLSCR. Phase2 generated internal format
files is then compared to compute similarity.</p>
        <p>This phase uses open source plagiarism detector SHERLOCK for
calculating similarity percentage between internal format files.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>4.1 Sherlock</title>
      <p>SHERLOCK tool allows an instructor to examine a collection of
submitted programs for similarities. Each program is stored as a
single file, and is written using a specific predefined language [1]
Here our predefined language is our internal format. It uses the
concept of runs and anomalies to detect similarity.</p>
      <p>Runs and Anomalies: The Tool defines run as a sequence of
common lines in two files, where the sequence might not be
quite contiguous. There may be a number of extra or deleted
lines interrupting the sequence. The allowable size of
interruptions is called anomalies. Similarity Percentage is
calculated on the basis of length of run and anomalies.</p>
      <p>Sherlock Usage: To use Sherlock we downloaded sherlock.C file
which is available online. Then we compiled sherlock.C to
generate exe file. All files that need to be compared for
plagiarism and the exe file are placed in same folder. Then we
run Sherlock a command-line program to generate result file
containing similarity percentage of the files.
sherlock *.java &gt; results.txt</p>
    </sec>
    <sec id="sec-7">
      <title>5. EXPERIMENTS AND RESULTS</title>
      <sec id="sec-7-1">
        <title>As our initial effort we have just focused on two object oriented</title>
        <p>programming languages C++ and java. but it can be implemented
to detect many other languages. Evaluation of our tool is done
through a data set that is checked for originality and degree of
plagiarism is computed. For testing, the dataset used was collected
from third party organization. Dataset consisted of 1000+ java and</p>
      </sec>
      <sec id="sec-7-2">
        <title>C++ program for now we have tested this tool only on two object oriented languages java and C++.</title>
      </sec>
      <sec id="sec-7-3">
        <title>But with slight modification this tool can be implemented to</title>
        <p>detect plagiarism between many other languages.</p>
      </sec>
      <sec id="sec-7-4">
        <title>After passing all source code files to 3 phases of CLSCR, the results obtains shows the similarity percentage between various files.</title>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>6. IMPROVED EFFECIENCY</title>
      <sec id="sec-8-1">
        <title>CLSCR by default compares all files of C++ folder with java</title>
        <p>folder files. These folders may contain 500+ files resp.</p>
      </sec>
      <sec id="sec-8-2">
        <title>Comparing this large number of files is a tedious task and may take some amount of time. To improve efficiency addition processing phase can be introduced.</title>
      </sec>
      <sec id="sec-8-3">
        <title>Preprocessing phase: This phase is implemented before phase 2.</title>
      </sec>
      <sec id="sec-8-4">
        <title>Before converting the source code into intermediate language,</title>
      </sec>
      <sec id="sec-8-5">
        <title>Attribute comparison among different source codes is performed.</title>
      </sec>
      <sec id="sec-8-6">
        <title>Attributes are general properties of source code files. They include number of classes, number of functions, number of objects, number of constructers, number of variables etc. 17</title>
      </sec>
      <sec id="sec-8-7">
        <title>We have assigned weight to all general properties as per their importance in plagiarism detection. Weight of class = cl Weight of constructor = co</title>
        <p>Weight of function = f
Weight of variable = v
Weight of object = o</p>
      </sec>
      <sec id="sec-8-8">
        <title>Then we calculate weight total of properties</title>
        <p>Weight_total = cl(no of class) + co(no of
constructor) +o(no of object) + v (no of
variable) + f (no of function).</p>
      </sec>
      <sec id="sec-8-9">
        <title>All those files having similar weight total are only compared. As files with large difference in weight total have different properties thus the degree of similarity is very less. Thus they are ignored.</title>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>7. CONCLUSION</title>
      <sec id="sec-9-1">
        <title>A software system that automatically detects cross language</title>
        <p>plagiarism between C++ and java files has been proposed and
presented in this paper. This is basically a desktop application to
detect plagiarism between different language source code files.</p>
      </sec>
      <sec id="sec-9-2">
        <title>Academicians can install the application and by just uploading the collection of assignments of the students can detect the degree of plagiarism between the programs.</title>
      </sec>
      <sec id="sec-9-3">
        <title>The system accepts the .txt, .java, .cpp all extensions of the source code so the overhead of converting the programs to a specific extension is also removed.</title>
      </sec>
      <sec id="sec-9-4">
        <title>The proposed system has potential for becoming the</title>
        <p>comprehensive plagiarism detection system for universities. As</p>
      </sec>
      <sec id="sec-9-5">
        <title>CLSCR being able to detect cross language plagiarism</title>
        <p>additionally can even be used to detect mono language plagiarism.</p>
      </sec>
      <sec id="sec-9-6">
        <title>Although some of the processing of CLSCR would be worthless when in attempt of detecting mono language plagiarism but the result of detection would be accurate.</title>
      </sec>
      <sec id="sec-9-7">
        <title>This software has been tested for large number of programming</title>
        <p>assignments of all categories with accurate results. This system
can efficiently handle huge data set and can be seamlessly
integrated with any learning management system.</p>
      </sec>
      <sec id="sec-9-8">
        <title>This system can overall improve the quality of education imported in different computer science institution.</title>
      </sec>
    </sec>
    <sec id="sec-10">
      <title>8. ACKNOWLEDGEMENTS</title>
      <sec id="sec-10-1">
        <title>We are grateful to Ms Sangeeta Premani for her guidance throughout the design and execution of this task. Finally, we thank FIRE2015 for providing the dataset to test our tool.</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Joy</surname>
            , Mike, and
            <given-names>Michael</given-names>
          </string-name>
          <string-name>
            <surname>Luck</surname>
          </string-name>
          .
          <article-title>"Plagiarism in programming assignments." Education</article-title>
          ,
          <source>IEEE Transactions on 42.2</source>
          (
          <year>1999</year>
          ):
          <fpage>129</fpage>
          -
          <lpage>133</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Đurić</surname>
            , Zoran, and
            <given-names>Dragan</given-names>
          </string-name>
          <string-name>
            <surname>Gašević</surname>
          </string-name>
          .
          <article-title>"A source code similarity system for plagiarism detection." The Computer Journal (</article-title>
          <year>2012</year>
          ):
          <fpage>bxs018</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Jadalla</surname>
            , Ameera, and
            <given-names>Ashraf</given-names>
          </string-name>
          <string-name>
            <surname>Elnagar</surname>
          </string-name>
          .
          <article-title>"PDE4Java: Plagiarism Detection Engine for Java source code: a clustering approach."</article-title>
          <source>International Journal of Business Intelligence and Data Mining 3.2</source>
          (
          <year>2008</year>
          ):
          <fpage>121</fpage>
          -
          <lpage>135</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Juričić</surname>
            , Vedran,
            <given-names>Tereza</given-names>
          </string-name>
          <string-name>
            <surname>Jurić</surname>
            , and
            <given-names>Marija</given-names>
          </string-name>
          <string-name>
            <surname>Tkalec</surname>
          </string-name>
          .
          <article-title>"Performance evaluation of plagiarism detection method based on the intermediate language</article-title>
          .
          <source>"</source>
          (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Gabel</surname>
            , Mark, and
            <given-names>Zhendong</given-names>
          </string-name>
          <string-name>
            <surname>Su</surname>
          </string-name>
          .
          <article-title>"A study of the uniqueness of source code." Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering</article-title>
          .
          <source>ACM</source>
          ,
          <year>2010</year>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Chae</surname>
          </string-name>
          ,
          <string-name>
            <surname>Dong-Kyu</surname>
          </string-name>
          , et al.
          <article-title>"Software plagiarism detection: a graph-based approach</article-title>
          .
          <source>" Proceedings of the 22nd ACM international conference on Conference on information &amp; knowledge management. ACM</source>
          ,
          <year>2013</year>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Flores</surname>
          </string-name>
          ,
          <string-name>
            <surname>Enrique</surname>
          </string-name>
          , et al.
          <article-title>"DeSoCoRe: detecting source code reuse across programming languages." Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstration Session</article-title>
          .
          <source>Association for Computational Linguistics</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Flores</surname>
          </string-name>
          ,
          <string-name>
            <surname>Enrique</surname>
          </string-name>
          , et al.
          <article-title>"Towards the detection of crosslanguage source code reuse."</article-title>
          <source>Natural Language Processing and Information Systems</source>
          . Springer Berlin Heidelberg,
          <year>2011</year>
          .
          <fpage>250</fpage>
          -
          <lpage>253</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Flores</surname>
          </string-name>
          , Enrique, Rosso, Paolo, Moreno, Lidia and VillatoroTello, Esaú: PAN@
          <article-title>FIRE 2015:” Overview of CL-SOCO Track on the Detection of Cross-Language SOurce COde Reuse”</article-title>
          .
          <source>In Proceedings of the Seventh Forum for Information Retrieval Evaluation (FIRE</source>
          <year>2015</year>
          ), Gandhinagar, India,
          <fpage>4</fpage>
          -6
          <string-name>
            <surname>December</surname>
          </string-name>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>