Blockchain technology is hot recently, most articles are popularizing the concept of blockchain. Blockchain is likely to be the underlying technology for connected applications in the next decade, in projects across a wide range of industries. For example: commodity traceability, traditional traceability system uses centralized data storage data, in fact, such data for the holder, how to modify, how to modify, then how much credibility of its data? There have even been cases of bank depositors’ money disappearing. Since blockchain will be easy to use in all kinds of systems, QA students of course need to know how to measure blockchain. In this article, we have sorted out the relevant content of blockchain test.

1

background

Review of blockchain features:

● Disintermediated/centralized trust.

● Stability, reliability, continuity. Because it is a distributed network architecture, no central node can be attacked or attacked, so it has stronger stability, reliability and continuity in the overall technical layout.

● Strong security, consensus mechanism does not require the entry of a third party, but through a technology, a previously scheduled technology to achieve the completion of the entire transaction.

● Transparency and untampering of transactions.

In short: decentralized, immutable, full ledger open to all nodes, continuously traceable account information, peer-to-peer, no God (system administrator, etc.).

2

Technical reserves

2.1 Difficulties in blockchain testing

Blockchain testing differs greatly from traditional software testing in the following aspects:

● Fuzzy system boundary

Traditional software, whether standalone applications or client/server applications, has clear system boundaries and can be tested through the UI user interface or client. The bottom layer of blockchain is a completely decentralized distributed network. The network can span multiple subnets, data centers, carriers, and even countries, with blurred boundaries. The testing of the underlying blockchain is not only between the front-end API and a blockchain node, but also involves a large number of blockchain node to node tests.

● Complex fault type

General software faults include three types: a. Crash Failure; B. Crash-recovery Failures; C. Byzantine Failures.

Byzantine failures, derived from the well-known “Byzantine general problem,” refer to malicious nodes in a system that, to use a figurative metaphor, “renegade Byzantine generals.” Such nodes, viewed from different observers, exhibit inconsistent symptoms, which often lead to system service failure in systems requiring consensus.

Software needs to deal with the first two types of failures at most, whereas blockchain systems need to deal with all of them at the same time to ensure the system runs reliably.

● Different types of blockchain

Blockchain itself contains a variety of types, such as public chain, private chain and alliance chain. Different types have different characteristics of the platform, such as management, user identity and maximum number of nodes. Evaluation needs to consider all modes, resulting in more complex test schemes. (Table below)

2.2 Test site considerations

According to the current white paper published by the industry, the evaluation criteria of blockchain include:

The technical requirements

Blockchain-related landing systems may also include testing of traditional architecture software that we are familiar with. For example, in the bandwidth sharing and cloud sharing of some previous manufacturers, there will also be an independent APP to support online query management, etc. For the underlying test of blockchain, the following technologies need to be mastered:

1. First of all, master the basic knowledge of cryptography (such as symmetric encryption, asymmetric encryption, digital signature principle);

2. Understand the concept of linked list and tree in data structure;

3. Transaction accounting model of blockchain (how to realize transfer, how to avoid double spending, and how to realize ownership verification);

4. If it’s based on Ethereum code, you need to understand how virtual machines work;

The blockchain project focuses on the following tests:

1. Transfer to single/multi-signed address and script;

2. If the mechanism of the coin is modified, double-flower attack test;

3. Smart contract function and security test;

4. Efficiency of packaging and transaction confirmation.

In fact, any software test can be based on the “input-output-behavior” model (also known as IBO model) to do test analysis and design.

3

Business scenarios and performance tests

3.1 Service Scenarios

Taking financial business as an example, it is usually divided into implementation business and non-real-time business. The characteristics of the two kinds of business are as follows:

1. Real-time service: second payment, private chain, no single point of failure and high scalability;

2. Non-real-time business: decentralization, alliance chain, tamper-proof, zero data loss;

The details are as follows:

3.2 Some thoughts on performance testing

For the performance evaluation part, we mainly focus on four indicators:

For different performance indicators, a few thoughts:

● Latency: P2P systems are all virtual links, and the actual route may be different each time.

● Consensus rate: set some nodes in the system, deliberately tamper with the release of false data, to see whether it is successful.

● Throughput: Checks the miner’s efficiency, which is the number of effective transactions per second across the system.

● In current performance measurement, it is common to talk about transactions per second (TPS) regardless of network size and block size.

A. In practice, the larger the network scale, the more nodes need to reach consensus, and the slower the consensus progress, the lower the throughput (TPS);

B. The larger the block, the greater the scalability, the throughput may jitter, the probability is low.

4

conclusion

At present, there will be differences in the test content of blockchain for different industries in the short term, but it will eventually converge and unify. In terms of testing methods, it will gradually shift from manual testing to automatic testing over time, with peripheral functions going deep into the bottom layer.

Source: Qtest the Way

Author: Gao Xuewen

Recommendation of offline activities

Technical workshop | decryption code logic block chain DApp, from the request to the data store is going to have? (Shanghai)

Technique salon use IPFS |, decentralized storage how to make the wallet safer? (nanjing)