Skip to content
Blockchain Association of Cameroon
BAC-L2-SUB-110Substrate / Polkadot SDKAdvanced

Testing runtime logic

A runtime bug cannot be hot-fixed on a public chain. Testing is therefore not a good practice but a deployment condition.

Level
L2Appchain developer
Duration
4 h
Track
Substrate / Polkadot SDK
Maintainer
Polkadot / Substrate Lead Architect

Learning objectives

  • 01Build a test environment that reproduces chain state
  • 02Cover nominal cases, rejections and boundaries
  • 03Turn an incident into a regression test

Guided lab

Raise the pallet's coverage past the required threshold, rejections and bounds included.

Independent lab

State an invariant property of the pallet and check it against randomly generated inputs.

Security angle

Write the failing test first and the fix second: the only proof a flaw is actually closed.

Assessment

Test suite running in CI, with measured coverage.