Presentation is loading. Please wait.

Presentation is loading. Please wait.

Strategizing Testing for Blockchain /Distributed Ledger Products

Similar presentations


Presentation on theme: "Strategizing Testing for Blockchain /Distributed Ledger Products"— Presentation transcript:

1 Strategizing Testing for Blockchain /Distributed Ledger Products
Hardik Verma | QA Automation Engineer | Capgemini

2 Blockchain Going forward in the imminent slides I will be talking about how blockchain came into existence and how it works by this I want to focus your attention on what is blockchain, and after that I will emphasis on why there is a need for a generic strategy for testing products using blockchain technology. The technology at the heart of bitcoin and other virtual currencies, blockchain is an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way. The ledger itself can also be programmed to trigger transactions automatically.

3 Bayer, Haber and Stornetta incorporated Merkle trees to the blockchain as an efficiency improvement to be able to collect several documents into one block. More than $1 billion has been given into Bitcoin and blockchain-related tech startups. 1992 2017 1991 2008 The first work on a cryptographically secured chain of blocks was described in 1991 by Stuart Haber and W. Scott Stornetta, in 1992, Bayer, Haber and Stornetta incorporated Merkle trees to the blockchain as an efficiency improvement to be able to collect several documents into one block. The first distributed blockchain was then conceptualized by Satoshi Nakamoto in 2008 and implemented the following year as a core component of the digital currency bitcoin, where it serves as the public ledger for all transactions. Through the use of a peer-to-peer network and a distributed timestamping server, a blockchain database is managed autonomously. The use of the blockchain for bitcoin made it the first digital currency to solve the double spending problem without requiring a trusted administrator. The bitcoin design has been the inspiration for other applications The first work on a cryptographically secured chain of blocks was described in 1991 by Stuart Haber and W. Scott Stornetta The first distributed blockchain was then conceptualized by Satoshi Nakamoto in 2008

4 Distributed System Bitcoin

5 Principle of Blockchain
Everyone on a blockchain has access to the whole database with its history. No single party controls the information or the data. All parties can authenticate the records of its transaction partners directly, without an arbitrator. Distributed Database Communication occurs directly between peers instead of through a central node. Each node stores and forwards information to all other nodes. Peer-to-Peer Communication Every transaction and its associated value are visible to anyone with access to the system. Each node, or user, on a blockchain has a unique 30-plus-character alphanumeric address that identifies it. Transparency with Pseudonymity Once a transaction is entered in the database and the accounts are updated, the records cannot be altered, because they’re linked to every transaction record that came before them (hence the term “chain”). Irreversibility of Records The digital nature of the ledger means that blockchain transactions can be tied to computational logic and in essence programmed. Computational Logic Here are five basic principles underlying the technology. Distributed Database Everyone on a blockchain has access to the whole database with its history. No single party controls the information or the data. All parties can authenticate the records of its transaction partners directly, without an arbitrator. Peer-to-Peer Communication Communication occurs directly between peers instead of through a central node. Each node stores and forwards information to all other nodes. Transparency with Pseudonymity Every transaction and its associated value are visible to anyone with access to the system. Each node, or user, on a blockchain has a unique 30-plus-character alphanumeric address that identifies it. Users can choose to remain anonymous or provide proof of their identity to others. Transactions occur between blockchain addresses. Irreversibility of Records Once a transaction is entered in the database and the accounts are updated, the records cannot be altered, because they’re linked to every transaction record that came before them (hence the term “chain”). Various computational algorithms and approaches are deployed to ensure that the recording on the database is permanent, chronologically ordered, and available to all others on the network. Computational Logic The digital nature of the ledger means that blockchain transactions can be tied to computational logic and in essence programmed. So users can set up algorithms and rules that automatically trigger transactions between nodes.

6 Type of Public Blockchain
Bitcoin Ethereum Truffel & Solidity Monero Dash Litecoin Dodgecoin Public Blockchains State of the art public Blockchain protocols based on proof of work (POW) consensus algorithms are open source and not permissioned, which means that everyone can be part of them and explore them. (1) Anyone can download the code and start running a public node on their local device, validating transactions in the network, thus participating in the consensus process – the process for determining what blocks get added to the chain and what the current state is. (2) Anyone in the world can send transactions through the network and expect to see them included in the blockchain if they are valid. (3) Anyone can read transaction on the public block explorer. Examples: Bitcoin, Ethereum, Monero, Dash, Litecoin, Dodgecoin, etc. Effects: (1) Potential to disrupt current business models through disintermediation (2) No infrastructure costs! No need to maintain servers or system admins radically reduces the costs of creating and running decentralized applications (dApps).

