Testing Overview
Tổng quan về kiểm thử trong phát triển giao thức Ethereum
Testing
Ethereum client implementations undergo constant testing on different levels which ensures security and stability of the network. For a decentralized network, ensuring all clients communicate correctly, behave the same way and therefore agree on transaction outcomes as defined by the protocol is indispensable. A difference in a single state transition would cause a network split resulting in finalization failure and many problems for users. To achieve stability, Ethereum clients must undergo rigorous testing against a standardized suite of test cases.
These tests verify adherence to execution and consensus specifications, guaranteeing all clients interpret and execute transactions identically. This rigorous testing also functions as a proactive bug-detection tool that safeguards against network forks (disagreements on the canonical blockchain state).
Resources
Walkthrough
Common test suite
- pytest: Python test framework
- Ethereum Tests: Common tests for all implementations
- Hive: Ethereum end-to-end test harness
Execution layer tests
- Execution Spec Tests: Test cases for execution clients
- FuzzyVM: Differential fuzzer for EVM.
- retesteth: Test generation tool
- EVM lab utilities
- Go evmlab: Evm laboratory inspired by EVMLAB
- Collection of execution APIs
Consensus layer test
Tools for testing chains
- Assertoor: Ethereum Testnet Testing Tool
- Ethereum package: Testnet deployer (Recommended for beginners)