Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tested out Iroh (dynamic analysis tool) #40

Open
wants to merge 2 commits into
base: f24
Choose a base branch
from
Open

Conversation

shinyumh
Copy link

@shinyumh shinyumh commented Oct 24, 2024

Summary

For this PR, I installed and ran Iroh, which is a dynamic analysis tool that provides runtime code tracking and visualization.

Since Iroh is installed via npm install iroh, I added that line into the test.yaml file.

The output of this tool are logs visible when ./nodebb log is ran, so the screenshot below includes an example of me trying out and testing Iroh by creating new messaging rooms (which is where I decided to test out the tool). More specifically, the logs starting from "Program" are the outputs of the tool as it provides runtime code visualization into the structure of the code.

Screenshot 2024-10-24 at 4 56 20 PM

Note: Since the TAs said it is okay to not pass npm run lint since my tool requires using eval(), Github Action workflows fail.

Tool Evalution

Overview + Strengths & Weaknesses

This dynamic tool essentially allows visualization of the code structure and step through of the code. It also allows for some manipulation of functions and performance measurement. The main customization required for this tool is to pass in the string version of the code you want to analyze into the stage. Over time, we can add more listeners to detail the structure of the code if we wanted to. This tool could be helpful in cases of really long and complex code with multiple layers of loops as it would output the structure of the loops without the inside, reducing cognitive load on the reader of the code. The (quantitative) strength of this tool is how easy it is to implement - in just a few lines of code, you can visualize the structure of the code. A weakness of this tool is that it is more of a measurement tool rather than a tool actively catching bugs/errors. It is still up to the programmers to spot code logic errors or performance errors, which means there could be less errors caught (quantitative). Another (qualitative) consideration in using this tool is that when added into the main code logic, it could possibly cluster the file, making it unnecessarily long and hard to read (when just looking at the code file).

Main Use

The problem I am hoping this tool will catch is simplifying chunks of code with complex logic to make it easier for readers and programmers to make sense of the logic of the code and thus making it easier to debug. This particular tool allows interactions with the code (visualization, step-through) and measures performance (how long it takes to load up the page).

Customization

The main customization required for this tool is to pass in the string version of the code you want to analyze into the stage. Then, you can choose which type of functionality you want the tool to perform. Some of the examples of the functionalities are listed here, including code visualization, code step-through, function manipulation, and performance measurement.

Integration

Since this tool is particularly helpful for complex and long blocks of code, I think this can be integrated into the development process as the programmers are working on the code. Whenever there is a code block that is hard to understand, using this tool to log the code structure visually could be helpful in instances where people are trying to understand the code. It could also be helpful in the debugging process as complex codes are incredibly difficult to trace.

Reports

There are no false positives or negatives in this tool, at least within the code structure visualization feature. This tool, if used on simple code, could end up clustering the log with unnecessary reports.

@shinyumh shinyumh changed the title Tested iroh tool (dynamic tool analysis) Tested out Iroh (dynamic analysis tool) Oct 24, 2024
@shinyumh shinyumh self-assigned this Oct 24, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11577039866

Details

  • 13 of 21 (61.9%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.006%) to 82.575%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/messaging/rooms.js 13 21 61.9%
Totals Coverage Status
Change from base Build 11503890424: -0.006%
Covered Lines: 22345
Relevant Lines: 25640

💛 - Coveralls

@bencondemi bencondemi self-requested a review October 30, 2024 23:22
@bencondemi bencondemi added the documentation Improvements or additions to documentation label Oct 30, 2024
@bencondemi bencondemi added this to the Stretch milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants