Software Testing and Verification - Fall 2024
Project Guidelines

Detailed Guidelines of Each Phase:
Project Phase I Project Phase II Project Phase III
Github Classroom Invitation
Backgrounds:
In software testing, paths from Control Flow Graphs (CFG) and Data Flow Graphs (DFG) are commonly used for tasks like test coverage analysis. However, constructing these graphs can be complex and time-consuming due to elements like loops, conditionals, and nested structures. For instance, loops in a CFG can introduce paths that repeat many times, leading to a combinatorial explosion of scenarios to analyze, especially when nested or combined with other conditions. To simplify the process, we will instead extract paths from the Abstract Syntax Tree (AST), which represents the code’s structure without needing to analyze complex runtime behavior. This approach reduces complexity while still capturing the essential idea of traversing a particular code representation.


Overall Description:
In this project, you will implement an AST Path and Path-context Extractor for Java grammar. You will mainly use Tree-sitter — a popular AST parser for multiple languages, and its Python binding to finish the project. The goal is to create a tool that can traverse an AST, extract AST paths, and output in the given format.


Definitions: (Ref: Section4.1)



Implementation Overview:
The project is divided into three stages:
  1. Environment setup and terminal leaf nodes collection.
  2. AST path construction given the two terminal leaf nodes.
  3. AST paths extraction from every two AST nodes of every function within the given code, with feature constraints.
For each phase, we will use GitHub Classroom to submit the code. You will need to complete the code by addressing TODOs given in the template. We will release a detailed guideline for each phase. The functionalities and intentions are explained in the template comments as well. We provide two tests for each project phase. You can modify them as needed. You can run them by executing the main function of each module or using pytest. This is a fast and simple way to check the correctness and functionalities of your implementation. After submitting, we will test your code based on our in-house test cases. The result will be shown as "pass" or "fail", and you can submit repeatedly until the deadline.


Reference and Hints:



Grading:
Phase I: 10% if all tests are passed.
Phase II: 10% if all tests are passed.
Phase III: 10% if all tests are passed + 5% final report.
The percentage contributes to your final grade.