Automotive Software
Automotive Software
Automotive Software
3. Software Engineering
Soonmin Hwang
E-mail : soonminh@hanyang.ac.kr
This slide is adapted from the “CSE4006 Software Engineering” class materials of Prof. Scott Uk-Jin Lee,
ERICA Campus, Hanyang University, with the written permission of the original author.
1. Introduction to Software Engineering
Successful Software Project
If the project meets
3
Successful Software Project
How many software projects have been successful?
‒ Based on “time”, “budget”, and “quality” (within specification)
‒ Evaluate projects as Succeeded (all) or Challenged or Failed (not finished)
è Over 20+ years, Challenged / Failed projects are not reduced significantly. Why?
6
Difficulties in Software Project
Reasons
• Communication issue due to invisibility
: Diverse stakeholders with different level of understanding
: Problem is not always well-defined
• Project complexity
: Difference in development duration, number of developers, user levels, etc.
7
Necessity of Engineering Principles
As the size of software grows
• Programming à Process. Planning/tools affect productivity and quality.
• Experiences on project management and development are very important
• The success of software developments depends greatly on the maturity of the
developing group on software engineering [1989, Humphrey]
8
Causes for Errors
Logic design
20% Coding
30%
Misunderstanding
of functionality
15%
Documentation
and others
35%
9
Causes for Errors
11
Software Failures - MCO at Mars (NASA, 1998)
13
Software Failures - MCO at Mars (NASA, 1998)
Defect analysis
• Variable ∆𝑉 was calculated to be 4.45 times smaller than its normal value
• Units in MCO thrust data: the international standard unit of 1 (N⋅s)
• But, SM_FORCE program in MCO uses 4.45 (lb⋅s), which is American unit
Expected trajectory
Real trajectory
14
Software Failures – Remotely Kill a Jeep (2014)
16
Software Failures - Remotely Kill a Jeep (2014)
Hack a Jeep by Miller & Valasek
• Connect to a jeep in motion remotely
• They can monitor, collect, and analyze
bus data between BCM and CAN-C
in the control system
• Attempt to stop a moving vehicle
by controlling vehicle via a remote command
Defect analysis
• Radio module and BCM is connected via CAN
• Vulnerability: data bus is exposed to outside
‒ Able to scan vehicle’s IP and install an app
‒ Send a CAN message to take control
17
Software Crisis
Problems of Software Engineering
• cost overrun, delayed period, poor performance, unreliablility
• impossible to maintain / huge maintenance costs
è Supply and demand imbalance of the software is increasing!
Development
33%
Maintenance
67%
18
1. History of Software Engineering
19
2. Software Engineering
Definition
: Applying engineering, scientific, and mathematical principles and methodologies
to economically produce high quality software (Humphrey, SEI)
: Systematic approach to the development, operation, maintenance,
and destruction of software (IEEE computer society)
Objectives
• Quality
• Productivity
20
2. Software Engineering – Quality
Perspective on quality differs
• Depending on where you stand
21
2. Software Engineering – Productivity
Maturity of the organization: CMM (Capability Maturity Model)
22
2. Software Engineering – Productivity
Other factors affecting productivity
• Ability of programmers
• Team communication
• Complexity of the product
• Technology level
• Management skills
23
2. Software Engineering – Facts
• Most of the labor spent on software is maintaining current system
• The later the errors are discovery, the higher the cost of correction
• Many errors occur due to the inaccurate requirement definition
• Programming error are less the design errors
• Putting more manpower to a delayed project slow down the completion
• If software is not maintained properly it turns into a complex software
24
3. Software Maintenance
Cost of the entire software process cycle
25
4. Importance of Spec. and Design
Why costs increase later in each development phase
• As the code moves to later stages,
‒ More challenging to remember all the details
and locate issues
‒ Can be time-consuming
to reproduce on a developer’s local environment
‒ Risky to try to fix
: might negatively impact on live users
• Deeper defects
‒ much more challenging to uncover
‒ Often do not become apparent
until the software is in the production phase
e.g., memory leaks or race conditions
26
5. Team Programming
Multi-person construction with multi-version software
• Programming: personal activity
• Software engineering: team activity
Programming-in-the-large
• Communication skills
• Design approaches (i.e., system abstraction) is important
• top down design / Divide & conquer paradigm / Component based integration
• Interpretation and accurate specification of ambiguous requirement
• Modeling is required
• Ability to manage work according to schedules
28
5. Team Programming
Solutions for the software crisis
• Management techniques
• Team organization
• Better language and tools
• Standard enactment
⇒ Applying Engineering Approach
29
6. Solutions for the crisis – Tools/Infra
30
6. Solutions for the crisis – Tools/Infra
Integrated Development Environment (IDE)
• Syntax highlighting
• Code completion
• Multi-programming language support
• Compiler & Debugger
• Code refactoring
• Version control
…
32
6. Solutions for the crisis – Tools/Infra
Container deployment
• Docker
‒ A set of platform as a service products
‒ OS-level virtualization
Manage dependencies
• Conda (for python)
‒ Cross platform
‒ Native virtual environment
33
6. Solutions for the crisis – Principles
• Rigor & Formality (time, budget)
• Separation of concerns (divide & conquer)
• Modularity (decoupling with others, increase the sustainability of code)
• Abstraction (for better insights)
• Anticipation of changes (inevitable, need engineering approach)
• Generality (for various platforms/environments/users)
• Incrementality (from small to big, user feedback)
• Documentation (development process, collaboration)
34
2. Software & Software Engineering
Software
The single most important technology in our world
Impacts on the other technologies
• The creation of new technologies (e.g., genetic engineering, nanotechnology)
• The extension of existing technologies (e.g., telecommunications, transportation, medical)
• The radical change in older technologies (e.g., media, education, military)
36
Software
Delivers the most important product of our time: Information
• Transforms data suitable for specified context
• Manages business information to enhance competitiveness
• Provides gateway to worldwide information (Internet)
• Provides means to acquire information
37
Software
Changed significantly
Due to hardware advancements
• Dramatic increase in performance
• Profound changes in computer architecture
• Vast increase in memory and storage capacity
• Variety of exotic I/O options become available
39
Software
Definition:
1. [Programs] Instructions
that provides desired features, function, and performance when executed
2. [Data structures]
that enables the program to adequately manipulate information
Does this definition give you a better understandings on what Software is?
èTo accomplish that, let’s examine the characteristics of software
40
Software doesn’t “wear out”
Failure curves Hardware Software
Example) Starcraft
New feature
: LAN Multiplay CPU Throttling
(2002) (2008)
44
Software Engineering
Software Engineering: A framework for building software
• A systematic, disciplined and quantifiable approach
in order to economically develop, operate, and maintain software
that is reliable and works efficiently on real machines
à And yet, “systematic, disciplined and quantifiable” approach applied by one team
may be burdensome to another
à We need discipline, but also need adaptability and agility
45
Software Engineering
Force behind the emergence of Software Engineering
• Management’s incompetence in predicting the development cost, time, and effort
• Low quality software
• Increased importance of maintenance
• Developments of hardware and software technologies
• Increased demands on software
46
Software Engineering Layers
1. A quality Focus
: Any engineering approach should be based on the organization’s commitment to quality
4. Tools
: enables rational and timely development of computer software
• (Semi-) Automated support for process/methods
• When tools are integrated
à Info. Created by one tool can be used by another
è Computer-Aided Software Engineering
49
Software Process
Generic Process Framework: the foundation of S/E process
: by identifying a small number of framework activities
: applicable to all software projects, regardless of their size or complexity
52
Software Engineering Practice
1. Understand the Problem
• Who are the stakeholders?
53
Software Engineering Practice
2. Plan the Solution
• Have you seen similar problems before?
‒ Are there patterns that are recognizable in a potential solution?
‒ Is there existing software that implements the required data, functions, and features?
55
Software Engineering Practice
4. Examine the Result
• Is it possible to test each component part of the solution?
• Does the solution produce results that conform to the data, functions,
and features that are required?
56
Software Engineering: General Principles
Seven General Principles from David Hooker
: helps you establish a mind-set for solid software engineering practice
57
Software Engineering: General Principles
Seven General Principles from David Hooker
: helps you establish a mind-set for solid software engineering practice
https://www.innofied.com/7-ways-make-code-reusable/ 59
Software Engineering: General Principles
Seven General Principles from David Hooker
: helps you establish a mind-set for solid software engineering practice
G. Think!
: Placing clear/complete thought before action almost always produces better results.
: If you do think about something and still do it wrong, it becomes a valuable experience.
60
Software Development Myths
Managers
• Often under pressure: budgets, schedules, quality
• Like a drowning person, a manager often grasps at belief in a software myth
Management myths
• We have all the standard and procedures for software developments.
è Are software practitioners aware of its existence? Is it complete? Is it adaptable? …
Customer myths
• A general statements of objectives is sufficient to begin writing programs.
We can fill in the details later.
è An ambiguous “statement of objectives” is a recipe for disaster.
• Until I get the program running, I have no way of assessing its quality.
è Software reviews are a “quality filter” that have been found to be more effective
than testing for finding certain classes of software defects.
• The only deliverable product for a successful project is the working program.
è A working program is only one part. A variety of work products (e.g., models, docs, plans)
provide a foundation for successful engineering and guidance for software support.