The Complete Edition – Software Engineering for Real-Time Systems

Book description

Adopt a diagrammatic approach to creating robust real-time embedded systems

Key Features

  • Explore the impact of real-time systems on software design
  • Understand the role of diagramming in the software development process
  • Learn why software performance is a key element in real-time systems

Book Description

From air traffic control systems to network multimedia systems, real-time systems are everywhere. The correctness of the real-time system depends on the physical instant and the logical results of the computations. This book provides an elaborate introduction to software engineering for real-time systems, including a range of activities and methods required to produce a great real-time system.

The book kicks off by describing real-time systems, their applications, and their impact on software design. You will learn the concepts of software and program design, as well as the different types of programming, software errors, and software life cycles, and how a multitasking structure benefits a system design.

Moving ahead, you will learn why diagrams and diagramming plays a critical role in the software development process. You will practice documenting code-related work using Unified Modeling Language (UML), and analyze and test source code in both host and target systems to understand why performance is a key design-driver in applications.

Next, you will develop a design strategy to overcome critical and fault-tolerant systems, and learn the importance of documentation in system design.

By the end of this book, you will have sound knowledge and skills for developing real-time embedded systems.

What you will learn

  • Differentiate between correct, reliable, and safe software
  • Discover modern design methodologies for designing a real-time system
  • Use interrupts to implement concurrency in the system
  • Test, integrate, and debug the code
  • Demonstrate test issues for OOP constructs
  • Overcome software faults with hardware-based techniques

Who this book is for

If you are interested in developing a real-time embedded system, this is the ideal book for you. With a basic understanding of programming, microprocessor systems, and elementary digital logic, you will achieve the maximum with this book. Knowledge of assembly language would be an added advantage.

