Institutions , Property-Aware Programming and Testing Ali Alnajjar - - PowerPoint PPT Presentation

institutions property aware programming and testing
SMART_READER_LITE
LIVE PREVIEW

Institutions , Property-Aware Programming and Testing Ali Alnajjar - - PowerPoint PPT Presentation

Institutions , Property-Aware Programming and Testing Ali Alnajjar Supervisor:Magne Haveraaen Investigate the relationship between Institutions specifications and models at a general, theoretical level Implementation Specification Run the


slide-1
SLIDE 1

Institutions , Property-Aware Programming and Testing

Ali Alnajjar Supervisor:Magne Haveraaen

slide-2
SLIDE 2

Institutions

Investigate the relationship between specifications and models at a general, theoretical level

Implementation Specification

slide-3
SLIDE 3

Testing

Run the algorithms on selected data sets in

  • rder to increase our belief in their

correctness.

slide-4
SLIDE 4

Property-Aware Programming (institutions)

Declaring syntactic and semantic properties

  • n generic parameters.
slide-5
SLIDE 5

Sophus

  • A medium-sized C++ software library developed for solving coordinate-free

partial differential equations.

  • Developed using algebraic specifications (with a focus on reusability).
  • Axiomatic specification.
  • Implementation were targeted to be as general as possible.
slide-6
SLIDE 6

Sophus

slide-7
SLIDE 7

Sophus

CartShape CartPoint ContShape ContPoint BNShape BNPoint extends uses satisfies satisfies uses extends MeshPoint MeshShape uses

slide-8
SLIDE 8

Sophus

When a specification B in Sophus uses another specification A, it means that specification A defines operations and axioms on a sort-set and B on another sort-set, even though the sorts of A may be used by operations in B. When a specification B in Sophus extends another specification A, it means that specification A defines operations and axioms on a sort-set and B provides more functiins and axioms on the same set.

slide-9
SLIDE 9

Institutions: Signatures

  • Sorts (Types).
  • Operations (functions,methods) + arities (arguments and return types).
  • Variables.
  • Terms (expressions).
slide-10
SLIDE 10

Institutions: Signature Morphism

S1 S2

(renaming and combining)

S’

slide-11
SLIDE 11

Institutions: Specification

Signatures Axioms

  • Can be combined and renamed.

Equational Axioms Conditional Axioms

slide-12
SLIDE 12

Institutions: Models

  • Provide the semantic for each signature.
  • For each sort define a data structure.
  • For each function define an algorithm.

S int

slide-13
SLIDE 13

Institutions: Satisfaction

slide-14
SLIDE 14

Implementation

  • Sorts

data structures (data invariants)

  • Functions

Algorithms

slide-15
SLIDE 15

Implementation

  • Every algorithm must preserve the data invariants: if the input data satisfies

the data invariant, so must the output data.

  • Every algorithm must preserve equality
slide-16
SLIDE 16

Testing

  • Preservation of the data invariants
  • Preservation of the equality. (provided data needed)
  • Checking of axioms. (provided data needed)
slide-17
SLIDE 17

Testing : Test Set

slide-18
SLIDE 18

Testing : test reduction hypothesis.

  • Random selection hypothesis
  • Domain partitioning hypothesis (Discontinuity hypothesis)
slide-19
SLIDE 19

Random selection hypothesis

slide-20
SLIDE 20

Domain partitioning hypothesis (Discontinuity hypothesis)

slide-21
SLIDE 21

Domain partitioning hypothesis (Discontinuity hypothesis)

slide-22
SLIDE 22

Questions

slide-23
SLIDE 23

Reference to specifications as models

Models Models provide the semantics for each signature. Models transform in the

  • pposite direction of signatures. That is, one may think of a signature renaming as
  • ne signature pointing at compo- nents of another signature. Then the latter

components are used as models for the former.

slide-24
SLIDE 24

The equivalence of satisfaction relation in OO What is the equivalence of satisfaction relation in OO??