Skip to content

Conversation

@bryanpyl
Copy link

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:
PDG Assignment 2

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:

  1. Critical Dependency Tracking:
    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
  2. Focused Regression Testing:
    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.
  3. Test Coverage Analysis:
    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
  4. Field-Level Impact Assessment:
    o Shows how field modifications (e.g., visible or dispatch_trigger) impact multiple tests, enabling risk evaluation before changes.
  5. Relationship Integrity Checks:
    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.
  6. Early Detection of Complexity:
    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

@suhadaudd11
Copy link

Very Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants