Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
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
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
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
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
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
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
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
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:
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
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
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
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:
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)
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
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%
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
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
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