5 Top Techniques for Testing Blockchain appsTejas Joshi
Listen on the go!
The global blockchain market is expected to grow from USD 212.12 million 2016 to USD 8,682.82 million by the end of 2024, at a Compound Annual Growth Rate (CAGR) of 59.04% – ResearchAndMarkets.com
90% of major North American and European banks are exploring blockchain solutions – Accenture survey
Brief about Blockchain
The world these days is about virtual, digital and cryptocurrencies in different shapes and sizes (read as rates and valuation respectively) that heavily rely on technology. The most commonly heard buzz is “Bitcoin” whose size and shape has been going through the roof.
Fundamentally, Blockchain is easy to understand but things start to look different once you start digging deep. An apparent simple way to understand Blockchain is – “Block” – a real-time ledger record with encryption and timestamp; and “chain” – increasing list of records with a link to the previous block. A blockchain is thus a decentralized database of blocks within a huge network of distributed ledger, which keeps a track of size and shape of the underlying currency along with real-time access for sharing, mining and flow of payments through a supply chain.
Lest it gets complicated, here’s a simple example –
- John wants to send some cryptocurrency to Susan.
- John makes a request for the same (here a block is created) through a wallet or other available means.
- This request is then broadcasted within the huge network (containing decentralized ledger) for approval.
- Network approves the transaction (after the essential checks).
- The approved transaction (block) gets appended in the “chain”.
- Susan gets the cryptocurrency credited in her wallet.
This series of activities is not under the control of a single person or an organization. It is open, secure, transparent and driven by everyone as everyone in the chain can see the associated details of a block in real-time. Only the owner of the block can access/edit the block through a unique private key (which is with the owner only). All the events in the process mentioned above are reflected, updated and synced in the entire network in real-time.
Why testing plays an important role in blockchain?
As of today, BFSI and Automotive sectors are making the most of blockchain because of the secure and encrypted structure that the technology offers; especially with the associated currencies such as Bitcoin, Ethereum, Dash, etc.
Considering the stats mentioned above along with the basic nature of blockchain applications, it is evident that blockchain testing and testers are going to play a crucial role in the overall growth and sustenance of blockchain.
From a technology standpoint, the entire process of blockchain needs to be thoroughly tested as any discrepancies found in one block or in the supply chain can potentially disrupt the entire blockchain. When a block is added to a blockchain, it remains there forever. Any changes to a block in the chain will make the associated blocks in the chain unacceptable or invalid. On the same lines, any updates by the owner of the block to one or more blocks in the chain will have a significant impact on the associated blocks in the chain, which needs a simultaneous update or fix. Any such change can’t be parked or done later which makes it even more difficult/complex in terms of testing.
Testing the applications built on blockchain can be complicated as not all blockchain technologies are open-source. Some banking sector companies use private blockchain which offers more privacy controls at the detriment of security and a hybrid of cloud computing and blockchain rolled into one.
5 Top Techniques for Testing in Blockchain apps
With rapid changes to the technology suite, the idea of “specialized testing” is gaining more popularity. This kind of testing requires specific skills and a blend of technical and domain understanding. Having said that, the traditional or the most used common testing techniques still hold true to blockchain testing.
Let’s look at the top 5 testing techniques.
- Functional Testing: Functional testing plays a crucial role in blockchain testing as it helps to assess the business circumstances, processes and effectiveness of use-case scenarios. Some of the important components that tested as a part of functional testing are:a) Block Size: As stated earlier, a block contains real-time ledger record with encryption and timestamp. These are groups of transactions which are confirmed and are then shared on bitcoin’s public ledger (which is the blockchain). There is a lot of debate happening over the size of the block as the more size/transactions get attached to a block, the complexity of testing goes up. Most miners would love to have bigger block sizes (for obvious reasons) while the users and developers on the other hand are looking for better compression algorithms to fit the contents in the defined block size. Traditionally, blocks could carry up to 36MB (each) of transaction data but this soon introduced threats of spam and other service denial issues on the internet. The block size was thus reduced and fixed (apparently unanimously) to 1 MB apiece. With changing complexities, underlying technologies and the ability to have multiple transactions inside a single block are pushing this limit to maximum. The testers are now focusing on multiple questions such as – what if the transaction size goes over 1MB, what tests should be considered if there are multiple transactions in a block, what are the encryption rules associated and many more of such complex scenarios.Chain size – The chain size practically can be many blocks as the chain lengthens. Testers ensure that chains are not broken at the time of testing and complete record of every value transfer that has happened is tested under possible scenarios.
b) Data transmission: Testing around data loss during transmission is carried out in this phase as the peer-to-peer architecture of blockchain deals with data encryption at source and decryption at the receiving end. Testing for transmission ensures minimum data loss, improved process workflows between peers and provides a scope for identifying integration possibilities.
c) Adding a block: Testers validate all the blocks that get added to the chain post authentication of every transaction. Since the chain cannot be altered and the block which gets added can never be changed, testing at this juncture is very crucial.
- Integration Testing: Is important from the perspective of different systems being cohesive. The deployment could be across several environments/systems running in parallel and ensuring that several component interfaces talk to each other seamlessly becomes important. A detailed view of all the touchpoints and the Application Programming Interfaces (APIs) are tested by the testing team to ensure that appropriate interfaces can be exercised during the validation phases.
- Non-functional Testing (Performance): Performance testing in blockchain is important from the point of view of number of transactions and transaction size being tested for performance of a block or an application being made ready to be deployed to production. Testing team also focuses on other important and dependent parameters such as network latency, performance bottlenecks, sequence of transactions at every node, dependency on production environment, transaction processing speed, client/user and system interface along with the responses required from the smart contracts. Since there could be multiple end points with compound testing, the end-to-end scenarios are considered for overall performance which in most of the cases leads to an automated performance testing for the overall scalability of the blockchain ecosystem.
- Non-functional Testing (Security): The primary focus here is to ensure that blockchain applications are tested thoroughly to check if they are vulnerable to attacks (malicious, virus, etc.), if the authorization systems are robust and if the authentications (including the accesses) are genuine. Security testing also considers the other important aspects such as confidentiality, integrity, non-denial of services, Consistency/Availability and collisions. Security testing becomes important in the event of hacking of identity layer which may lead to transitions being exposed. Transaction which are in progress can’t be stopped immediately hence security testing needs to be effective to uncover all such potential identity layer hacks. Some of the other challenges associated with security testing include – wallet signature methods, private keys, secure hash, consensus algorithm, application platform dependencies, etc. A defined verification and validation approach helps to deal with most of such inconsistencies.
- Application Programming Interface (API) Testing: This type of testing reports about the communication and interactions of applications that happen to and fro within the system. Testers here validate the external responses that the application receives, ensures that the formats for the API request are correct and valid. Within blockchain, there is also a similar type of technology to APIs that allows a similar approach for testing APIs; called as smart contracts. Some of the popular API testing tools are – Postman and SoapUI.
In one of the conversations between Bill Gates (Co-founder of Microsoft), Charlie Munger (Vice chairman of Berkshire Hathaway) and Warren Buffett (American business magnate, investor and Chairman and CEO of Berkshire Hathaway), spectators got the mix of uncertainty, popularity and potential about bitcoin and blockchain in one sentences each by the three veterans. Here’s how it went.
Bill Gates: “Bitcoin is a techno tour de force.”
Charlie Munger: “I think it’s rat poison.”
Warren Buffett: “I think either Charlie or Bill is right.”
Understanding the current application and implementation of Blockchain is important, as it will help determine the growth path and probable challenges with the technology.
At Cigniti, we are well in sync with the key trends that will add up to the need for adopting Blockchain technology. Connect with us to get interesting insights for your business in terms of Blockchain implementation and testing.