Software Testing

Blockchain Testing Tools

By Test Guild
  • Share:
Join the Guild for FREE

I’m not a blockchain expert myself, but after speaking with Rhian Lewis about blockchain Application Testing, I’d like to share some info that I’ve found helpful.

Before we look at some testing tools, let’s make sure that we are all on the same page with what blockchain is.

What is Blockchain? 

Most folks know blockchain as the protocol that underpins Bitcoin, but it’s much more than that. You can essentially think of it as an “appends only” digital ledger—similar to a shared spreadsheet record.

It’s basically a data structure which exists in many different places at once and which is very difficult to make amendments to because you can't ever delete from it. You can only add to it.

This is a cool feature because it exchanges its central power structure model for a decentralized network of independent record keepers.

This approach minimizes the possibility of an unauthorized person being able to manipulate records. In turn, this makes the record more secure, giving users more confidence in the digital data that is in the blockchain.

How Do You Test Blockchain Applications?

Rhian and I agree that it’s really not much different from any other application you would test. The same logic and critical thinking you already use for testing non-blockchain projects still apply.

Of course, the individuals working on blockchain applications need to possess amazing mathematical and cryptographic skills, but when it comes down to it most of the work that's being done is just normal development work with normal testing criteria.

Many of the testing techniques you already know, like testing at the boundary, performance testing, compliance and especially security testing, apply to blockchain. Sometimes its just a matter of getting familiar with some of the common blockchain testing tools that are already out there.

Blockchain Testing Tools

During my interview with her, Rhian mentioned that in terms of hands-on testing, there are some pretty good tools and frameworks being developed that can help with both development and testing.

I went looking for some of these blockchain testing tools, and this is what I found:

Ethereum

Ethereum is the best-known blockchain (other than Bitcoin), and it has some great frameworks for developing applications, many of which have libraries baked in to make testing fairly easy.

Ethereum Tester

Simply put, Ethereum Tester provides tools for testing Ethereum-based applications.

Truffle

Truffle bills itself as the most popular Ethereum development framework, and based on its 4,288 stars on GitHub it, clearly is popular.

It’s a development framework that has testing functionality, like the ability to write automated tests for your contracts in both JavaScript and Solidity and get your contracts developed quickly. It also works with popular test runners like Mocha and Chai.

Ganache (formally Testrpc)

Before you release your blockchain application to production, it’s important that you test it locally.

Ganache is the most-used library for testing Ethereum contracts locally. It works by spinning up a kind of mock blockchain that gives you access to accounts you can use for testing.

Rhian doesn’t feel that it conveys the same latency you get on a live system, doesn't really replicate real-world scenarios for the time things take and so on. But it's enough to let you compile a contract, deploy it, determine its cost, and debug it locally.

Populus

For testers who prefer Python, the Populus framework provides some powerful utilities for testing blockchain contracts. Testing in Populus is powered by the Python testing framework py.test.

Manticore

Manticore is a symbolic execution tool for analysis of binaries and smart contracts. Manticore enables human-assisted analysis and the automatic detection of vulnerabilities.

Hyperledger Composer

Hyperledger Composer is an open-source development tool that contains many functions to help build blockchain applications. Some of those features also help with testing. More specifically, it supports three types of testing: interactive testing, automated unit testing and automated system testing.

It has a command-line interface that provides commands allowing you to easily run interactive “smoke tests” to ensure the deployment was successful. This also makes it easy to execute tests in a CI/D system.

System tests can also be created using Docker Compose and Mocha/Chai. You can start a runtime and deploy your business network definition, then programmatically create assets, submit transactions and inspect the state of asset registries.

Exonum Testkit

Testkit for Exonum Blockchain is a framework that allows you to test the operation of the whole service. Specifically, it allows you to test transaction execution and APIs in the synchronous environment (without consensus algorithm) and in the same system process.

Embark Framework

Embark is another popular framework for building, testing and deploying your app. It’s a framework that allows you to easily develop and deploy decentralized applications (DApps).

Corda Testing Tools

Corda is a blockchain-inspired, open-source distributed ledger platform. It has a built-in testing feature to help with:

blockchain testing tools

BitcoinJ

BitcoinJ is a library for working with the Bitcoin protocol. It allows you to interact with Bitcoin and connect directly to the Bitcoin network. And by using the functions in this library, we can send and receive Bitcoins in real time.

The BitcoinJ documentation says it can maintain a wallet, send/receive transactions without needing a local copy of Bitcoin Core, along with many other advanced features. It's implemented in Java but can be used from any JVM-compatible language; examples in Python and JavaScript are included.

For testing, BitcoinJ provides a TestUtils class that can do things like manufacture fake transaction objects and so on.

For ideas on how to take advantage of TestUtils, take a look at the test suite for BitcoinJ itself.

Testers get Started with Blockchain

Many of these testing activities are currently being done by developers doing their own testing. This is awesome, but as blockchain gains popularity, testers will need to start getting involved as well.

It's simply a matter of making a small leap of faith into a technology that is completely different than what you may have tested in the past.

I’m hoping this article will give you enough information to start your own blockchain testing investigation, and set you on your way to being comfortable with this technology.

Rhian Lewis an awesome resource, so be sure to follow her on Twitter.

Rumor also has it that she may be developing an online tester course on Ethereum…so stay tuned!

These are the blockchain testing tools that I found – let me know if I missed your favorite.
  1. Very interested in exercising my testing skills against block chain, thanks for the knowledge sharing.

  2. Good share Joe and well done

    Few thoughts: if block chain testing is not much diff from other tests may be Selenium should support right?
    also for service layer soap ui?

    we have a good tool katalon now, i think it should support

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

What is Behavior Driven Development (An Introduction)

Posted on 03/21/2024

Love it or hate it—Behavior Driven Development is still widely used. And unfortunately ...

What is ETL Testing Tutorial Guide

Posted on 03/14/2024

What is ETL Testing Let's get right into it! An ETL test is ...

Open Test Architecture How to Update a Test Plan Field (OTA)

Posted on 11/15/2022

I originally wrote this post in 2012 but I still get email asking ...