Skip to content

Assignment 2 Joanne Lim Zi Xuan#11

Open
Joanne1228-coder wants to merge 1 commit intodevfrom
assignment2_JoanneLimZiXuan
Open

Assignment 2 Joanne Lim Zi Xuan#11
Joanne1228-coder wants to merge 1 commit intodevfrom
assignment2_JoanneLimZiXuan

Conversation

@Joanne1228-coder
Copy link
Collaborator

The addressed component/module/part of the system
The addressed module is the Dependency module, specifically the gen_requirements_all.py. This module is designed to automate the management, generation, and validation of project dependencies. It ensures that integration requirements are correctly documented, pinned to specific versions, and consistent across development, testing, and production environments.

I did the orchestration of code, involving the main function and its control flow for validation or synchronization. Besides, data is aggregated through the centralization of the generation logic into a dictionary named "outputs" within the main function. While the internal implementation of functions like gather_recursive_requirements was improved to prevent infinite recursion and fix sorting, the high-level Program Dependency Graph (PDG) follows the same structural logic as the original, with a more streamlined data aggregation step at S7.

The Program Dependency Graph and Explanation
SME PDG Before

Node
S1: Determine Execution Mode (sys.argv.parse) acts as a Master Controller. Since S1 has control dependencies over every processing node (S2–S7) and the final execution node (S8), any change to how the script parses arguments or determines its mode directly impacts whether files are validated or written to disk.

S2: Collect Module Requirements (gather_modules) is the Primary Data Source. As S2 is a critical data producer, any logic changes in how modules are scanned or filtered will automatically impact the formatting of global requirements (S4) and test-specific requirements (S5), which depend on this data.

S7: Aggregate File Mapping (main.files_list) being the Convergence Point, serves as a central data sink, collecting information from S3, S4, S5, and S6. Adding support for a new requirement file requires modifying this aggregation point to ensure the data reaches the final execution phase (S8).

S8: Sync or Validate Files (diff_file or write_text) plays the role of a I/O Gatekeeper because S8 has a dual dependency, which are the control dependency from S1 (telling it what to do) and the data dependency from S7 (giving it the content to process). Failure at this node results in either outdated requirement files on disk or failed CI validation.

The impact or insights gained from the analysis
a. Logic Isolation: The script effectively isolates data collection (S2, S3, S6) from data formatting (S4, S5). This modularity allows developers to change how requirements are extracted without necessarily changing how the .txt files are styled.

b. Bottleneck Identification: S7 is identified as the primary data bottleneck. Because all file contents flow through this single mapping before reaching S8, it is the most critical point for ensuring data integrity before file I/O occurs.

c. Execution Safety: The control dependency from S1 to S8 ensures that the script never writes to files (sync) unless explicitly instructed, providing a safeguard when running in validation mode during CI processes.

d. Transitive Complexity: The recursive nature of S6 (gather_recursive_requirements) introduces a hidden layer of complexity. While it appears as a single node, it pulls from multiple external integration manifests, meaning the stability of the final constraints file is dependent on the correctness of every individual component manifest.

Refactor requirements generation script by improving function definitions, error handling, and output generation. Consolidate logic for gathering requirements and ensure proper validation.
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.

2 participants