You are browsing as a guest. Sign up (or log in) to start making projects!

41h 55m 24s logged

Automatic Link Connections Refactor Engine

This engine ensures there is no need for manually refactoring of links that connect the related files across the project. Simply imagining updating hundreds of broken links when a name or folder is change, that is not acceptable.

Also helps reducing the friction when creating connections like thinking the relative path to the file.

This way is avoid the debt of having broken links across the traceability system and friction of connecting files is reduce to 0.

Implementation Details

File mapping
Engineer FileSelectionHelper.js which uses a recursive algorithm that serves as a helper method for data collection using node for file path extraction that works as follows:

  • Extracts the root folder directories and all files paths and names storing them in a data structure.
  • Stores them separately creating a distinction between files and folders.
  • Recursively calls itself to scan the directories stored but before deletes the previously scan directory to ensure the algorithm doesn’t fall in an infinite loop.
  • Stops once there are no more directories to scan.

Connections Mapping
Implement a helper function PathExtractionHelper.js that will take the found files by FileSelectionHelper.js build a map of the artifacts and the files that mention a connection to them.
Algorithm behavior:

  • Loop over all the files of the project
  • Reads the file data an check for a connection mention @trace REQ-001 @
  • If that artifact exist as a key in the data structure it will append the file, and ensure the already stored connections are not lost
  • Otherwise it will append the first file and create the key

Traceability Pipeline Class
To ensure clean code, concern separation and functionality encapsulation I develop a class that contains methods that make possible the traceability engine.
Methods capabilities:

  • Find artifact path in the project folder
  • Classify artifact connections in different areas
  • Build a markdown table with those connections classification and its relative path to the current artifact ready to navigate by a click from any markdown rendering engine (this ensures the builder can easily open and navigate through the artifact related files, probably implementing what the artifact states)
  • Write the markdown table to a specific artifact.md file

Engine execution
Once the separated functionalities are encapsulated in its methods and helpers the engine must be orchestrated to provided the expected behavior for this the AutoLinkRefactorExecutionThread.js ensures the execution works as intended leveraging the tools available to ensure the acceptance criteria expected outcome is fulfilled.

Testing
To ensure system integrity this implementation includes 2 test suits:

  • 6 unit tests for the standalone methods and helpers
  • 1 integration test that ensures that the orchestration of the standalone pieces provide the expected output.
0
1

Comments 0

No comments yet. Be the first!