1 option
Test-driven development for embedded C / James W. Grenning.
- Format:
- Book
- Author/Creator:
- Grenning, James W., author.
- Language:
- English
- Subjects (All):
- Application software--Development.
- Application software.
- C (Computer program language).
- Physical Description:
- 1 online resource (330 pages) : illustrations
- Edition:
- 1st edition
- Place of Publication:
- Dallas, Texas ; Raleigh, North Carolina : The Pragmatic Bookself, 2011.
- System Details:
- text file
- Summary:
- Another day without Test-Driven Development means more time wasted chasing bugs and watchingyour code deteriorate. You thought TDD was for someone else, but it's not! It's for you, the embedded C programmer. TDD helps you prevent defects and build software with a longuseful life. This is the first book to teach the hows and whys of TDD for C programmers.
- Contents:
- Cover
- Table of Contents
- Foreword by Jack Ganssle
- Foreword by Robert C. Martin
- Acknowledgments
- Preface
- Who Is This Book For?
- How to Read This Book
- The Code in This Book
- Online Resources
- 1. Test-Driven Development
- Why Do We Need TDD?
- What Is Test-Driven Development?
- Physics of TDD
- The TDD Microcycle
- TDD Benefits
- Benefits for Embedded
- Part I-Getting Started
- 2. Test-Driving Tools and Conventions
- What Is a Unit Test Harness?
- Unity: A C-Only Test Harness
- CppUTest: A C++ Unit Test Harness
- Unit Tests Can Crash
- The Four-Phase Test Pattern
- Where Are We?
- 3. Starting a C Module
- Elements of a Testable C Module
- What Does an LED Driver Do?
- Write a Test List
- Writing the First Test
- Test-Drive the Interface Before the Internals
- Incremental Progress
- Test-Driven Developer State Machine
- Tests Are FIRST
- 4. Testing Your Way to Done
- Grow the Solution from Simple Beginnings
- Keep the Code Clean-Refactor as You Go
- Repeat Until Done
- Take a Step Back Before Claiming Done
- 5. Embedded TDD Strategy
- The Target Hardware Bottleneck
- Benefits of Dual-Targeting
- Risks of Dual-Target Testing
- The Embedded TDD Cycle
- Dual-Target Incompatibilities
- Testing with Hardware
- Slow Down to Go Fast
- 6. Yeah, but...
- We Don't Have Time
- Why Not Write Tests After the Code?
- We'll Have to Maintain the Tests
- Unit Tests Don't Find All the Bugs
- We Have a Long Build Time
- We Have Existing Code
- We Have Constrained Memory
- We Have to Interact with Hardware
- Why a C++ Test Harness for Testing C?
- Part II-Testing Modules with Collaborators
- 7. Introducing Test Doubles
- Collaborators
- Breaking Dependencies
- When to Use a Test Double
- Faking It in C, What's Next.
- Where Are We?
- 8. Spying on the Production Code
- Light Scheduler Test List
- Dependencies on Hardware and OS
- Link-Time Substitution
- Spying on the Code Under Test
- Controlling the Clock
- Make It Work for None, Then One
- Make It Work for Many
- 9. Runtime-Bound Test Doubles
- Testing Randomness
- Faking with a Function Pointer
- Surgically Inserted Spy
- Verifying Output with a Spy
- 10. The Mock Object
- Flash Driver
- MockIO
- Test-Driving the Driver
- Simulating a Device Timeout
- Is It Worth It?
- Mocking with CppUMock
- Generating Mocks
- Part III-Design and Continuous Improvement
- 11. SOLID, Flexible, and Testable Designs
- SOLID Design Principles
- SOLID C Design Models
- Evolving Requirements and a Problem Design
- Improving the Design with Dynamic Interface
- More Flexibility with Per-Type Dynamic Interface
- How Much Design Is Enough?
- 12. Refactoring
- Two Values of Software
- Three Critical Skills
- Code Smells and How to Improve Them
- Transforming the Code
- But What About Performance and Size?
- 13. Adding Tests to Legacy Code
- Legacy Code Change Policy
- Boy Scout Principle
- Legacy Change Algorithm
- Test Points
- Two-Stage struct Initialization
- Crash to Pass
- Characterization Tests
- Learning Tests for Third-Party Code
- Test-Driven Bug Fixes
- Add Strategic Tests
- 14. Test Patterns and Antipatterns
- Ramble-on Test Antipattern
- Copy-Paste-Tweak-Repeat Antipattern
- Sore Thumb Test Cases Antipattern
- Duplication Between Test Groups Antipattern
- Test Disrespect Antipattern
- Behavior-Driven Development Test Pattern
- 15. Closing Thoughts
- Part IV-Appendixes
- A1. Development System Test Environment
- Development System Tool Chain.
- Full Test Build makefile
- Smaller Test Builds
- A2. Unity Quick Reference
- Unity Test File
- Unity Test main
- Unity TEST Condition Checks
- Command-Line Options
- Unity in Your Target
- A3. CppUTest Quick Reference
- The CppUTest Test File
- Test Main
- TEST Condition Checks
- Test Execution Order
- Scripts to Create Starter Files
- CppUTest in Your Target
- Convert CppUTest Tests to Unity
- A4. LedDriver After Getting Started
- LedDriver First Few Tests in Unity
- LedDriver First Few Tests in CppUTest
- LedDriver Early Interface
- LedDriver Skeletal Implementation
- A5. Example OS Isolation Layer
- Test Cases to Assure Substitutable Behavior
- POSIX Implementation
- Micrium RTOS Implementation
- Win32 Implementation
- Burden the Layer, Not the Application
- A6. Bibliography
- Index.
- Notes:
- Includes index.
- Description based on print version record.
- ISBN:
- 9781941222997
- 1941222994
- 9781680504880
- 1680504886
- 9781680504897
- 1680504894
- OCLC:
- 1505735847
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.