Solidity is a language used for smart contracts on the Ethereum blockchain. Smart contracts are embedded procedures stored with the data they act upon. Debugging smart contracts is a really difficult task since once deployed, the code... more
Solidity is a language used for smart contracts on the Ethereum blockchain. Smart contracts are embedded procedures stored with the data they act upon. Debugging smart contracts is a really difficult task since once deployed, the code cannot be reexecuted and inspecting a simple attribute is not easily possible because data is encoded. In this paper, we address the lack of inspectability of a deployed contract by analyzing contract state using decompilation techniques driven by the contract structure definition. Our solution, SmartInspect, also uses a mirror-based architecture to represent locally object responsible for the interpretation of the contract state. SmartInspect allows contract developers to better visualize and understand the contract stored state without needing to redeploy, nor develop any ad-hoc code.
Bad smells are signs of potential problems in code. Detecting bad smells, however, remains time consuming for software engineers despite proposals on bad smell detection and refactoring tools. Large Class is a kind of bad smells caused by... more
Bad smells are signs of potential problems in code. Detecting bad smells, however, remains time consuming for software engineers despite proposals on bad smell detection and refactoring tools. Large Class is a kind of bad smells caused by large scale, and the detection is hard to achieve automatically. In this paper, a Large Class bad smell detection approach based on class length distribution model and cohesion metrics is proposed. In programs, the lengths of classes are confirmed according to the certain distributions. The class length distribution model is generalized to detect programs after grouping. Meanwhile, cohesion metrics are analyzed for bad smell detection. The bad smell detection experiments of open source programs show that Large Class bad smell can be detected effectively and accurately with this approach, and refactoring scheme can be proposed for design quality improvements of programs.