Software Software development development methodologies for methodologies for embedded systems embedded systems and mobile and mobile applications applications Yolande Berbers Yolande Berbers DistriNet, taskforce “embedded DistriNet, taskforce “embedded systems” systems” Department of Computer Science Department of Computer Science KULeuven, Leuven, Belgium KULeuven, Leuven, Belgium
53
Embed
Software development methodologies for embedded systems and mobile applications Yolande Berbers DistriNet, taskforce embedded systems Department of Computer.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Software Software development development methodologies for methodologies for embedded systems embedded systems and mobile and mobile applicationsapplications
Yolande BerbersYolande Berbers
DistriNet, taskforce “embedded DistriNet, taskforce “embedded systems”systems”Department of Computer ScienceDepartment of Computer ScienceKULeuven, Leuven, BelgiumKULeuven, Leuven, Belgium
22
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
The current software technology cannot always fulfill these higher requirements
too late too expensive too many errors
The current software technology cannot always fulfill these higher requirements
too late too expensive too many errors
Context and problem statementContext and problem statement
• Embedded systems and mobile applications increasing market:
•50 X more embedded processors than PC•growth embedded market will continue, PC market: plateau
functionality and complexity: ever increasing (communication, multi-media, …)
quality requirements are growing (ISO 900x) time-to-market is getting ever smaller
33
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Context and problem statementContext and problem statement
• Information systems even bigger increase in functionality and complexity comparable increase in quality requirements focus on methodological aspects of software production modern methodologies have proven benefits
• clear increase of productivity and quality improvement
• Why can the same not be said for embedded and mobile applications: not enough focus on methodological aspects need for adapted methodologies
44
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
OverviewOverview
• characteristics of problem domain:embedded systems and mobile
applications• design methodologies addressing these
problems• overview of languages and API’s
that address or just do not address these problems
55
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Embedded systems and mobile applications (ES Embedded systems and mobile applications (ES and MA)and MA)
• embedded system = a product with a processor and software software is inextricably bound with the product
software is not sold separately
software gives the added value
product has a well defined functionality
many examples in today's consumer market
many examples in our global infrastructure
• mobile applications applications on mobile devices
are in communication with servers
• mobile applications span both mobile device and server SW
66
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Characteristics of ES and MA (1)Characteristics of ES and MA (1)• can be large and usually very complex
not just proportional to the SLOC related to variety of code need for continuous maintenance
• environments change fast applications should run anywhere
• not just application for one platform• need for device-independent platform to develop applications• need for integration with many different back end or
middleware with particular attention for interoperability, coupling, footprint
• e.g. binary over HTTP: poor interoperability, tight coupling, but light footprint RPC framework: reasonable interop, tight coupling, light footprint messaging: reasonable interop, loose coupling, reasonable footprint XML Web Services: excellent interop., loose coupling, heavy footprint
77
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Characteristics of ES and MA (2)Characteristics of ES and MA (2)
• should be reliable and safe user does not accept malfunctioning (different from
desktop)• functionality of product is what counts
embedded: often software cannot be easily changed• costly when product has to be recalled• gives bad name to companies when it happens
• different software components are active concurrently ES interacts with environment, consisting of concurrent
entities more and more ES and MA are distributed systems
88
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Characteristics of ES and MA (3)Characteristics of ES and MA (3)
• interactions with HW interface HW is not the usual desktop HW
• execute with resource constrains: limited processor power
• possible use of portals to offload tasks limited power usage limited memory
• need for lightweight libraries• need for reduced application footprint• no or minimal garbage collector
• slow, unreliable networks necessity of support of Offline mode use of remote facades (fine-grained object model but
coarse-grained access interface for improved network efficiency)
needs careful protocol design• e.g. server push instead of client pull
99
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Characteristics of ES and MA (4)Characteristics of ES and MA (4)
• privacy concerns data traveling over network needs to be encrypted
• special relation with user mobile applications are perceived differently than
desktops UI is a lot different
• consumer market products must be cheap
• limited memory• cheap processor
time-to-market is extremely small
1010
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Gap between application software and platformGap between application software and platform
• Profile for schedulability, performance and time designed for real-time application domain
• standard means to capture real-time modeling concerns
1818
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Profile for schedulability, performance and timeProfile for schedulability, performance and time
• modeling… resources time & concurrency schedulability, e.g. one of (or a combination of)
• statistical• worst-case/empirical
performance
• and whose info is analyzed and/or synthesized by model processors for automatic analysis (e.g. schedulability)
1919
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
OverviewOverview
• characteristics of problem domain:embedded systems and mobile
applications• design methodologies addressing these
problems UML
• some new features of UML2.0• profile for schedulability, performance, and time
MDA: model driven architecture AOSD: aspect oriented software development
• overview of languages and API’s that address or just do not address these problems
2020
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
MDA: Model Driven ArchitectureMDA: Model Driven Architecture
• Embedded systems and mobile applications need for software that runs on different platforms many design decisions assume some platform
characteristics
• => need for Model Driven Architecture defined by OMG as the next step beyond UML
2121
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
MotivationMotivation
• Platform-independence is central in MDA• Lack of methodological support for separation of
platform-independent and platform-specific concerns prevents exploiting separation PIM/PSM beneficially
(Platform Independent Model/Platform Specific Model)
• Platform-independence is not black-or-white some gaps are too large there are different levels of platform-independence platform characteristics considered throughout the
development
• The levels should be identified and defined
• Preferably, platform characteristics assumed in models should be explicitly defined
2222
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Related models in MDA developmentRelated models in MDA development
platform selection
...platform-independent
design
platform-specific design
request/response
asynchronous messaging
JMS
Any other MOM
CORBA JavaRMI
design
design alternatives
...Abstract
platform
Abstract platform
2323
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
OverviewOverview
• characteristics of problem domain:embedded systems and mobile
applications• design methodologies addressing these
problems UML
• some new features of UML2.0• profile for schedulability, performance, and time
MDA: model driven architecture AOSD: aspect oriented software development
• overview of languages and API’s that address or just do not address these problems
2424
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
AOSD: Aspect Oriented Software DevelopmentAOSD: Aspect Oriented Software Development
• Embedded systems and mobile applications many different concerns, other than business logic
• e.g. privacy• e.g. support for Offline• e.g. good performance
• problem such concerns crosscut an application
• => Aspect Oriented Software Development
• Crosscutting concerns Many technical concerns are coded in multiple business
logic objects : they crosscut
2525
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Logging is not modularizedLogging is not modularized
• where is logging in org.apache.tomcat ? red shows lines of code that handle logging not in just one place not even in a small number of places
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
The symptomsThe symptoms
• Code tangling Business objects simultaneously interact with several
technical concerns Simultaneous presence of elements from each concern's
implementation in the code
• Code scattering crosscutting concerns, spread over many objects, related
implementations also spread over all those objects Example : a system using a database
• performance concerns may affect all the objects accessing the database
2828
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
The architect’s under/over design dilemmaThe architect’s under/over design dilemma
• Predicting the future requirements is a difficult task
• Should an architect include a logging mechanism in a system that does not initially need it? Where should the logging points be ? What information should be logged ?
• Or miss future crosscutting requirements and need to change, or possibly re-implement many parts of the system ?
2929
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
OverviewOverview
• characteristics of problem domain:embedded systems and mobile
applications• design methodologies addressing these
problems• overview of languages and API’s
that address or just do not address these problems
C and C++ in combination with POSIX Java and Java Virtual Machines Real Time Specification of Java (RTSJ) C# and .NET runtime environments
3232
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
CC
• history of C designed 1969-1973 for writing UNIX comes from the traditional procedural family goal: suitable for systems programming
• small and compact• close to the hardware
• popularity of C for ES and MA large ES until 1995:
• only 10 to a few 100 SLOC• primarily to interface with hardware• little or no “intelligence”• C was a good language for this purpose
there is a lot of experience on C programmers of ESW
• in the past: often no computer scientists
3333
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
CC
• problems with C no support for managing complexity
• current ES: a lot more complex than 10 years ago reliability
• problems with weak syntax (e.g. while (x=3) …)• weak typing• pointers (important origin of bugs)
no support for concurrency
3434
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
C: suitability for ES and MAC: suitability for ES and MA
• managing complexity: --
• reliability: --
• concurrency: --
• dealing with time: --
• interaction with HW: ++
• efficiency: ++
• speed of SW development: --
3535
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
C++C++
• history of C++ design in 1983-1985 designed as an extension of C (that is why it is called C++) goal: combination of efficiency of C and Object Orientation
• “solved” problems (??) support for managing complexity
• C++ is OO• OO was introduced to manage complexity and to allow
for reuse reliable
• but pointers remain a problem• no automatic garbage collection• too many possibilities, too much freedom
3636
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
C++C++
• problems with C++ in general many properties with a complex behaviors many properties depend on implementation difficult to predict from basic principles many users choose to use only a subset
• because complete language is too complex and too unpredictable
• problems with C++ for ESW no support for concurrency
3737
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
C++: suitability for ES and MAC++: suitability for ES and MA
• managing complexity: +
• reliability: -
• concurrency: --
• dealing with time: --
• interaction with HW: ++
• efficiency: ++
• speed of SW development: -
3838
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
interlude: concurrencyinterlude: concurrency
• applications that have concurrency: need processes or threads can be offered by a language
• e.g. Java, C#, Ada can be offered by an API, used by a non-concurrent
language• e.g. POSIX in combination with C and C++
• advantages of concurrent programming languages better readability and maintainability of code portable over different operating systems compiler can test on correct use a language offers one view on how to use concurrency, one
integrated way of embedding concurrency in the philosophy of a language, one way of solving concurrency problems
3939
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
POSIXPOSIX
• POSIX = Portable Operating System Interface for Computer Environments IEEE standard (IEEE 1003.1c)
first version 1985 offered as API of operating systems comes from the UNIX world is supported by all UNIX-variations, RTOS, …
POSIX-compliant
offers support for concurrency problem
• offers many (too many) different routines• that have (too) many parameters• programmer is confronted with many details• does not offer one way of doing concurrency
it is a basis on which ALL concurrency philosophies can be implemented
4040
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
JavaJava• originally designed for the “consumer electronics
market” • idea of byte-code• code had to be very reliable• ‘got its breakthrough through the web
• good things about Java known C-like (but better) syntax easier to write bug-free software
• no explicit pointers - no dangling pointers• automatic garbage collection
a lot richer than C with many built-in elements• concurrency• exception-handling• object orientation
easy to learn (a lot easier than C++) byte code for portability extensive class libraries with standardized API : high level
of abstraction (concurrency, networking, GUI)
4141
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Java Java
• problems with Java for ES and MA no direct access to hardware (no pointers, but Java can
call C) size of code is not suitable for many ES
• JVM can be large• Class library is very large
JAR file for full library JDK 1.3: 15MB inefficiencies
• byte code interpretation: a lot slower than C/C++• dynamic loading, garbage collection: cost time
• interpreter of JIT: maybe not the optimal compiler unpredictable
• OOP leads to unpredictability• garbage collector can pre-empt a running task• Just-in-Time compilation slows down first access
• solutions: slimmed versions of Java and JVM
4242
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Java 2 Standard Edition and Java 2 Micro EditionJava 2 Standard Edition and Java 2 Micro Edition
• Java Class Libraries: several “standard platforms” (APIs): Standard Java – full set of libraries for desktops /
workstations: J2SE (Java 2 Standard Edition)
Personal Java – subset for smaller devices was intended for Windows CE; is something of the past
• CLDC = Connected Limited Device Configuration for devices with at least 192 kB RAM 16-bit or 32-bit processor most important target: gsm’s JVM becomes KVM without o.a.
• Floating point (but is included again in newest version); JNI, Reflection, Finalization, user-defined class loaders, Thread groups and daemon threads
Class libraries, subset of a.o. Java.io, Java.lang, Java.util Extra library: Javax.microedition.io (http, sockets) JavaCodeCompact: some Java Classes in C are compiled
and linked with KVM
• only one profile with CLDC: MIDP: Mobile Information Device Profile
adds API for LC displays, media player, API for games
4444
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
• CDC = Connected Device Configuration for devices with at least 2 MB of memory 32-bit processor JVM: no restrictions Class libraries: subset
• 3 profiles Foundation Profile
• with API for resource-constrained devices without GUI• basis java.io, java.lang, java.net + javax.microedition.io
Personal Basis Profile• Idem + basis GUI (part of AWT)
Personal Profile• Idem but fuller AWT and support for applets
4545
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
Java: suitability for ES and MAJava: suitability for ES and MA
• managing complexity: ++
• reliability: ++
• concurrency: ++
• dealing with time: -
• interaction with HW: -
• efficiency: --
• speed of SW development: ++
4646
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion
RTSJRTSJ
• RTSJ: Real-Time Specification for Java mission
• initiatiated in December 1998 – JSR-0001 Sun, IBM (lead participant) and vendors from RTOS
community
• January 2002 – Official final release V1.0
[To extend] The Java Language Specification and The Java Virtual Machine Specification [to provide] an Application Programming Interface that will enable the creation, verification, analysis, execution, and management of Java threads whose correctness conditions include timeliness constraints (also known as real-time threads).
4747
embedded systems andmobileapplications what? characteristicsmethodologies UML MDA AOSDlanguages and platforms C/C++ POSIX Java/RTSJ C#conclusion