Skip to content

Assignment 2

guanqin-123 edited this page Mar 27, 2023 · 6 revisions

Assignment-2 folder layout

$tree Assignment-2
├── Assignment-2.cpp
├── Assignment-2.h
├── CMakeLists.txt
├── Test2.cpp
└── testcase
    ├── bc
    │   ├── test1.ll
    │   └── test2.ll
    ├── dot
    │   ├── icfg_test1.dot
    │   └── icfg_test2.dot
    └── src
        ├── test1.c
        └── test2.c

1. Get the latest assignment-2 code template

* Before coding, please type cd $HOME/Teaching-Software-Verification and git pull in your terminal to make sure you always have the latest version of the code template before each assignment.

If git pull fails due to the conflict with your local changes, type git stash to store your current code in a temporal branch and type git pull again. If you want to retrieve your code back, type git stash pop.

Make sure to switch your program to assign-2 before coding.

2. Assignment 2 task

  1. Implement dfs, printICFGPath methods of class ICFGTraversal in Assignment-2.cpp
  2. Pass the test without any assertion by Test2.cpp.
  3. Submit Assignment-2.cpp to canvas. Your implementation will be evaluated against our 10 internal tests. You will get full marks if your code can pass them all. Unfortunately, our internal tests are publicly unavailable. Here, we only provided limited test cases in Test2.cpp. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.

*You will be working on Assignment-2.cpp only and there is NO need to modify other files under the Assignment-2 folder

SVF APIs to help with your implementation SVF CPP API.

3. Debug and visualize ICFG

Visualize ICFG by following here

We have also provided two test cases testcase/src/test1.c and testcase/src/test2.c and their corresponding LLVM bc files. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.