Integration testing for BitCoin



Summary:

In order to exercise the wallet code, integration tests are needed in bitcoinj. In the past, there have been instances where unit tests were not realistic enough and did not simulate real network scenarios, which resulted in bugs. Integration tests should handle re-orgs correctly and update the wallet properly in all cases. A standalone tool that stress-tests the system would also be useful to catch bugs earlier. This tool could randomly generate chains of transactions and could be written using bitcoinj or the raw transaction APIs on bitcoind.Blocktester, a system developed by Matt Corallo, is used for system testing in BitcoinJ. It simulates a peer against a slightly instrumented copy of Bitcoin(d/-qt) and tests complicated network scenarios while boundary testing many rules of the blockchain validation protocol. These tests are run as part of the automated tests on every proposed patch to the reference software, and pulltester comments on GitHub requests and produces logs. Additionally, a public secondary test network called 'testnet' is available to anyone who starts the reference software with testnet=1. Most of the testing work has centered around validating blockchain behavior because it has serious systemic risk, but measuring the JSON-RPC behavior is also interesting.


Updated on: 2023-06-06T14:37:00.274707+00:00