7 WHY a need of Testing Strategy?

8 Where testing is needed
Nodes Transmitting Channel / Network Data Store Data Store The data stored on a node won’t change and no one is able to update it, only appending new transaction to the data store is allowed. Data sent from a single node is propagated to other nodes that store the copies of the data. Blockchain Network / Propagation of Data Data can be sent from multiple nodes at the same time. Whenever someone accesses a node the up-to-date version of the data is fetched, irrespective of the time or the node it is stored on. If one or more nodes are down, the data will flow properly through the online nodes and once the offline nodes are brought back up they will retain the up-to-date data. Node At any given time there can be an increase or decrease in the number of nodes. Validating the address/identity of the node from where data in propagated.

9 Test Environment

10 Testing Data Store i.e. Altering of Data is not allowed
Data should be same at all the nodes after propagation of data

11 Testing Blockchain Network / Propagation of Data
Two nodes sending data simultaneously to the other nodes

12 Testing Blockchain Network / Propagation of Data
Adding new node

13 Testing Node Bringing a node down and up

14 Validating Transaction
Verifying Address of node

15 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

16 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

17 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

18 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

19 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the online nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

20 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other online nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

21 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

22 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the other nodes. Start the previously closed nodes and validate if it retains updated data from all the other nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

23 End-to-End Testing steps
Validate all nodes are in a working condition. Get the address/secret keys from all the nodes and save it. Start propagating data from one node. Check whether all the other nodes receive the data and if the data store is updated in chronological order. Take another node and hack it so that you can temper its data store/transaction in it, save this and see if the tempered data affects the data store on other nodes. In ideal condition it shouldn’t. Start propagating data from 2 more nodes at the same time and verify the data store of all the other nodes. Close down a node or multiple nodes to check if the data from the transmitting nodes reaches all the online nodes. Start the previously closed nodes and validate if it retains updated data from all the other online nodes. When all the nodes are up, add new node on it and verify if its data store gets updated from all the previous nodes. Stop all the transaction and then take any 2 nodes, propagate a transaction from one node and validate it in other node. In the transaction check the address or the secret key of the transmitting node taken in the 2nd step.

24 Automation Strategy The test data needs to have been added to the system and fully propagated throughout the nodes. Several strategies for ensuring this were described earlier. With the automation script when a node is brought down, a verification needs to be done to check if it’s truly inaccessible. The script should be able to pull every single piece of data stored in the storage of a node without any error. You can test this by telling the node to give a proper set of data with the name/address of the node from which the data is been received. If a pull fails then the system might have a data-distribution bug that needs to be corrected.

25 Business Benefits Strategize testing in a new format:
Serves as a guide for testing throughout the development phase. Generic: This is a generic testing strategy which can be used for any blockchain product. Easy customization: If we know how our blockchain product works, we can easily customize this testing strategy to the needs. Programme Delivery:  End to end programme delivery of business, data and technical architecture that underpins the blockchain capability. Implementation on CI/CD :  Once the initial testing is done and the automation is created using this strategy it can integrated with the CI/CD tools for DevOps environment. Competitive advantage: To get new business on blockchain technology by offering the well-developed testing strategy for multiple industries.

26 References https://en.wikipedia.org/wiki/Blockchain

27 Author Biography Hardik Verma received degree in Information Technology from Mumbai University. A strong advocate for “fun at work” , he is constantly involved in development of Software testing automation using various automation languages such as 4Test, JAVA, C#, PYTHON, RUBY . His professional interests focus on Automation, Machine Learning, Database Designing, UI Designing, etc. and his current projects include Creation of Automation Frame work to Test API and Web UI using SilkTest, Selenium and Silk Central and a framework to test Distributed ledger technology. In addition, he serves as Software Engineer for Capgemini PVT, and is a member of Mozilla Developer Network Community.

28 Thank You!!!


Download ppt "Strategizing Testing for Blockchain /Distributed Ledger Products"

Similar presentations


Ads by Google