The main aim is to achieve maximal code coverage ( 100% ) of smart contracts. This can be achieved by removal of dead code present in the contracts. This is a fact that a smart contract is prepared by several users at different timestamps. These changes in the contracts may lead to problems such as existence of dead code. Also, it may attract several bugs. Our purpose is to test the smart contract wrt to achieve code coverage and bug detection. Finally, automatically repair the contract so that it is having maximal code coverage and with no bugs.