• No results found

Scenario-driven Testing of Security-related Domain-specific Language Models

N/A
N/A
Protected

Academic year: 2021

Share "Scenario-driven Testing of Security-related Domain-specific Language Models"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

Scenario-driven Testing of Security-related Domain-specific

Language Models

Bernhard Hoisl

(2)

Introduction, Definition, Motivation

MDD

: software engineering technique, abstracting problem domain via models,

M2M/M2T transformations

DS(M)L

: a specialized (modeling) language tailored for a particular application

domain (e.g. access control, backup policies, or system auditing) in the context

of MDD

DSML based on the MOF/UML

: de facto standard for software system

modeling, standardized modeling extensions, tool support, maintained through

the OMG, builds upon a standardized metamodel

(3)
(4)

Introduction, Definition, Motivation

Objectives Domain

An integrated approach for modeling processes and process-related RBAC models (roles, hierarchies, statically and dynamically mutual exclusive tasks etc.)

Business processes, role-based access control (RBAC)

Integrated modeling of business processes and process-related duties; par-ticularly the modeling of duties and associated tasks in business process models

Business processes, process-related duties

An approach to provide modeling support for the delegation of roles, tasks, and duties in the context of process-related RBAC models

Business processes, delegation of roles, tasks, and duties

Modeling of confidentiality and integrity of object flows in activity models Data confidentiality and integrity Modeling support for the notion of mutual exclusion and binding constraints

for duties in process-related RBAC models

RBAC (consistency checks for duties)

Incorporation of data integrity and confidentiality into the MDD of process-driven SOAs

Integrity and confidentiality for service invocations

Integration of context constraints with process-related RBAC models and thereby supporting context-dependent task execution

Business processes, RBAC, con-text constraints

An approach for the definition of audit requirements and specification of

(5)

Introduction, Definition, Motivation

Use case

: Integration of security-related DSML core language models

DSML core language model captures all relevant domain abstractions and

specifies the relations between these abstractions

Integration enables the reuse of DSMLs by composing two or more

languages into an integrated DSML to implement a new domain or to

integrate domain viewpoints

AuditableEvent DSML C AuditEvent DSML A Event DSML B

«merge» «merge» :CompositionLink

:CompositionLink

target target

(6)

Scenario-based Testing

As it is almost impossible to completely test a complex software system, effective

means are needed to select relevant tests, to express and to maintain them, and

to automate test procedures whenever possible

Scenarios can help to reduce the risk of omitting or forgetting relevant test cases,

as well as the risk of describing important tests insufficiently

Scenarios are used to specify user needs as well as to explore and to define

(actual or intended) system behavior

