وبلاگ بلیان

Patterns in the Machine : A Software Engineering Guide to Embedded Development

جلد کتاب Patterns in the Machine : A Software Engineering Guide to Embedded Development

معرفی کتاب «Patterns in the Machine : A Software Engineering Guide to Embedded Development» نوشتهٔ Barbara Sher و John T. Taylor,Wayne T. Taylor (auth.)، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2021. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

Discover how to apply software engineering patterns to develop more robust firmware faster than traditional embedded development approaches. In the authors’ experience, traditional embedded software projects tend towards monolithic applications that are optimized for their target hardware platforms. This leads to software that is fragile in terms of extensibility and difficult to test without fully integrated software and hardware. Patterns in the Machine focuses on creating loosely coupled implementations that embrace both change and testability. This book illustrates how implementing continuous integration, automated unit testing, platform-independent code, and other best practices that are not typically implemented in the embedded systems world is not just feasible but also practical for today’s embedded projects. After reading this book, you will have a better idea of how to structure your embedded software projects. You will recognize that while writing unit tests, creating simulators, and implementing continuous integration requires time and effort up front, you will be amply rewarded at the end of the project in terms of quality, adaptability, and maintainability of your code. What You Will Learn Incorporate automated unit testing into an embedded project Design and build functional simulators for an embedded project Write production-quality software when hardware is not available Use the Data Model architectural pattern to create a highly decoupled design and implementation Understand the importance of defining the software architecture before implementation starts and how to do it Discover why documentation is essential for an embedded project Use finite state machines in embedded projects Who This Book Is For Mid-level or higher embedded systems (firmware) developers, technical leads, software architects, and development managers. Table of Contents 5 About the Authors 12 About the Technical Reviewer 13 Acknowledgments 14 Preface 15 Chapter 1: Introduction 16 Patterns in the Machine 18 What Is Software Engineering? 19 Software Engineering Best Practices 20 What PIM Is Not 22 What You’ll Need to Know 23 Chapter 2: Core Concepts 24 Software Architecture 24 Automated Unit Testing 25 Functional Simulator 27 Continuous Integration 28 Data Model 31 Finite State Machines 35 Documentation 37 Chapter 3: Design Theory for Embedded Programming 40 SOLID 41 Single Responsibility Principle 42 Open-Closed Principle 43 Using ifndef 45 Using Model Points 45 Using Abstract Interfaces 47 OCP Flexibility 48 Liskov Substitution Principle 48 Interface Segregation Principle 49 Dependency Inversion Principle 51 Binding Time 53 Source Time Binding 54 Compile Time Binding 55 Link Time Binding 56 A SOLID Conclusion 57 Chapter 4: Persistent Storage Detailed Design Example 58 Persistent Storage Example 58 Software Requirements 58 High-Level Design 59 A Monolithic Detailed Design 60 A PIM-Informed Detailed Design 61 Benefits of the PIM Design 64 Expanded Layering 65 Example PIM Thermostat Application 68 High-Level Design 69 Detailed Design 71 The PIM-ness in the Design 75 The PIM Dilemma 77 Chapter 5: Software Architecture 78 About the Software Architect 78 About Software Architecture Documents 79 Major Sub-systems 81 Major Interface Semantics 83 Threading and Processor Model 85 Communications Mechanisms 85 Memory Strategy or Rules 86 Performance Requirements and Constraints 87 Hardware Interfaces 88 Operating System 91 Third-Party Software 91 Functional Simulator 92 File Organization 93 Localization and Internationalization 94 Conventions 94 Unit Test Strategy 95 Build System 95 Creating “Real” Architecture Documents 97 Chapter 6: Unit Testing 98 What Is a Unit Test? 99 Source Directories and Unit Tests 101 Manual Unit Tests 102 Automated Unit Tests 103 Code Coverage Metrics 104 About Testing Frameworks 106 Continuous Integration 107 Tips for Unit Testing 108 Minimize Dependencies 108 Use Abstract Interfaces 108 Use the Data Model Pattern 109 Test Early 109 Develop and Test Incrementally 109 The Dark Side of Unit Testing 110 Unit Testing vs. Integration Testing vs. System Testing 111 Chapter 7: Functional Simulator 112 Operating System Abstraction Layer 114 Hardware Abstraction Layer 114 Main Pattern 114 Simulated Time 116 How to Implement Simulated Time 116 Platform Boundaries 117 Mocked Simulation 118 Simulated Devices 118 Emulated Devices 118 Simulated Use Cases 119 A Simulated LCD 119 An Algorithm with Simulated Time 119 A Model Simulator with Simulated Time 120 A Communication Channel 120 The Functional Simulator for the Thermostat Example 121 Chapter 8: Continuous Integration 122 Implementing Continuous Integration 123 Continuous Integration and PIM 124 About the Build Machine 125 Maximizing Build Machine Performance 126 About Software Configuration Management 127 Implementing Branching Strategies 128 About Formal Builds 129 About the Build Automation Tool 129 About Build Scripts 131 Chapter 9: The Data Model Architecture 134 Additional Model Point Features 141 Model Points vs. Global Variables 148 Chapter 10: Finite State Machines 151 Example of a Thermostat FSM 152 State Tables 155 Design vs. Implementation 156 Code Generation Is a Good Thing 159 Tips, Hints, and Suggestions 162 Chapter 11: Documentation 167 Documenting Header Files 168 Document First, Then Implement 172 Documenting Your Development Process 173 Document Your Software Architecture and Design 175 Document Your Team’s Best Practices 176 Chapter 12: File Organization and Naming 177 Organizing Files by Namespace 177 Organizing External Packages 181 Naming 183 Naming Recommendations for C++ 184 Naming Recommendations for C 185 Chapter 13: More About Late Binding 188 LHeader 188 Implementation Example 190 Caveat Implementor 193 LConfig 194 Chapter 14: Initialization and the Main Pattern 196 Staged Initialization 199 About Open/Close with Inter-thread Communication 203 Main Pattern 204 Main Minor 205 Main Major 209 Chapter 15: More Best Practices 214 Avoid Dynamic Memory Allocation 214 Documenting Header Files 216 Interfaces and More Interfaces 219 Compile Time Binding 219 Link Time Binding 222 C++ Pure Virtual and Virtual Constructs 226 Data Model 227 Build System 229 Chapter 16: PIM Thermostat Example 231 Features and Requirements 231 Target Hardware 233 Installation and Setup 235 Linux Setup 236 Windows Setup 236 Building 239 Building on Linux with the GCC Compiler 240 Building on Windows with the Visual Studio Compiler 241 Build Directory Naming Conventions 243 PIM Thermostat Application Usage 246 Running on the Target Hardware 246 Functional Simulator 247 Command-Line Interface (CLI) 247 CLI—Basic Help 247 CLI—Running Cooling 248 Documentation 251 About NQBP 252 Installing NQBP 253 NQBP Usage 254 NQBP Build Model 254 NQBP Object Files vs. Libraries 254 NQBP Build Variants 256 NQBP Build Scripts 256 Selecting What to Build with NQBP 257 NQBP Extras 259 Colony.core 261 Colony.Apps 265 Colony.Arduino 265 RATT 266 Chapter 17: The Tao of Development 267 John’s Rules of Development 267 Wayne’s Rules of Development 273 Appendix A: Terminology 277 Appendix B: State Machine Notation 280 Appendix C: A UML Cheat Sheet 283 Appendix D: Why C++ 284 Appendix E: About Package Management with Outcast 288 Outcast 289 Outcast Model 290 Appendix F: Requirements vs. Design Statements 293 Index 296
دانلود کتاب Patterns in the Machine : A Software Engineering Guide to Embedded Development