本仓库的使命已完成,请移步官方Tai-e教程:
仓库:https://github.com/pascal-lab/Tai-e-assignments
官方网站:http://tai-e.pascal-lab.net
知乎帖子:https://zhuanlan.zhihu.com/p/488957195
本仓库是早期作业的参考实现...
Welcome to add the program analysis tool development group (QR code expires, refer to issue #4)
https://canliture.github.io/imgs/group.jpg
This is the unofficial implementation of the experimental homework of the software analysis course of Nanjing University
Note: Bamboo is not open source for coursework at Nanjing University, so why does it have this warehouse?
- I gave the PDF course for my homework, and the API was also given; according to the API, I could basically do it based on my own understanding.
Current status
- Haven't undergone a lot of testing yet (at least, the examples in Lecture are OK)
- The fifth assignment is just a short time to fill in the blanks of the last obj/type-sensitive code
- Hope to raise bug/issue
最近挺忙的,先停更1/2个月吧.相信这份代码仍然能够给人一些帮助.(2021-11-08)
environment
- Java 8
- Soot 4.2.1
- IntelliJ IDEA
- Maven build/Junit test
document
- docs/org is the original topic of the Nanyang University course.
- docs/soot is soot reference material
- src/main/java/com/canliture/soot/The jobs in each subdirectory have a README as a simple description of the job
Code
- com.canliture.soot.ass1
- Code implementation for the first job
- Constant propagation
- com.canliture.soot.ass2
- Code implementation for the second job
- Constant propagation + activity detection applied to dead code elimination
- com.canliture.soot.ass3
- Code implementation for the third job
- CHA is used to construct call graphs
- com.canliture.soot.ass4
- Code implementation of the fourth job
- Flow-insensitive pointer analysis
- com.canliture.soot.ass5
- Code implementation of the fifth job
- Flow-sensitive pointer analysis
test
Code to run unit tests: src/test/java/ directory
- com.canliture.soot.ass{n}
Tested code: src/test/testcodes/ass/*
Debugging and running
When using IntelliJ IDEA, mark the directory src/test/testcodes/ass as Test sources root
- This will automatically compile the tested code to the target/test-classes directory during debugging/running, making it easier to test
Take ass1's debugging/running test as an example
- Find the com.canliture.soot.ass1.IntraConstantPropagationTest class and run the Junit test
- Each test class has a getTransformer() method, and the internalTransform method of the returned Transformer is the entrance to analysis.
How to run the entire test, you can check the InterBaseTest and IntraBaseTest classes, here encapsulate a small test framework
- @Before Configure Soot before testing
- @Test Execute test code
- @After output Jimple IR to sootOutput directory