Scenarios can be described in different ways at various abstraction levels (e.g.,

(7)

Scenario-based Testing

Test case

Test suite Test scenario

Precondition Postcondition

Expected result Test result

Test body Setup sequence Cleanup sequence * 1.. * 1.. 0..1 0..1 0..1 0..1 0..1 * * * * 1 checked against returns 0..1 0..1

(8)

Scenario-based Testing of DSML Core

Lan-guage Models: Process Description

ad: A scenario-based testing activity (domain expert)

Create scenario descriptions

(DSML engineer)

Translate scenario descriptions into tests

(domain expert, DSML engineer)

Review scenario tests

(DSML engineer)

Perform meta-modeling action

(DSML engineer)

Run scenario tests

(9)

Scenario-based Testing of DSML Core

Lan-guage Models: Problem Statement

Create natural-language scenario descriptions Run scenario tests Translate scenarios

(10)

Scenario-based Testing of DSML Core

Lan-guage Models: Our Approach

Natural-language scenario descriptions on the requirements-level

Executable test scenarios (for a dedicated platform)

Transformation via linguistic rule-based step definitions

Tool-support: testing framework based on Eclipse EMF, Epsilon, Xtext

Create natural-language scenario descriptions

Run scenario tests Step definitions

(11)

Example: Process Description

Scenario testing a security-related DSML core language model composition

ad: Scenario testing a DSML core language model composition

(domain expert) Create natural-language scenario descriptions see Listing 2 (DSML engineer) Transform scenario descriptions into tests

(domain expert, DSML engineer)

Review scenario tests

(DSML engineer)

Run scenario tests

see Listing 4

[tests succeed] [tests fail] (domain expert, DSML engineer)

Determine requirements specification format

see Listing 1 Metamodel DSML 1 Metamodel DSML 2 Match elements ECL Comparison rules Match trace Copy elements ETL Merge elements EML; see Listing 5 Transformation rules Merge rules Composed metamodel Match trace Metamodel DSML 1 Metamodel DSML 2 Metamodel DSML 1 Metamodel DSML 2 Load models (DSML engineer)

Perform language modeling action

(DSML engineer)

Define step definitions

see Listing 3

[apply step definitions]

[reuse step definitions]

(12)

Example:

Security-related DSML Core

Lan-guage Models

AuditEvent Signal data : EString AuditRule Condition EventSystem NamedElement

name : EString publish 0..* subscribe 0..* conditions 0..* auditEvents 0..* auditRules 0..*

StateMachine State Transition

Event NamedElement name : EString states 0..* transition 0..1 events 0..* target 1

(13)

Example: Integration of Security-related DSML

Core Language Models

AuditableEvent DSML C AuditEvent DSML A Event DSML B

«merge» «merge» :CompositionLink :CompositionLink

target target

(14)

Example:

Requirements-level Scenario

De-scription (Excerpt)

Test case 2 Ascertain that each triggeredAuditableEvent can be sensed by the monitoring facility. Primary actors System auditor, distributed-systems operator

Preconditions All metamodel constraints for the source DSMLs must hold for DSMLC.

Trigger/Setup The model-transformation workflow to integrate the metamodels of DSML A& DSML B is executed.

Test scenario 1 An AuditableEvent issued by aTransition must publish at least one Signal. Preconditions AuditableEvent has all structural features ofAuditEvent and Event.

(15)

Example: Scenario-based requirements

spec-ification language (metamodel & textual

con-crete syntax)

given : String [0..*] when : String [0..*] then : String [1..*]

RequirementsSpecication NamedElement

name : String [1] Scenario Feature in_order_to : String [0..1] as_a : String [0..1] i_want : String [0..1] features 0..* scenarios 0..* RequirementsSpecification: "..." Feature: "..." In order to "..." As a "..." I want "..." Scenario: "..." Given "..." When "..."

(16)

Example:

Requirements-level Scenario

De-scription (Alternative Format; Excerpt)

RequirementsSpecification: "DSMLs A and B integration" Feature: "Monitor AuditableEvent"

In order to "ascertain that each triggered AuditableEvent can be sensed by the monitoring facility"

As a "system auditor and distributed-systems operator" I want "that AuditableEvents shall publish Signals"

Scenario: "AuditableEvent shall publish at least one Signal"

Given "that EventSystemStateMachine.AuditableEvent has all features of EventSystem .AuditEvent and StateMachine.Event"

When "in metamodel EventSystemStateMachine metaclass AuditableEvent references metaclass Signal"

Then "instances of EventSystemStateMachine.AuditableEvent shall refer to at least 1 Signal instance"

(17)

Example: Scenario-transforming Step

Defini-tion

var stepDef : Map = Map {

-- tests if multiplicity >= 1 between two classifiers Set {

"^instances of (\\S+)\\.(\\S+) (?:shall|must) refer to at least (\\d+) (\\S+) instances?$"

}

= "assertFalse(\"An $1 shall publish at least $2 $3.\", $0!EClass.all->selectOne(c | c.name = \"$1\").eStructuralFeatures->first().lowerBound < $2);"

-- more step definitions };

(18)

Example: Generated Scenario Tests

--DSMLs A and B integration @TestSuite

operation dsmls_a_and_b_integration() { --Monitor AuditableEvent:

--In order to ascertain that each triggered AuditableEvent can be sensed by the monitoring facility --As a system auditor and distributed-systems operator

--I want that AuditableEvents shall publish Signals @TestCase

operation monitor_auditableevent() {

--AuditableEvent shall publish at least one Signal @TestScenario

--Given that EventSystemStateMachine.AuditableEvent has all features of EventSystem.AuditEvent and StateMachine. Event

$pre EventSystemStateMachine!EClass.all->selectOne(ae | ae.name = "AuditableEvent").eStructuralFeatures.size() = EventSystem!EClass.all->selectOne(ae | ae.name = "AuditEvent").eStructuralFeatures.size() + StateMachine! EClass.all->selectOne(ae | ae.name = "Event").eStructuralFeatures.size()

operation auditableevent_shall_publish_at_least_one_signal() {

--When in metamodel EventSystemStateMachine metaclass AuditableEvent references metaclass Signal

if (EventSystemStateMachine!EClass.all->selectOne(c | c.name = "AuditableEvent").eStructuralFeatures->first(). eType.name = "Signal") {

--Then instances of EventSystemStateMachine.AuditableEvent shall refer to at least 1 Signal instance assertFalse("An AuditableEvent shall publish at least 1 Signal.", EventSystemStateMachine!EClass.all->

selectOne(c | c.name = "AuditableEvent").eStructuralFeatures->first().lowerBound < 1); }

(19)
(20)

Concluding Remarks

Discussion

Ambiguity of requirements

: step definitions help to reduce the number of

semantic variation points of ambiguous natural-language requirements

Consistency of requirements

: executable scenario tests add to the

conflict-free definition of requirements (otherwise tests will fail)

Singularity of requirements

: pattern-based step definitions recognize

conjugated scenario steps

Traceability of requirements

: forward traceability via step definitions;

backward traceability via the scenario-test report

Verification of requirements

: evidence collection via executable test

scenarios for the proof that system can satisfy requirements

References

Related documents

Extant research has pointed to the benefits of mediation in terms of cost and efficiency (Latreille, 2011) and the ‘upstream’ impact on managerial conflict

Incorporating corporate social responsibility into travel programs continues to be important to both buyers and sellers and is viewed as having the most positive impact on

Base on the data and analysis of those, it can be seen that IT-entrepreneur does not utilize project management methodology so much, or if they utilize they only perform the

The aim of this thesis is to develop and extend Bayesian statistical models in the area of spatial modeling and apply them to child health outcomes, with particular focus on

1 Workforce Central v6 -New Product Offering Workforce Integration Manager 8800131-000 2 Workforce Central v6 -New Product Offering Workforce Absence Manager V6 8800129-000 3

The yearly incidence of six adverse events sensitive to nursing care are related to the hospitals’ licensed nursing staff, the numbers of patients, hospital acuity, other

21 PPTA urges HRSA to refrain from finalizing this proposed rule until CMS has issued guidance expressly excluding from the best price calculation 340B sales of orphan

Differentiate three levels of personal morality – pre- conventional, conventional and post-conventional in which distinguished the other two degrees further specifying the