PDG Graph for Test Script Modification #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressed Issue:
Impact analysis for the modifications done in the test script (add new test cases and functions) to include regression testing, dependencies and field-level validation, and test coverage improvement
Explanation of Graph:

The PDG is divided into 3 categories:
1. Nodes
a. Setup Node (Light Blue): Represents the setUpTestData method, which initializes test data for the Crisis model and related dependencies.
b. Test Nodes (Orange): Represent individual test methods that validate specific functionalities of the Crisis model.
c. Dependency Nodes (Green): Represent the entities and fields in the Crisis model that tests depend on.
d. Impacted Test Node (Red): Marks the modified test case to indicate recent changes or updates made
e. Impacted Dependency Nodes (Yellow): Highlighted fields or dependencies affected changes in the test logic, indicating the ripple effect across tests and database structure
2. Edges
a. Red Edges: Highlight connection between the modified test and its impacted dependencies
b. Gray Edges: Represent neutral dependencies between nodes unaffected by the changes
3. Layer
a. Layer 0 (Setup Layer – Leftmost): Represent the initialization stage which prepares data models and dependencies for the test
b. Layer 1 (Test Layer – Middle): Represent the active test cases validating model behaviours
c. Layer 2 (Dependency Layer – Rightmost): Represent the target of validation such as database fields and model methods tested
Link to code:
https://colab.research.google.com/drive/1H2LlASjWZ6g30mKSrdTkTiQdzCgdUCNl?usp=sharing
Impacts or insights gained from the analysis:
o Highlights dependencies between setup methods and test cases, helping developers identify affected tests when fields or models change
o E.g., the edge between setUpTestData → visible field highlights that any change to the visible field affects tests like test_default_values and test_visibility
o Enables targeted test execution by isolating tests impacted by specific changes, saving time and resources.
o E.g, the change in the dispatch_trigger field affects test_default_values and test_dispatch_trigger. Developers can quickly identify and rerun these tests to validate functionality.
o Reveals gaps in test coverage, ensuring all fields and relationships are tested for reliability.
o Unconnected nodes in the graph may indicate untested fields or features to reveal gaps in test coverage
o Shows how field modifications (e.g., visible or dispatch_trigger) impact multiple tests, enabling risk evaluation before changes.
o Validates many-to-many relationships, ensuring schema changes do not break dependent tests.
o E.g., changes in owner relationships impact test_owner_relation and setUpTestData . This ensures relationship integrity during database migrations or schema alterations.
o The PDG highlights highly coupled fields, signaling areas needing extra validation or refactoring to reduce complexity.
o E.g., the dispatch_trigger field connects to setUpTestData, test_default_values, and test_dispatch_trigger. This indicates that changes to dispatch_trigger may require extensive updates to multiple tests.
Name: Bryan Phang Yik Loong
Matric number: U2102738
To be reviewed by @suhadaudd11