Finding Alternate Javascript Codes with a Code Repository

E. Hirumuta, T. Kobayashi, N. Atsumi, and K. Agusa (Japan)


Software Engineering, Data Mining, JavaScript, Programming Rules.


JavaScript is used as a client-side language in Web applications. When developers implement JavaScript systems, they must allow for differences among the various environments in which the JavaScript will be executed. We propose a method for finding alternate codes that can absorb environmental dependencies by crawling, gathering, converting, and mining JavaScript code from the Web. We also describe a JavaScript code repository, which can be utilized to find alternate codes. In a JavaScript Program with compatibility, we as sume that alternate codes have a control structure based on conditional branching for object judgment. Our method is based on this assumption and extracts alternate code candidates by using the syntax tree containing the control structure in the JavaScript code repository. Furthermore, we extract programming rules by using data mining in alternate code candidates. These programming rules are the alternate codes. We evaluated the method with various JavaScript code, including frameworks, libraries, and user code gathered from the Web. We extracted 22 programming rules by our method. We found that seven of these programming rules were alternate codes.

Important Links:

Go Back