14 tests we need to test in a Blockchain – InterestingData
A bit of Bitcoin — Almost everyone might have heard of the crypto currency — Bitcoin which has seen a tremendous growth and movement. A research by the University of Cambridge estimates that in 2017, there were 2.9 to 5.8 million unique users using a crypto currency wallet, most of them using Bitcoin, think about how many users might have been added since then!
Okay what about blockchain — Block chain is the technology on which Bitcoin is built on. The first blockchain was conceptualized by Satoshi Nakamoto in 2008 which was implemented the following year by Nakamoto as a core component of the crypto currency bitcoin. Since then, Blockchain has been gaining popularity and has become a buzzword.
Blockchain has been well-received by the industry. IBM has opened a blockchain innovation research centre in Singapore in July 2016. Whereas Industry trade groups joined to create the “Global Blockchain Forum” in 2016. Not only the industry but world’s major universities have started courses in Crypto currencies and Blockchain (Stanford University, Cornell University, University of Pennsylvania, USA; source: Bitcoin Australia), isn’t it interesting!
With the rise of popularity and application of Blockchain technology, testing of Blockchain is also coming up and industry experts believe that it has a potential of becoming a “Hot cake” in the coming years. Who doesn’t want to eat it!
- Block Size: The maximum fixed limit of a block is 1 megabyte. After the introduction of bitcoin, the average size of a block for the first 18 months came out to be under 30 KB. But in December 2017, it hovered around 1 MB. What if the size of a block exceeds beyond 1 MB? Well, this is yet to be decided how the blocks above 1 MB pan out.
- Chain Size: There is no limit on the size of the chain. So it is fun to test it for its function and performance. For example, the bitcoin chain’s size keeps on increasing day by day. If you want to know the current chain size, just hit here (it’s almost 538950 when I am writing this).
- Smart Contract testing: Smart Contracts are software modules on the blockchain that automatically execute transactions based on pre-defined conditions and business logic. Testing smart contracts involves simulation of all possible expected and unexpected conditions for every contract, testing all combinations of business logic and the proper triggering and correct execution of transactions. And all of these in the context of a dynamically changing and expanding network. Given the sheer number of nodes and combinations that are likely, automation of testing becomes an important need.
- Load: With so many people on the blockchain, load becomes a major parameter to test in a blockchain. Let’s take an example of bitcoin. It currently has a maximum throughput of 3–4 transactions per second but what if the transaction/second increases as in case of Visa (2000), PayPal (193), etc. Hence load remains the major problem with blockchain as its performance drops when load increases.
- Security: Since there are many miners involved with a transaction, ensuring security is a little complex. Well, there is a multi-layered security system in a blockchain. If one of the layers have been hacked, the instantaneous transactions cannot be stopped. It is therefore to be tested that one security layer doesn’t affect the other.
- Transmission of data: Encrypted and decrypted data is transferred from computer to computer so it is necessary to test if the transmission process is working flawlessly. Is the data being sent received on the other end or there is a loss in between. So it becomes necessary to make sure that the data is not lost.
- Addition of block: Every new block is added to the chain once the transaction’s validity is authenticated. So it must be tested that there should not be any leak in the block addition system and the block must be added after authentication.
- Peer/Node testing: The strength of the blockchain lies in having the shared ledger be exactly the same at each and every node, with the same set and sequence of transactions. This is achieved through consensus across all nodes on the order in which transactions are added to the network. Testing for consistency of transactions involves testing the consensus protocol to ensure transactions are stored in the proper sequence under normal conditions as well as in cases where nodes fail concurrently or enough nodes do not participate in the network for a period of time. One way to test this would be by simulating Byzantine nodes. Resiliency also needs to be tested by validating the ledger after nodes that restarted or re-joined the network sync with other validating peers
- Crypto graphical data: Cryptography is the backbone of blockchain technology. So, it is necessary to make sure that the data is properly encrypted and decrypted.
- API Testing: Depending on the application, API testing needs to address the interaction of applications into and out of the blockchain ecosystem. Because a blockchain can emit events, external calls or events from external systems can trigger blockchain activity. Consider a transaction submitted to an API. The transaction must be validated against specific rules to generate an update order which the blockchain then distributes. The API then receives a confirmation that the blockchain has been updated. Testers must validate the interaction of applications into and out of the blockchain ecosystem at every process step to validate that API requests and responses are formatted and handled correctly.
- Collisions: We covered this up in Chain Size, where it should be possible to duplicate through automation to get the timing right, so you can ensure that the proper behaviour occurs for 2 blocks that want to simultaneously get added.
- Consistency/Availability: When the chain’s end is not available, again so you can ensure that the proper behaviour occurs. Some limbo location until it can be processed? A split in the chain? A juggling act where the new one gets added to the last accessible block and the orphaned inaccessible block gets added back in later?
- Data corruption: What happens to the data in a block if a block gets corrupted? Is there a way to repair the block? Can the chain past the damaged block be reached? How do you fix transaction typos?
- Database handling: How is your tracking set to deal with unusual cases in supply chain management? What if something is damaged or goes missing? What if an item becomes 2 items (like a diamond that gets split)? What about 2 items becoming one (two 2-packs get damaged and the undamaged halves get combined into a new 2-pack)?
What is Blokchain technology
How Blockchain eliminates these problems
Types of blockchains
list of terms you’ll need to get a better understanding of the article.
need for testing in a Blockchain
14 tests we need to test in a Blockchain
Blockchain testing frameworks
simple Test strategy highlighting key activities across the test phases
Don’t miss my other testing articles on the contemporary technologies which might be helpful to gain new insights:
40 Most Useful Chrome extensions for Website Testing — http://www.softwaretestingportal.com/2020/01/28/40-most-useful-chrome-extensions-for-website-testing/
Big Data Testing Tutorial | A Tester Guide — http://www.softwaretestingportal.com/2019/12/07/big-data-testing-tutorial-test-strategy-and-more/
Salesforce Testing Tutorial: A Beginners Guide — http://www.softwaretestingportal.com/2020/01/02/salesforce-testing-tutorial-a-beginners-guide/
30 minutes IoT Testing tutorial for beginners — http://www.softwaretestingportal.com/2018/09/11/30-minutes-iot-testing-tutorial-for-beginners/
Published at Tue, 04 Feb 2020 23:12:30 +0000
{flickr|100|campaign}
