Blockchain System Testing Flashcards
6 cards from real CBSE practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Blockchain System Testing flashcards as text
A quality assurance team is testing a decentralized finance (DeFi) protocol where a lending smart contract must interact with a separate staking contract to determine correct interest rates. Which type of testing is MOST critical for verifying that a user staking tokens in the second contract correctly updates the available borrowing rates in the first contract?
Answer: Integration Testing
Integration testing is designed to verify the interaction and data flow between different, separate software components. In this scenario, the critical function to test is the communication and state dependency between the lending and staking contracts, which is the primary focus of integration testing.
A development team wants to ensure their new decentralized exchange (DEX) can handle an anticipated launch-day load of 1,000 transactions per second (TPS) without significant delays. Which type of system testing should be prioritized to validate this specific non-functional requirement?
Answer: Performance Testing
Performance testing is used to evaluate how a system behaves under a specific workload, measuring key indicators like transaction throughput (TPS), latency, and stability. This is the correct method to determine if the DEX can meet the 1,000 TPS requirement.
A team is in the final stages of testing their dApp. They require an environment that closely mimics the public mainnet, including unpredictable block times and potential network congestion, to conduct a final public test run without using real assets. Which environment best suits this need?
Answer: A public testnet like Sepolia
Public testnets (like Sepolia for Ethereum) are designed to simulate the real mainnet environment as closely as possible. They are publicly accessible and use valueless test tokens, allowing developers and users to experience real-world network conditions (e.g., latency, congestion) before a mainnet deployment.
What is the primary objective of applying fuzz testing to a smart contract's functions?
Answer: To automatically discover security vulnerabilities by providing unexpected or random data to function inputs.
Fuzz testing, or fuzzing, is an automated testing technique that involves feeding a program invalid, unexpected, or random data to its inputs. The primary goal is to trigger unexpected states or errors, thereby discovering security vulnerabilities like integer overflows, unhandled exceptions, or denial-of-service possibilities that might be missed by standard testing.
When testing a blockchain application, which of the following presents a unique and fundamental challenge not typically encountered when testing traditional, centralized web applications?
Answer: The immutability of deployed on-chain code and the difficulty of patching bugs.
The immutability of the blockchain is a core principle that makes it fundamentally different from traditional systems. Once a smart contract is deployed, its code cannot be easily altered. This makes fixing bugs post-deployment exceptionally difficult and expensive, placing immense importance on thorough pre-deployment testing. Traditional applications, by contrast, can be patched and redeployed with relative ease.
A security auditor is using a tool like Slither to analyze a Solidity smart contract's source code before it is compiled or executed. The tool flags several potential vulnerabilities, including reentrancy risks and uninitialized storage pointers. What type of testing is being performed?
Answer: Static Analysis
Static analysis is the process of examining a program's source code without executing it. Tools like Slither and Mythril perform static analysis on Solidity code to detect known vulnerability patterns, code quality issues, and deviations from best practices, making it a critical step in the security audit process.