Home

Awesome

ENRE

NOTICE: We have migrated this repository into a new github organization for ENRE. The new link is xjtu-enre. Now, our ENRE is supporting analyzing multiple programming languages such as JAVA, C++, Python, Golang, JavaScript/TypeScript. Please refer to the new repositories https://github.com/xjtu-enre for more information.

Build Status

ENRE (ENtity Relationship Extractor ) is a tool for extraction of code entity dependencies(relationships) from source code. The resolved dependency types include:

Dependency TypeDescription
Importa File imports a Package, Module, etc.
ImplementA Class implements an Interface.
ExtendA Class inherits a Class.
CallA function/Method calls A Function/method.
UseA Function/Method uses or reads a Variable.
SetA Function/Method uses or reads a Varibale.
ParameterA Funciton/Method has a Class type parameter.
ReturnA Function/Method returns a Class type value.

Features

Basic Feature

ENRE supports analyzing source code written in Python, Go.

Advanced Feature

<font color=blue>New Update!</font>

ENRE has integrated type inference technique and type stub files (one of type hint practices) to enhance the extraction of Possible Dependencies in Python code.

Possible Dependencies are the syntactic dependencies indiscernible in source code due to the lack of explicit type references, in contrast with Explicit Dependencies.

You can learn more about this fresh feature and experience it by diving into the ENRE-v2.0.

Usage

1)Prepare the executable jar

The released jar of ENRE is named as ENRE-v1.0.jar.

2) Set up Java environment

To execute ENRE-v1.0.jar, you should set up JAVA envionment. Please referer to Set up JAVA environment.

3) cmd usage

Now, everthing is already prepared well. Let's use ENRE to analyze source code. The usage command is:

java -jar <executable> <lang> <dir> <include-dir> <project-name>

Example I:

Use ENRE to analyze a demo project "fire" written in Python:

#in linux platform 
$java -jar ENRE-v1.0.jar  python  demo-projects/fire   null  fire   
#in windows platform
$java -jar ENRE-v1.0.jar  python  demo-projects\fire   null  fire 

After analysis, ENRE finally outputs the resovled entities and dependencies in JSON, XML, DOT files in new-generated fire-out/ directory.

Example II:

Use ENRE to analyze a demo project "beego" written in Go:

#in linux platform 
$java -jar ENRE-v1.0.jar  golang  demo-projects/beego   github.com/astaxie/beego  beego  
#in windows platform
$java -jar ENRE-v1.0.jar  golang  demo-projects\beego   github.com/astaxie/beego  beego

After analysis, ENRE finally outputs the resovled entities and dependencies in JSON, XML, DOT files in new-generated beego-out/ directory.

References

You can reference the following papers if you use ENRE or want to learn more about it.

@inproceedings{2020ase-jin,
    title={Exploring the Architectural Impact of Possible Dependencies in Python Software},
	
    author={Jin, Wuxia and Cai, Yuanfang and Kazman, Rick and Zhang, Gang and Zheng, Qinghua and Liu, Ting},
    booktitle={2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE)},
    pages={1--13},
    year={2020},
    organization={IEEE}
    }

@inproceedings{2019icse-jin,
  title={ENRE: a tool framework for extensible eNtity relation extraction},
  
  author={Jin, Wuxia and Cai, Yuanfang and Kazman, Rick and Zheng, Qinghua and Cui, Di and Liu, Ting},
  booktitle={Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings},
  pages={67--70},
  year={2019},
  organization={IEEE Press}
}

ENRE Introduction Video

License

MIT