DEV Community

Cover image for A Need For Blockchain Testing
Harinder Seera 🇭🇲 for AWS Community Builders

Posted on • Originally published at blog.gsdcouncil.org

A Need For Blockchain Testing

INTRODUCTION

In 2017, David Lo, Zhiyuan WAN, Zin XIA and Liang CAI conducted an empirical study [1] on Blockchain bugs and published their findings in IEEE. They analysed 8 GitHub Blockchain repositories until 2016. They found a total of 946 bugs related to different category such as Memory, Concurrency, Performance, Security, Environment & Configuration and so forth as shown in the table below [1].

Alt Text

Alt Text

This happened in 2017. Consider how many public Blockchain repositories have sprung up since then. What are the chances of such Blockchains being bug-free? It’s quite close to zero. Consider how many Blockchains aren’t hosted on Github. Again, it is assumed that they will have bugs. Unfortunately, because they are not publicly available, no analysis can be performed on them. However, it is safe to assume that the likelihood of flaws in those Blockchains is likewise high.

All this data proves that, like any other application, testing is critical for Blockchain and should not be overlooked. There are many reasons for undertaking Blockchain testing, and in this piece, I will highlight five of them.

1. A New technology

Blockchain technology has been around since 2008, but it was only in 2011 that it became publicly known as Bitcoin’s popularity soared. As a result, it is still a novel and developing technology. Two of the qualities of Blockchain that are being improved are performance and security. These changes need testing.

2. Expanding Blockchain Business Use Cases

Since early 2014, other industries have been integrating and studying Blockchain for their business [2]. The graph below displays the areas where Blockchain technology is being used or evaluated. While essential Blockchain concepts are shared by all businesses, the way they are implemented varies. To properly deploy a Blockchain system, it requires domain knowledge. This needs testing to ensure that the application is both functional and operationally sound for the given use case.
Alt Text

3. Cloning syndrome

Another reason to test is what I label as “Cloning Syndrome.” Most altcoins are clones of early cryptocurrencies such as Bitcoin, Monero, and Ethereum, to mention a few. During the height of crypto-mania, several new altcoins were established without addressing the problems of their predecessors.

These coins have also been reproduced over time. As a result, if the developers did not solve the vulnerabilities in these new altcoins, they accumulated them over time. This may result in a vulnerability in the Blockchains that can be exploited. This problem is especially prevalent on public Blockchains, where anyone can clone existing code. To demonstrate, Peerocoin was forked three times. And one of those forks was forked again thrice. Here’s an example:

Alt Text

4. Regulatory compliance requirements

Implementing a Blockchain that covers multiple nations entails adhering to the rules, regulations, norms, and specifications applicable to those countries. Each country’s laws on how information is stored on the Blockchain may vary. Anti-money laundering (AML) compliance is one of the most significant types of financial rules that Blockchain-based organizations and services must adhere to. Each nation has its own AML compliance standards that must be followed for Blockchain to be compliant.

Also, because blockchain technology is being used in so many different industries, from agriculture to finance to human resources, multiple regulators have a role in how blockchain applications are implemented. All this needs testing.

5. Balancing Cost Vs Functional & Operational Requirements

Setting up private or consortium Blockchains on cloud infrastructure necessitates an awareness of the costs involved. The question of whether operating Blockchain on the cloud and the Return on Investment is justifiable is one that businesses must consider. Particularly if you are establishing Blockchain nodes in different regions of the world, this implies that you will incur data transmission expenses, be subject to regulatory compliance, and have a distinct cost structure across multiple Availability Zones.

Another consideration is selecting the right infrastructure for the Blockchain node. For example, which EC2 instance is best in terms of cost and performance? Should you use Docker containers as your nodes or standalone compute instances? You will need to strike a balance between cost and the right size of the Blockchain infrastructure, which will need testing. You can investigate Blockchain as a managed service, but this will again need testing.

What security measures must be in place to ensure that the infrastructure is fit for purpose if the Blockchain is private? If cost is a consideration, you'll have to further optimize your infrastructure to achieve the required Blockchain throughput. Testing will assist in mitigating these risks.

CONCLUSION

Blockchain has applications in almost every industry and a significant amount of money is being invested in Blockchain development. As a result, it is now more necessary than ever to test the Blockchain applications. The reasons given should help prioritize testing of the Blockchain solutions if it has not already been addressed before.

Next post will focus on some of the tools available for Blockchain testing.

REFERENCES

  1. https://ink.library.smu.edu.sg/cgi/viewcontent.cgi?article=4697&context=sis_research

  2. https://medium.com/fluree/blockchain-for-2018-and-beyond-a-growing-list-of-blockchain-use-cases-37db7c19fb99


Thanks for reading!

If you enjoyed this article feel free to share it on social media 🙂

Say Hello on: Linkedin | Twitter | Polywork

Blogging: Dev | Hashnode

Github: hseera

Discussion (0)