18
1 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH Masterthesis Masterthesis Christian Miedl Christian Miedl Test coverage analysis of an engine model

Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

1

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

MasterthesisMasterthesis Christian MiedlChristian Miedl

Test coverage analysis

of an engine modelPrototype

Page 2: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

2

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

OutlineOutline

• TESIS DYNAware GmbH

• Real-time engine model enDYNA

• Goals of this thesis

• Test techniques

• Implementation

• Model coverage analysis

• Code coverage analysis

• Summary

Page 3: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

3

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

TESIS DYNAware GmbHTESIS DYNAware GmbH

Multibody

dynamics & simulation

Automation for

large IT systems

CAD/CAM/CAE and

PDM/ERP integration

ve-DYNA

vehicle dynamics

analysis

Realtime

BrakeHydraulics

en-DYNA

engine dynamics

analysis

Page 4: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

4

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

RealReal--time time engineengine modelmodel enen--DYNADYNA

• mean value model

• based on physical equations

• fully parameterized

• engine torque and engine speedare calculated synchronous to thecrank angle

• SIMULINK library

• real-time simulation

• development and test of enginecontrol algorithms

• controller and component testsin HIL test benches

Page 5: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

5

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

GoalsGoals

• improve testing process

• improve testability of the engine model

• improve software development process

usage of coverage tools

to support testing

Idea /order

Meetings:check

boundary conditionsfunctionality etc.

Prot

otyp

e SW Implementation:ML/SL modelS-Functions

PreProcessingParameters

DocumentationInternal Documentation

Programing Guidelines:Simulink / Licensing

Reviews Daily Build Test-automation

Manual tests Final Product

Change

MicrosoftSourceSafe

ML/SLRTWRTI

ML/SLRTWRTI

HTML

ML/SLRTWRTI

Excel

ML/SLmodels,libraries,objects

ML/SLVisual Studio

Eclipse, UML,Word, SourceSafe

Change

Change / Bugfix

Word / Excel,E-mails,

notes

Concept phase Implementation phase Test- and delivery phase

Page 6: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

6

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

Test Test techniquestechniques II

What is testing?

Testing is a process, which executes a program

with the intention of finding errors

Page 7: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

7

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

Test Test techniquestechniques IIII

Black box testing:

• no programming language knowledge neccessary

• testing in view-point of the user

• test cases can be designed soon

• structure of software important

• software metrics support testing

White box testing:

Combination of Black box and White Box testing is sensible

Page 8: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

8

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

Test Test techniquestechniques IIIIII

Model Coverage and Code Coverage

General: Coverage is percentage of executed software

• Model coverage – based on graphical models e.g. Simulink model

• Code coverage – based on code e.g. C-code

Why? � mapping from graphical Simulink model to C-code is not unique

mininput1input2input3

output

output=input1;if(input2<output){ output=input2;}if(input3<output){ output=input3;}

output=input3;if(input1<output){ output=input1;}if(input2<output){ output=input2;}

if(input2<input1){ if(input3<input2){ output=input3; } else{ output=input2; }} else{ if(input3<input1){ output=input3; } else{ output=input1; }}

Simulink: C-code:

Page 9: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

9

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Planung / zeitlicher Ablauf wird unterstützt durch Projektplan

Idea /order

SW Implementation:ML/SL modelS-Functions

PreProcessingParameters

DocumentationInternal Documentation

Programing Guidelines:Simulink / Licensing

Daily Build Test-automation

Manual tests F

Change

Reviews

MicrosoftSourceSafe

ML/SLRTWRTI

ML/SLRTWRTI

HTML

ML/SLRTWRTI

ExcelML/SL

Visual StudioEclipse, UML,

Word, SourceSafe

Change

Change / Bugfix

Word / Excel,E-mails,

notes

Concept phase Implementation phase Test- and delivery phase

SoftwareRequirements

DOORS/Matlab

Meetings:check

boundary conditionsfunctionality etc.

ModuleTests

ML/SL

12

3

Page 10: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

10

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Model coverage analysis

branch coverage minimal testing criteria

� use decision coverage in Simulink

Page 11: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

11

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

� Coverage is low!

• improve model structure

• remove Dead Code

• additional test cases

Model coverage analysis

Page 12: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

12

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Model coverage analysis

Saturation blocks:

Multiport switches:

Page 13: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

13

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Model coverage analysis

Not necessary blocks:(Dead Code)

Page 14: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

14

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Model coverage analysis

� no test case uses reverse gear

� new driving cycle

Page 15: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

15

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Model coverage analysis

Model coverage was increased from 68% to 89%

Page 16: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

16

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Code coverage analysis

• Additional tool necessary: CTC++ Coverage Analyzer

• Analyze RTW generated real-time code

• Branch coverage is used

Comparison: original model structure – improved model structure

47184 LOCs 47146 LOCs

Page 17: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

17

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

ImplementationImplementation

Code coverage analysis

Page 18: Masterthesis Christian Miedl · 2005-07-22 · ML/SL 2 1 3. 10 enDYNA No part of this presentation may be photocopied or reproduced in any form without prior written consent from

18

enDYNA

No part of this presentation may be photocopied or reproduced in any form without prior written consent from the TESIS DYNAware Technische Simulation Dynamischer Systeme GmbH. This slide must not be used for any kind of presentations. • All products mentioned are trademarks or registered trademarks of their respective companies. • © TESIS DYNAware GmbH

SummarySummary

• Significant improvements in model coverage could be reached

• Structural improvements

• Additional test cases

• Structural improvements do not show up in code coverage

• Testability of Simulink model was increased