Assignment 1 - SVF-tools/Teaching-Software-Verification GitHub Wiki

Assignment-1 folder layout

$tree Assignment-1
├── Assignment-1.cpp
├── Assignment-1.h
├── Test1.cpp
├── CMakeLists.txt
$tree python
├── Assignment-1
   |-- Assignment-1.py

1. Assignment 1 coding task

You can submit C++ or Python version

  • C++ Version:
    • Implement methods printPath and DFS of class GraphTraversal in Assignment-1.cpp.
    • Pass the test without any assertion by Test1.cpp
    • Submit Assignment-1.cpp to canvas. Your implementation will be evaluated against our 10 internal tests. You will get the full marks if your code can pass them all. Unfortunately, our internal tests are private. Here, we only provided one test case in Test1.cpp. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.
  • Python Version:
    • Implement methods printPath and DFS of class GraphTraversal in Assignment-1.py.
    • Pass the test without any assertion by Assignment-1.py.
    • Submit Assignment-1.py to canvas. Your implementation will be evaluated against our 10 internal tests. You will get the full marks if your code can pass them all. Unfortunately, our internal tests are private. Here, we only provided one test case in Assignment-1.py. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.

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

2. Configuration && debugging

1. C++ Version launch.json

You need to set the "program" to be the executable file of Assignment 1, i.e., "${workspaceFolder}/bin/assign-1" in launch.json in order to run and debug

width=800px

2. Python Version launch.json

You need to scroll down to the configurations of Launch Python Script and set the "program" to be the path of Assignment 1, i.e., "${workspaceFolder}/python/Assignment-1/Assignment-1.py"

2. Debug your code

*If there is an assertion or unexpected output, you will need to debug and find bugs.

Step 1: Set the breakpoint where you want to stop your program and press the 'debug' button

width=800px

Step 2: 'Step over' /'Step in' / 'Step out'

  • 'Step over' to the next step of your program
  • 'Step in' to the current line of your program
  • 'Step out' to mainstream of your program where you stepped in before

width=800px

Step 3: During your debugging, you can also watch the value of a variable you are interested in.

Python Debugging is similar to C++, just switch to Launch Python Script.

More information about C++