|
|
|
@@ -20,28 +20,19 @@ class IComponent: |
|
|
|
def __init__(self, verification_set): |
|
|
|
self.verification_set = verification_set |
|
|
|
|
|
|
|
def run(self): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
def get_result(self): |
|
|
|
return self.result |
|
|
|
|
|
|
|
|
|
|
|
class IDataComponent(IComponent): |
|
|
|
"""Create inputs for verification_set.""" |
|
|
|
def run(self): |
|
|
|
self.result = self.create_inputs(self.verification_set) |
|
|
|
|
|
|
|
def create_inputs(self, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
class IBuilderComponent(IComponent): |
|
|
|
"""Build system under test.""" |
|
|
|
def run(self): |
|
|
|
self.result = self.build_sut(self.verification_set) |
|
|
|
|
|
|
|
def build_sut(self, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
@@ -52,10 +43,7 @@ class IExectorComponent(IComponent): |
|
|
|
self.function = function |
|
|
|
self.inputs = inputs |
|
|
|
|
|
|
|
def run(self): |
|
|
|
self.result = self.run_function(self.function, self.inputs, self.verification_set) |
|
|
|
|
|
|
|
def run_function(self, function, inputs, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
@@ -66,10 +54,7 @@ class IVerifierComponent(IComponent): |
|
|
|
self.expect = expect |
|
|
|
self.func_result = result |
|
|
|
|
|
|
|
def run(self): |
|
|
|
self.result = self.verify(self.expect, self.func_result, self.verification_set) |
|
|
|
|
|
|
|
def verify(self, expect, func_result, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
@@ -80,10 +65,7 @@ class IFIPolicyComponent(IComponent): |
|
|
|
self.function = function |
|
|
|
self.inputs = inputs |
|
|
|
|
|
|
|
def run(self): |
|
|
|
self.result = self.combine(self.function, self.inputs, self.verification_set) |
|
|
|
|
|
|
|
def combine(self, function, inputs, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
@@ -94,17 +76,11 @@ class IERPolicyComponent(IComponent): |
|
|
|
self.expect = expect |
|
|
|
self.result = result |
|
|
|
|
|
|
|
def run(self): |
|
|
|
self.result = self.combine(self.expect, self.result, self.verification_set) |
|
|
|
|
|
|
|
def combine(self, expect, result, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |
|
|
|
|
|
|
|
|
|
|
|
class IFacadeComponent(IComponent): |
|
|
|
"""Adapt verification_set.""" |
|
|
|
def run(self): |
|
|
|
self.result = self.adapt(self.verification_set) |
|
|
|
|
|
|
|
def adapt(self, verification_set): |
|
|
|
def __call__(self): |
|
|
|
raise NotImplementedError |