Using Model and Code Reviews in Model-based Development of ECU Software DaimlerChrysler AG, Research E/E and Information Technology {Mirko.Conrad Heiko.Doerr Ines.Fey First.I.Stuermer}@DaimlerChrysler.com
Presentation Outline Model-based Software Development Reviews in Software Development Model Reviews Autocode Reviews Summary
Model-based Software Development Continuous use of models for the specification the design the implementation and as a basis for the test Idea Strong advantages because of consistent means of description continuous tool chain efficient, automatic coding testing during the development process Micro controller W INT R INT A/D converter A/D converter W DIS R DIS Software U DIS D/A converter U INT
Modeling Techniques Block diagrams Extended state machines Executable models in all constructive development phases Mixed discrete-continuous models Hierarchical decomposition for complexity management Commercial simulation and modeling tools (e.g. Matlab / Simulink / Stateflow, ASCET-SD)
Reviews in Software Development Classical Software development Requirements Review Code Review Model-based Development Model Review Autocode Review
Model Reviews Aim Check if requirements are realized in the model Check if relevant modeling guidelines are fulfilled Check if models meet quality criteria e.g. portability, testability Guidelines for Model Reviews General rules Modeling pattern Project specific rules
Model Reviews Example of Modeling Guideline and corresponding Model Review Check
Tool-supported Model Reviews Automated creation of unambiguous references to the model Automatic marking of queried model parts Acceleration by 40% in comparison to conventional approach
Autocode Reviews Aim find errors which have been introduced by humans find errors which are difficult to detect in the models but easy to find in the generated code check the correct translation model to code thus safeguard the codegenerator Review automatically generated code Based on experience
Autocode Reviews: (A) (B) (C1) (D1) (C2) (D2) (E) Preparation Kick-off Inspection Meeting #1 Inspection Meeting #2 Follow-up Review#1 Review#2 Two-phase concept ACR Checklist #1 ACR Checklist #2 Review Phase #1 Review Phase #2 Based on checklists concerning in particular aspects such as structure and intelligibility special error causes Checklists serve the purpose of structuring experience 2 phases in order to keep the checklists manageable Combination of model review and code review
Autocode Reviews: Example of a Phase 1 Checklist Question ACQ1-2 Type: M Standard Conformance: Efficiency: Portability: Reusability: Safety: +++ Are the corresponding model and code fragments of an arithmetical operation consistent? Thereby, the review focus will be restricted to variables and arithmetic operations only. Code fragments, which result from scalings (e.g. shifts / casts), are not taken into account in this phase. Example: x1 x2 * * y y = (Int16) (((Int32)x1 * (Int32)x2 >> 16); y = (Int16) (((Int32)x1 + (Int32)x2 >> 16); check whether or not the corresponding model and code fragments are structurally consistent
Autocode Reviews: Example of a Phase 2 Checklist Question ACQ2-1 Type: M Standard Conformance: Efficiency: Portability: Reusability: Safety: +++ Are the signals / values of an arithmetical operation scaled in a consistent manner? Equal Scalings: As a rule, in case of additions / subtractions the scaling of all operands and the scaling of the result should be the same (cf. standard scaling table). In case of multiplications / divisions the plausibility of scalings has to be checked. Example: y = (Int8) ((UInt8)(x1<<2)+((UInt8)(x2<<2)+((UInt8)(x2<<2); y = (Int8) ((UInt8)(x1<<2)+((UInt8)(x2<<1)+((UInt8)(x2<<2); check for specific errors with respect to arithmetical operations
Summary: Reviews are very resource consuming Reviews should be reduced to what is absolutely necessary Other quality assurance techniques should be used in addition Static checking tools should be applied before the review Reviews should be connected with dynamic testing techniques Tool support is indispensable (e.g ToolNet environment, e-guidelines)
Using Model and Code Reviews in Model-based Development of ECU Software Ines Fey Methods and Tools (REI/SM) e-mail: Ines.Fey@DaimlerChrysler.com DaimlerChrysler AG Research and Technology Alt-Moabit 96 A D-10559 Berlin Phone +49-(0)30-39982-246 Fax +49-(0)30-39982-107 www.e-guidelines.de