From 223d7fe9b2915b19900ffcf13420652d759626c0 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 29 Mar 2019 10:54:23 +0100 Subject: [PATCH] implement stub instruction coverage plugin --- .../plugins/implementations/coverage.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mythril/laser/ethereum/plugins/implementations/coverage.py diff --git a/mythril/laser/ethereum/plugins/implementations/coverage.py b/mythril/laser/ethereum/plugins/implementations/coverage.py new file mode 100644 index 00000000..68524c28 --- /dev/null +++ b/mythril/laser/ethereum/plugins/implementations/coverage.py @@ -0,0 +1,25 @@ +from mythril.laser.ethereum.svm import LaserEVM +from mythril.laser.ethereum.plugins.plugin import LaserPlugin +from mythril.laser.ethereum.state.global_state import GlobalState + + +class InstructionCoveragePlugin(LaserPlugin): + """InstructionCoveragePlugin + + This plugin measures the instruction coverage of mythril. + The instruction coverage is the ratio between the instructions that have been executed + and the total amount of instructions. + + Note that with lazy constraint solving enabled that this metric will be "unsound" as + reachability will not be considered for the calculation of instruction coverage. + + """ + + def initialize(self, symbolic_vm: LaserEVM): + """Initializes the instruction coverage plugin + + Introduces hooks for each instruction + :param symbolic_vm: + :return: + """ + pass