19
. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01 Applying the Itacio Verification Model to a Component-Based Real- Time Sound Processing System Agustín Cernuda, Jose E. Labra G., Juan M. Cueva Department of Computer Science University of Oviedo (Spain)

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

Embed Size (px)

Citation preview

Page 1: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Applying the Itacio Verification Model to a Component-Based Real-Time Sound

Processing System

Agustín Cernuda, Jose E. Labra G., Juan M. Cueva

Department of Computer Science

University of Oviedo (Spain)

Page 2: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Component-Based Software Development (I)

• Key idea: Use existing software components

• Current verification habits. Usually:

– type and signature checking

– smoke tests

– Testing component groups difficult

• Result: Only some facets of the components

are tested

Page 3: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Component-Based Software Development (II)

• Goal: Automatic, static verification of component

aggregates

– Automatic verification of software difficult (data-

flow and the like)

– But developers know much about their components

– This knowledge gets lost in docs

Page 4: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Not losing knowledge

• Verifying component aggregates upon knowledge– State what you know / promise about your

component– Component: deliberately open-minded approach– Generate a knowledge base from a component

graph– Query the knowledge base looking for

mismatches

Page 5: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Components w/ knowledge

Requirements- Input1 must be less than Input2 + Input3

Guarantees- Output1 will always be between Input2 and Input3

Input1 Input2 Input3

Output1

...signatures....

...code...

Different from pre/postconditions!

Page 6: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

A component system w/ knowledge

i1 acceptable i1 positive

i1 i2

o1 positive i1 in [1..5] and i2 positive

o1 o2

i1 i2

o1

o1 is 5

o1

o1 is in [10..20]

o1

......

?OK

Page 7: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

KB generation

i1 acceptable i1 positive

i1 i2

o1 positive i1 in [1..5] and i2 positive

o1 o2

i1 i2

o1

o1 is 5

o1

o1 is in [10..20]

o1

......

A B

C

is 5A

is in [10..20]B

C is positive if

A in [1..5] ^

positiveB

C is acceptable if

C positive

Page 8: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Itacio System

ComponentDescription

System Description

KnowledgeBase

Results

KBGenerator

Web interface (ASP)

Java

CLP System ECLiPSe

XML Generator

XML File

Java

XSLT HTML + VML

Results

Page 9: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

WaveX sound processing system (I)

• Flexibility building custom sound processors

• Independent modules for sound processing

• The user defines system topology

Capture

Gain

Distortion

Play

DV_WaveInDeviceDV_WaveOutDeviceEF_DistortionEF_GainEF_SepChannelsEF_JoinChannels. . .

C++ Components

Page 10: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

WaveX sound processing system (II)

MODULE Input DV_WaveInDevice.DLL

PARAM DesiredChannels 2

PARAM DesiredBitsPerSample 16

PARAM DesiredBufferSize 4096

PARAM DesiredSamplesPerSecond 44100

MODULE Separation EF_SepChannels.DLL

MODULE Joining EF_JoinChannels.DLL

MODULE Play DV_WaveOutDevice.DLL

PARAM DesiredChannels 2

PARAM DesiredBitsPerSample 16

PARAM DesiredSamplesPerSecond 44100

LINK Input out Separation in

LINK Separation left Joining right

LINK Separation right Joining left

LINK Joining out Play in

Topology Description

Page 11: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

WaveX sound processing system (III)

WaveX System in action

Page 12: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

WaveX sound processing system (IV)

• Components have their requirements possibility of errors such as:– Exceeding max. amplitude range– Sampling rate mismatch– Mono / stereo mismatch– Etc. etc.

• Indirect relations between components• Desirable to verify topologies automatically

Page 13: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Applying Itacio to WaveX (I)

Component: EF_SepChannels

Sinks: in Sources: left, right

Requirements:channels($in$, 2).

Guarantees:channels($left$, 1).bitsPerSample($left$, X) :- bitsPerSample($in$, X).samplesPerSec($left$, X) :- samplesPerSec($in$, X).bufferSize($left$, X) :- bufferSize($in$, X).

 channels($right$, 1).bitsPerSample($right$, X) :- bitsPerSample($in$, X).samplesPerSec($right$, X) :- samplesPerSec($in$, X).bufferSize($right$, X) :- bufferSize($in$, X).

Component Description

Page 14: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Applying Itacio to WaveX (II)

Component Description(Web Interface)

Page 15: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Applying Itacio to WaveX (III)

/* Requirements */verify_connection(n_ChannelInversion_Separation_in) :- channels(node_33_source_22, 2).

/* Guarantees */channels(node_34_source_24, 1).channels(node_34_source_25, 1).bitsPerSample(node_34_source_24, X) :- bitsPerSample(node_33_source_22, X).samplesPerSec(node_34_source_24, X) :- samplesPerSec(node_33_source_22, X).bufferSize(node_34_source_24, X) :- bufferSize(node_33_source_22, X).bitsPerSample(node_34_source_25, X) :- bitsPerSample(node_33_source_22, X).samplesPerSec(node_34_source_25, X) :- samplesPerSec(node_33_source_22, X).bufferSize(node_34_source_25, X) :- bufferSize(node_33_source_22, X).buffer_processing_time(node_34_source_24, X) :- buffer_processing_time(node_33_source_22, TIME_INPUT), X is 10 + TIME_INPUT.buffer_processing_time(node_34_source_25, X) :- buffer_processing_time(node_33_source_22, TIME_INPUT), X is 10 + TIME_INPUT .

Automatically generated CLP Program

Page 16: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Applying Itacio to WaveX (IV)Output generated by Itacio

(HTML + VML)

Error explanations

Page 17: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Conclusions

• Advantages– Static verification vs. testing– No need of data flow or abstract interpretation– Knowledge doesn’t get lost– Components get better described / characterised– Well-known tools (automatically obtained)

• Problems– Knowledge consistency– Naming, integrating third-party components– Lying statements

Page 18: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

Future Work

• Apart from Sound processing, Itacio has also been applied to

• Time evolution of reuse contracts• Remote personal computer diagnostics• Reliability models of component platforms (Hamlet et al. 00)

It would be interesting to apply it to other areas• Allow unfinished systems (no closed graph

requirement)• Improve error information• Full fledged Itacio-based verification system

– Graphical Editors– User interface– Integration with other tools

Page 19: © A. Cernuda, J. E. Labra, J. M. Cueva, 2001CLPSE01 Applying the Itacio Verification Model to a Component-Based Real-Time Sound Processing System Agustín

© A. Cernuda, J. E. Labra, J. M. Cueva, 2001 CLPSE’01

http://www.agustincernuda.com/itacio_eng.html

The EndThe End

Further Information

Itacio Project Web Page