Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.55 KB

File metadata and controls

26 lines (23 loc) · 1.55 KB

22 - Testing

Testing or validation is a well-known fundamental software engineering primitive to determine if software produces expected outputs when executed with different chosen inputs.

  1. Smart contract testing has a similar motivation but is arguably more complicated despite their relatively smaller sizes (in lines of code) compared to Web2 software
  2. Smart contract development platforms (Truffle, Embark, Brownie, Waffle, Hardhat etc.) are relatively new with different levels of support for testing
  3. Projects, in general, have very little testing done at the audit stage. Testing integrations and composability with mainnet contracts and state is non-trivial
  4. Test coverage and test cases give a good indication of project maturity and also provide valuable insights to auditors into assumptions/edge-cases for vulnerability assessments
  5. Auditors should expect a high-level of testing and test coverage because this is a must-have software-engineering discipline, especially when smart contracts that are by-design exposed to everyone on the blockchain end up holding assets worth tens of millions of dollars
  6. "Program testing can be used to show the presence of bugs, but never to show their absence!” - E.W. Dijkstra

Slide Screenshot

022.jpg


Slide Text

  • Software Engineering
  • Expected Outputs
  • Chosen Inputs
  • Unit/Functional/Integration/E2E/Smoke
  • Test Cases/Coverage

References


Tags