Table of contents

  1. Preface
  2. 1. Real-Time Systems – Setting the Scene
    1. 1.1 Categorizing Computer Systems
    2. 1.2 Real-Time Computer Systems
      1. 1.2.1 Time and Criticality Issues
      2. 1.2.2 Real-Time System Structures
      3. 1.2.3 Characteristics of Embedded Systems
    3. 1.3 The Computing Elements of Real-Time Systems
      1. 1.3.1 Overview
      2. 1.3.2 General-Purpose Microprocessors
      3. 1.3.3 Highly Integrated Microprocessors
      4. 1.3.4 Single-Chip Microcomputers
      5. 1.3.5 Single-Chip Microcontrollers
      6. 1.3.6 Digital Signal Processors
      7. 1.3.7 Mixed-Signal Processors
      8. 1.3.8 System-On-Chip Designs – Overview
      9. 1.3.9 Programmable SOCs – FPGA-Embedded Processors
      10. 1.3.10 SOC Devices – Single and Multicore
    4. 1.4 Software for Real-Time Applications – Some General Comments
    5. 1.5 Review
    6. 1.6 Useful Reading Material
  3. 2. The Search for Dependable Software
    1. 2.1 What Do We Want in Our Software?
    2. 2.2 Software Errors
      1. 2.2.1 Overview
      2. 2.2.2 System Design Errors
      3. 2.2.3 Design and Coding Errors
      4. 2.2.4 Environmental Factors
      5. 2.2.5 Why Do We Get Poor Software?
      6. 2.2.6 Testing – How Useful?
    3. 2.3 The Basics of Good Software
      1. 2.3.1 General
      2. 2.3.2 Specification Correctness
      3. 2.3.3 Feasibility and Suitability
      4. 2.3.4 Modularization
      5. 2.3.5 Portability and Reusability
      6. 2.3.6 Error Avoidance and Defensive Programming – Robust Programs
      7. 2.3.7 Design Codes of Practice – Style, Clarity, and Documentation
    4. 2.4 A Final Comment
    5. 2.5 Review
    6. 2.6 References
  4. 3. First Steps – Requirements Analysis and Specification
    1. 3.1 The Software Life Cycle
      1. 3.1.1 Introduction
      2. 3.1.2 A Mythical Model of the Software Life Cycle
      3. 3.1.3 Bringing Realism to the Life Cycle
      4. 3.1.4 Requirements Issues – a Practical Approach
    2. 3.2 The Importance of the Requirements Stage
    3. 3.3 Making Mistakes – Sources and Causes
      1. 3.3.1 A General Comment
      2. 3.3.2 Problems in Formulating Specifications
      3. 3.3.3 Problems in Communicating Requirements
      4. 3.3.4 Problems in Understanding Requirements
    4. 3.4 Practical Approaches to Analysis and Specification
      1. 3.4.1 General Aspects
      2. 3.4.2 Tool Support and Automation
      3. 3.4.3 Viewpoint Analysis
      4. 3.4.4 Viewpoints – Analysis versus Specification
      5. 3.4.5 Use Case Analysis
      6. 3.4.6 Functional, Non-Functional, and Development Requirements Specifications
    5. 3.5 Communication Aspects – the Role of Prototyping
      1. 3.5.1 Prototyping – an Introduction
      2. 3.5.2 Software Prototyping
      3. 3.5.3 Requirements Prototyping
      4. 3.5.4 Practical Rapid Prototyping of System Requirements
      5. 3.5.5 Animation Prototyping – Concepts and Application
    6. 3.6 Review
    7. 3.7 Exercises
    8. 3.8 References and Further Reading
  5. 4. Software and Program Design Concepts
    1. 4.1 Design Fundamentals
      1. 4.1.1 The Design and Development Process – an Introduction
      2. 4.1.2 Fundamental Design Strategies
      3. 4.1.3 How to Generate Abysmal Software – the Good Kludge Guide
    2. 4.2 The Elements of Modular Design
      1. 4.2.1 Introduction
      2. 4.2.2 Modules and Modularization
      3. 4.2.3 Coupling – a Measure of Module Independence
      4. 4.2.4 Cohesion – a Measure of Module Binding
      5. 4.2.5 Size and Complexity
      6. 4.2.6 Some General Comments on Modules
    3. 4.3 Program Control Structures – the Influence of Structured Programming
      1. 4.3.1 Introductory Comments
      2. 4.3.2 Fundamental Control Structures
      3. 4.3.3 Uncontrolled Branching of Control – the Great GOTO Debate
    4. 4.4 Structured Software Designs
      1. 4.4.1 Background
      2. 4.4.2 Problem Decomposition Using Abstract Machines
      3. 4.4.3 Example Implementation
    5. 4.5 Object-Oriented Design
      1. 4.5.1 An Introduction
      2. 4.5.2 Object-Oriented Design – the Identification Process
      3. 4.5.3 Relationships and Communication between Objects
      4. 4.5.4 Object Interfaces
      5. 4.5.5 Object-Oriented Design – Implementation-Related Issues
      6. 4.5.6 Reuse and Runtime Flexibility Issues
      7. 4.5.7 Composite Objects – Aggregation
      8. 4.5.8 Devising the Object Model – a Responsibility-Based Technique
    6. 4.6 Functionally Structured Design and Functional Flow Modeling
      1. 4.6.1 Software Design and Structured Charts – Limitations
      2. 4.6.2 The Materials Flow Model of Software Processing
      3. 4.6.3 Software Design Using Functionally Structured Techniques
      4. 4.6.4. Organizing the Execution Sequence of the Software Machines
      5. 4.6.5 Functional Flow Design Using Graphical Techniques
    7. 4.7 Design Patterns
      1. 4.7.1 Introduction and Basic Concepts
      2. 4.7.2 Program-Level Patterns
      3. 4.7.3 System-Level Patterns for Real-Time Embedded Systems
    8. 4.8 Review
    9. 4.9 Exercises
    10. 4.10 Useful Reading Material
  6. 5. Multitasking Systems – an Introduction
    1. 5.1 The Task Model of Software
      1. 5.1.1 Modeling – What and Why
      2. 5.1.2 Modeling Executing Software – the Single-Task Structure
      3. 5.1.3 Multiple Tasks – Why?
      4. 5.1.4 Using Interrupts to Concurrent Task Operations
      5. 5.1.5 Introduction to the Operating System
    2. 5.2 Controlling Task Execution – Scheduling
      1. 5.2.1 Scheduling and Time Slicing Operations
      2. 5.2.2 Scheduling and Priority-Driven Operations
      3. 5.2.3 System Responsiveness and Mixed Scheduling Policies
    3. 5.3 Sharing Resources in Multitasking Systems
      1. 5.3.1 Problems with Sharing Resources
      2. 5.3.2 The Binary Semaphore
      3. 5.3.3 The General or Counting Semaphore
      4. 5.3.4 Semaphore Weaknesses
      5. 5.3.5 The Mutex
      6. 5.3.6 The Simple Monitor
    4. 5.4 Contention Problems in Multitasking Systems
      1. 5.4.1 Resource Contention and Deadlocks
      2. 5.4.2 The Priority Inversion Problem
      3. 5.4.3 The Priority Ceiling Protocol
    5. 5.5 Inter-task Communication
      1. 5.5.1 Introduction
      2. 5.5.2 Task Coordination and Synchronization without Data Transfer – General Aspects
      3. 5.5.3 Task Interaction without Data Transfer
      4. 5.5.4 Data Transfer without Task Synchronization or Coordination
      5. 5.5.5 Task Synchronization with Data Transfer
    6. 5.6 Review
    7. 5.7 Background Reading Material
  7. 6. Diagramming – an Introduction
    1. 6.1 Diagrams – Why?
      1. 6.1.1 Introduction
      2. 6.1.2 Diagrams as a Design Tool
      3. 6.1.3 Diagrams for Design Documentation
      4. 6.1.4 Diagrams for Maintenance
      5. 6.1.5 Diagrams for Communication
    2. 6.2 The Essentials of Software Diagrams
      1. 6.2.1 Fundamentals
      2. 6.2.2 Basic Qualities
      3. 6.2.3 Real-Time Systems Diagramming – Matching Ends to Needs
      4. 6.2.4 Practical Diagramming Techniques – a General Comment
    3. 6.3 Review
    4. 6.4 Exercises
    5. 6.5 References and Further Reading
  8. 7. Practical Diagramming Methods
    1. 7.1 Introduction
    2. 7.2 Diagrams for Functionally Structured Methods
      1. 7.2.1 Context Diagrams
      2. 7.2.2 Entity-Relationship Diagrams (ERDs)
      3. 7.2.3 State Transition Diagrams and State Transition Tables
      4. 7.2.4 Functional and Data Flow Diagrams
      5. 7.2.5 Specifying Program Structures – Structure Charts, Flowcharts, and Program Description Languages
      6. 7.2.6 Message Sequence Diagrams
      7. 7.2.7 SDL (Specification and Description Language) Process Diagrams
      8. 7.2.8 Event-Response Lists
    3. 7.3 UML Diagrams for Object-Oriented Designs
      1. 7.3.1 Use Case Diagrams
      2. 7.3.2 Deployment Diagrams
      3. 7.3.3 Packages and Package Diagrams
      4. 7.3.4 Class Diagrams
      5. 7.3.5 Object and Object Communication Diagrams
      6. 7.3.6 Wiring Objects Together – Ports and Interfaces
      7. 7.3.7 Statecharts
      8. 7.3.8 Sequence Diagrams
      9. 7.3.9 Activity Diagrams
      10. 7.3.10 Components and Component Diagrams
      11. 7.3.11 Artifacts
    4. 7.4 Extensions, Variations, and Project-Specific Diagrams
    5. 7.5 Diagrams and the Design Process
    6. 7.6 Review
    7. 7.7 Exercises
    8. 7.8 References and Further Reading
  9. 8. Designing and Constructing Software – Code-Related Issues
    1. 8.1 Fundamental Design and Construction Methods
      1. 8.1.1 Introduction
      2. 8.1.2 An Evaluation of Design and Construction Methods
    2. 8.2 Code Development and Packaging
      1. 8.2.1 Code Development and the Physical Software Model
      2. 8.2.2 Software Construction Methods – General
      3. 8.2.3 Introduction to Component Technology
      4. 8.2.4 Code Packaging and Components
      5. 8.2.5 Classes, Packages, and Artifacts
    3. 8.3 Important Features of Programming Languages
      1. 8.3.1 Introduction
      2. 8.3.2 Choosing a Programming Language – the Real Questions
      3. 8.3.3 High-Level Languages – General Requirements
      4. 8.3.4 Modularity, Encapsulation, and Information Hiding
      5. 8.3.5 Program Syntax and Layout Rules – the Readability Factor
      6. 8.3.6 Variable Usage – Scope, Visibility, Lifetime, and Declaration.
      7. 8.3.7 Data Types – Concepts and Uses
      8. 8.3.8 Program Flow Control
      9. 8.3.9 Interfacing to Other Languages
      10. 8.3.10 Exception Handling
      11. 8.3.11 Accessing Processor Hardware – Low-Level Facilities
      12. 8.3.12 Assembly Language Programming
      13. 8.3.13 Miscellaneous Items
    4. 8.4 Choosing a High-Level Language for Embedded Systems
      1. 8.4.1 Basic Requirements
      2. 8.4.2 Assessed Languages – Background
      3. 8.4.3 Assessed Languages – Comparison and Comment
      4. 8.4.4 Python and MicroPython
    5. 8.5 Review
    6. 8.6 Important and Useful Reading
  10. 9. Software Analysis and Design – Methods and Methodologies
    1. 9.1 The Development Process
      1. 9.1.1 General Description
      2. 9.1.2 Methods, Methodologies, and Tools
    2. 9.2 Viewpoint Analysis for Deriving Requirements
      1. 9.2.1 Viewpoint Analysis and CORE
      2. 9.2.2 CORE Fundamentals
      3. 9.2.3 Detailed Aspects and Notation
      4. 9.2.4 Design Example – Steam Propulsion System
      5. 9.2.5 A Comment on Analysis Tools
    3. 9.3. Design Implementation Using Functionally Structured Techniques
      1. 9.3.1 Overview of the Design Process
      2. 9.3.2 Developing the Ideal Model
      3. 9.3.3 Developing the Practical Model
    4. 9.4 Object-Oriented Analysis and Design
      1. 9.4.1 Design Example – Dipmeter Wireline Logging Tool
      2. 9.4.2 A Practical OOAD Development Process
      3. 9.4.3 Defining System Usage
      4. 9.4.4 Developing the Subsystem Structures
      5. 9.4.5 Developing the Ideal Model Object Structures
      6. 9.4.6 Developing the Specification Model Object Structures
      7. 9.4.7 Developing the Individual Processor Object Models
      8. 9.4.8 Developing the Multitasking Model
      9. 9.4.9 Developing Individual Tasks
      10. 9.4.10 Packaging the Software
    5. 9.5 Model-Driven Architecture
      1. 9.5.1 Fundamental Concepts
      2. 9.5.2 The PIM in Detail
      3. 9.5.3 Example Structural Model – from PIM to PSM to Code
      4. 9.5.4 Closing Comments
    6. 9.6 Model-Based Design (MBD)
      1. 9.6.1 MBD versus MDA
      2. 9.6.2 MBD – an Overview
      3. 9.6.3 Applying the MBD Process – a Brief Outline
    7. 9.7 Agile Software Development
      1. 9.7.1 Introduction and Basic Concepts
      2. 9.7.2 Agile Methods for Embedded Applications – the Interface Issue
      3. 9.7.3 The Issue of Project Development Methods – Agile versus Embedded
      4. 9.7.4 Practical Incremental Development Methods for Embedded Systems
    8. 9.8 Review
    9. 9.9 Further Useful Reading
  11. 10. Analyzing and Testing Source Code
    1. 10.1 Introduction
      1. 10.1.1 General Concepts
      2. 10.1.2 Software Evaluation Issues
      3. 10.1.3 Software Testing – the Broader Issues
    2. 10.2 Static Analysis
      1. 10.2.1 Introduction
      2. 10.2.2 Manual Static Analysis Methods
      3. 10.2.3 Automated Static Analysis Methods
    3. 10.3 Source Code Metrics – Code Size, Content, and Complexity
      1. 10.3.1 General
      2. 10.3.2 Halstead Software Metrics
      3. 10.3.3 The McCabe Cyclomatic Complexity Metric
    4. 10.4 Dynamic Analysis – Testing and Coverage Analysis
      1. 10.4.1 Overview of Dynamic Testing
      2. 10.4.2 Dynamic Testing in a Manual Environment
      3. 10.4.3 Dynamic Testing in an Automated Environment
      4. 10.4.4. Coverage Analysis
      5. 10.4.5. Practical Automated Dynamic Analysis
    5. 10.5 Integration Testing
      1. 10.5.1 Fundamentals
      2. 10.5.2 Integration and Test Strategies (1) – Combined Module and Integration Testing
      3. 10.5.3 Integration and Test Strategies (2) – Integration Testing Based on Unit Calls
      4. 10.5.4 Integration Complexity
    6. 10.6 Metrics for OO Designs
      1. 10.6.1 General Aspects
      2. 10.6.2 Inheritance, Polymorphism, and Testing Issues
    7. 10.7 Review
    8. 10.8 Further Reading
  12. 11. Development Tools
    1. 11.1 An Outline of the Modern Development Process for Embedded Systems
    2. 11.2 The Software Development Process for Embedded Systems
      1. 11.2.1 The Software Production Cycle
      2. 11.2.2 Programming the Target Microcontroller
      3. 11.2.3 Simplifying the Process – Processor Configuration Tools
      4. 11.2.4 Finding and Fixing Software Problems
      5. 11.2.5 The Basics of Efficient Development Processes
    3. 11.3 Software Debugging – What and Why?
      1. 11.3.1 Debugging – Fundamental Concepts
      2. 11.3.2 Debugger – Basic Requirements and Operation
      3. 11.3.3 Development and Debugging Environments
    4. 11.4 Software Debugging on the Host
      1. 11.4.1 Host System Debugging – a Broad Overview
      2. 11.4.2 The Pros and Cons of Host System Debugging
    5. 11.5 Software Debugging on the Target – Software-Based Techniques
      1. 11.5.1 General
      2. 11.5.2 A Simple Monitor Program
      3. 11.5.3 In-Target Source-Level Debugging
      4. 11.5.4 The Last Comment
    6. 11.6 Software Debugging in the Target – Hardware-Based Methods
      1. 11.6.1 Introduction
      2. 11.6.2 A Basic Test Tool – the Bus Monitor
      3. 11.6.3 The Logic Analyzer
      4. 11.6.4 The In-Circuit Emulator
    7. 11.7 Software Debugging in The Target – Combined Hardware/Software Techniques
      1. 11.7.1 Host/Target Interactive Debugging – Software Tracing
      2. 11.7.2 On-Chip Debugging Methods – Overview
      3. 11.7.3 Simple Static On-Chip Debugging Methods
      4. 11.7.4 Dynamic OCD Schemes
    8. 11.8 Debugging in Host-As-Target Combinations
      1. 11.8.1 Background
      2. 11.8.2 PC-Based Targets – The Embedded PC
      3. 11.8.3 A PC as a Target
    9. 11.9 Testing Multitasking Software
      1. 11.9.1 Basic Issues
      2. 11.9.2 Practical Tool Aspects
    10. 11.10 Installing Code on the Target – Non-Volatile Software (Firmware)
      1. 11.10.1 Overview
      2. 11.10.2 The PROM Programmer
      3. 11.10.3 EPROM Emulators
      4. 11.10.4 In-Circuit Programming
    11. 11.11 Integrated Development Toolsets
      1. 11.11.1 Backend Toolsets
      2. 11.11.2 Fully Integrated Real-Time Development Environments
    12. 11.12 Review
  13. 12. Mission-Critical and Safety-Critical Systems
    1. 12.1 Introduction
      1. 12.1.1 Overview of Critical Systems
      2. 12.1.2 How Critical is Critical?
      3. 12.1.3 Improving System Reliability and Availability – General Strategies
    2. 12.2 System Specification Aspects
      1. 12.2.1 The Specification Problem – Again
      2. 12.2.2 Why Mathematics?
      3. 12.2.3 Formal Methods – General Concepts
      4. 12.2.4 Formal Specification Languages
      5. 12.2.5 An Example Formal Specification Using VDM
    3. 12.3 Numerical Issues
      1. 12.3.1 Problems in Disguise
      2. 12.3.2 Making Measurements
      3. 12.3.3 Basic Number Representation and Arithmetic
      4. 12.3.4 The Limitations of Finite Number Systems – General Points
      5. 12.3.5 Infinite Numbers, Model Numbers, and Error Bounds
      6. 12.3.6 Problems in Floating-Point Working
      7. 12.3.7 Problems in Fixed-Point Working
      8. 12.3.8 Internal Representation and Binary Notation
    4. 12.4 Application Software Aspects
      1. 12.4.1 Basic Design and Programming Issues (or Doing It Right in the First Place)
      2. 12.4.2 Dealing with Runtime Problems
    5. 12.5 Real-World Interfacing
      1. 12.5.1 Background
      2. 12.5.2 Fault Types and Identification – Inputs
      3. 12.5.3 Fault Detection Methods – Inputs
      4. 12.5.4 Fault Handling – Outputs
    6. 12.6 Operating Systems Aspects
      1. 12.6.1 General
      2. 12.6.2 Protection Techniques
      3. 12.6.3 Tasking Models and Scheduling
      4. 12.6.4 Operating Systems and Critical Distributed Applications
    7. 12.7 Processor Problems
      1. 12.7.1 Overview
      2. 12.7.2 Power-On Aspects
      3. 12.7.3 Runtime Issues
    8. 12.8 Hardware-Based Fault Tolerance
      1. 12.8.1 General Aspects
      2. 12.8.2 Fault-Tolerant Structures
      3. 12.8.3 Matching Structures to Requirements
    9. 12.9 Review
    10. 12.10 References and Further Reading
    11. 12.11 Some Important Standards
  14. 13. Performance Engineering
    1. 13.1 Why Performance Engineering Is Important
      1. 13.1.1 Time as a Design Driver
      2. 13.1.2 Ignore Performance at Your Peril – Reactive versus Proactive Techniques
    2. 13.2 Performance Engineering – Requirements, Targets, and Achievables
    3. 13.3 Top-Down (Requirements-Driven) Performance Modeling
      1. 13.3.1 Specifying Targets – the Project-Management Analogy
      2. 13.3.2 Performance Targets and Time Budgeting in Real-Time Systems
    4. 13.4 Bottom-Up (Results-Driven) Performance Modeling
    5. 13.5 Middle-Out (Risk-Driven) Performance Modeling
    6. 13.6 Some Practical Issues in Performance Engineering
      1. 13.6.1 A General Comment
      2. 13.6.2 Modeling and Simulation Options
    7. 13.7 Review
    8. 13.8 References and Further Reading
  15. 14. Documentation
    1. 14.1 Documentation – What and Why?
      1. 14.1.1 The Role of Documentation
      2. 14.1.2 Documentation – Its Structure
      3. 14.1.3 A Model for System Documentation
    2. 14.2 Software Life Cycle Documentation – Overview
    3. 14.3 System Functional Specifications
      1. 14.3.1 Overview
      2. 14.3.2 Block Diagram Description
      3. 14.3.3 Functional Diagram Description
      4. 14.3.4 Requirements Specification
    4. 14.4 Software System Specifications
    5. 14.5 Source Code Aspects
      1. 14.5.1 Source Code Documentation – a Philosophy
      2. 14.5.2 Source Code Documentation – Practice
      3. 14.5.3 Source Code Review Documentation
    6. 14.6 Configuration Management and Version Control
      1. 14.6.1 General Aspects
      2. 14.6.2 More on Source Code Version Control
    7. 14.7 Review
    8. 14.8 Further Information
  16. Glossary of terms

Product information

  • Title: The Complete Edition – Software Engineering for Real-Time Systems
  • Author(s): Jim Cooling
  • Release date: December 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781839216589