After you deploy a web application, you can always change its code if you need to add a feature or fix a bug. All you need to do is to redeploy the code on the server. With Ethereum smart contracts, this is not possible. Once you deploy a smart contract, its code is immutable. Nobody can’t modify it. If someone discover a critical bug, you can do nothing but observe helplessly the terrible scene of hackers pillaging your smart contract.
This is why you need to make sure that your smart contract has no bugs before you deploy it. There are different ways to do this, including running security analysis tools like Mythril. But these tools still can’t catch logic bugs. The only way to prevent these is to create extensive tests that cover all use cases. Unfortunately, there aren’t many tutorials on smart contract testing.
I created a course where we test 30 Solidity smart contracts, using the Truffle framework and web3.
After you finish all these tests, you will become a pro of smart contract testing. You will be not only very comfortable with the different testing techniques but also with testing tools. With so many different scenarios encountered, you will have accumulated a breadth of experience that normally take 6 month to 1 year to acquire.
These contracts are the same as in the course smart contract 30 – Solidity. However, it’s not required to have followed this course before. I will explain you how these contracts work in the testing course as well.
Each test is explained step-by-step in a high quality video tutorial. You can watch the first few videos for free. The source code of all the smart contracts and tests is available in the course.
If you have any questions, feel free to email me at julien [at] eattheblocks [dot] comSolidity