pendulum-chain/pendulum

Audit: PDM-003 - Test Coverage

Closed this issue · 1 comments

The current test coverage of the orml-currencies-allowance-extension pallet is insufficient, with only 22.22% coverage. Moreover, the implementation of ChainExtension in the runtime lacks any test coverage.

ID PDM-003
Scope Code Quality / Testing
Status New

Description
To evaluate the test coverage, we recommend using the cargo tarpaulin command:

cargo tarpaulin --out Html --output-dir ./tarpaulin-report

Running this command generates an HTML file that provides detailed coverage information for all packages. Specifically, it highlights the orml-currencies-allowance-extension pallet, which currently has a coverage of only 22.22%. Additionally, it reveals the absence of tests for the methods utilized in the runtime to implement ChainExtension , including is_allowed_currency , allowance , do_approve_transfer , and do_transfer_approved , as well as the lack of testing for the overall ChainExtension implementation in the
foucoco runtime.

Recommendation
To address the low test coverage in the orml-currencies-allowance-extension pallet and the lack of test coverage in the runtime implementation of ChainExtension , it is essential to develop a comprehensive test suite. This suite should include thorough testing to ensure the security, stability, and maintainability of the project.
Implementing continuous integration (CI) systems to automate the execution of the test suite is highly recommended. This practice enables the team to identify areas with insufficient test coverage, detect regressions, and uncover areas that require improvement. By incorporating CI into the development workflow, valuable feedback is obtained, ultimately enhancing the overall quality of the codebase.