Skip to content

Install iroh#65

Merged
alexbock2 merged 1 commit intomainfrom
iroh-integration
Mar 13, 2026
Merged

Install iroh#65
alexbock2 merged 1 commit intomainfrom
iroh-integration

Conversation

@BAIZIKING
Copy link
Copy Markdown

@BAIZIKING BAIZIKING commented Mar 13, 2026

Installs and integrates maierfelix/Iroh into the repository.

Changelog:

  • install/package.json: adds iroh as a devdependency
  • test/iroh.js: verifies that iroh is working properly by testing on the post endorsement API call

The new tests can be run by running the command
npm test test/iroh.js
The output for running the tests should look like the following:

> nodebb@4.8.0 test
> nyc --reporter=html --reporter=text-summary mocha test/iroh.js



  ...

  3 passing (28ms)


=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================

Pros:

  • Captures execution events (IF branches, function calls, loops, assignments) that standard logging and debuggers don't surface without manual instrumentation.
  • Allows modifying arguments and return statements, which facilitates testing

Cons:

  • Very hard to learn how to use this tool from the existing documentations
  • Hard to use. Have to pass the code as a string to set up a stage.
  • Last commit for Iroh was 9 years ago. Not certain if this tool will work in the future.
  • does not support async functions

@alexbock2 alexbock2 self-assigned this Mar 13, 2026
@alexbock2 alexbock2 self-requested a review March 13, 2026 03:17
Copy link
Copy Markdown

@alexbock2 alexbock2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@alexbock2 alexbock2 merged commit 3fe766c into main Mar 13, 2026
1 check passed
@BAIZIKING
Copy link
Copy Markdown
Author

BAIZIKING commented Mar 19, 2026

Iroh is a dynamic analysis tool used for monitoring the runtime of the code, and manipulating data and program behaviours to facilitate testing. Its website is https://maierfelix.github.io/Iroh/ and its source code is located at https://github.com/maierfelix/Iroh/

Iroh can be used to track the runtime behaviour of code. For example, iroh has API functions that detect if the code enters or leaves an if statement or else statement, or can detect if the code enters another function. Iroh can also be used to intercept and modify data on the fly. Iroh enables programmers to test the runtime behaviour of the code easily, and catch any problems that happen at runtime.

Iroh is highly customisable. It has a lot of API methods, used for detecting different behaviours in the code provided. Such customisation is also necessary because a programmer needs to specify what runtime behaviours to detect. A programmer who wishes to use this tool needs to look over the APIs of this tool and decide which API functions to apply.

This tool does not test the code itself, but it can be used to write better test cases. In a development process, this tool should be used in conjunction with other static or dynamic analysis tools. Detecting runtime behaviour of code is a great addition to what the existing testing tools can detect. For example, in the NodeBB repository, we can write test cases in the tests folder that uses iroh to capture the number of if and else statements reached, every function call, and what the functions return. These test cases would be run by the GitHub CI workflow using mocha, which is a tool that already exists in the repository.

False positives and false negatives don’t really make sense in the case of iroh, as it only monitors the runtime behaviours, and does no testing of the actual code. The programmer needs to decide how to call the API functions of iroh to detect the desired or undesired behaviours in the runtime.

@BAIZIKING BAIZIKING mentioned this pull request Mar 20, 2026
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