Do embedded programming by test-driven development with google test-SOLID design-

Introduction

[Amazon.co.jp: Embedded programming with test-driven development-Agile design learned in C language and object orientation](https://www.amazon.co.jp/%E3%83%86%E3%82%B9 % E3% 83% 88% E9% A7% 86% E5% 8B% 95% E9% 96% 8B% E7% 99% BA% E3% 81% AB% E3% 82% 88% E3% 82% 8B% E7 % B5% 84% E3% 81% BF% E8% BE% BC% E3% 81% BF% E3% 83% 97% E3% 83% AD% E3% 82% B0% E3% 83% A9% E3% 83 % 9F% E3% 83% B3% E3% 82% B0-% E2% 80% 95C% E8% A8% 80% E8% AA% 9E% E3% 81% A8% E3% 82% AA% E3% 83% 96% E3% 82% B8% E3% 82% A7% E3% 82% AF% E3% 83% 88% E6% 8C% 87% E5% 90% 91% E3% 81% A7% E5% AD% A6% E3% 81% B6% E3% 82% A2% E3% 82% B8% E3% 83% A3% E3% 82% A4% E3% 83% AB% E3% 81% AA% E8% A8% AD% E8% A8% 88-James-W-Grenning / dp / 4873116147)

Let's prevent those who start learning with this book from stumbling in the environment construction! This is the final episode of the series that started in. Click here for a list of the series so far.

Embedded programming by test-driven development with googletest Embedded programming by test-driven development with google test Chapter 8 Embedded programming by test-driven development-mock & flash driver-

SOLID design

In this chapter, we will transform the tightly coupled LED driver controller into a dynamic interface by applying the SOLID principle of open / closed and Liskov substitution. See the book for details.

[Tightly coupled LED driver controller] tightly_coupled_design.png

↑ to ↓.

[LED driver controller to which the SOLID principle is applied] solid_design.png

Repository

https://github.com/tomoyuki-nakabayashi/TDDforEmbeddedC_SolidDesign Ready commit: SHA:4b0857eeb273736d7e5cf9d2c424e99797f31fbd

This time, it took a lot of time to prepare. (There is a lot of noise in the sample ...) If you want to proceed while copying the book, start with the commit in ↑.

at the end

This book explains not only how to do TDD in C language, but also how to realize a flexible design that is easy to test in C language. For that purpose, it is necessary to make effective use of function pointers. As pointed out in the book, function pointers play an important role in design and are often overlooked by C programmers (including myself). This book, where you can learn such important techniques, is extremely valuable and I hope that many embedded programmers will read it.

C programming with TDD is a lot of fun. We hope this article will help programmers working in embedded development get started with TDD in C.

We are currently preparing a build environment for CMake. We plan to build an environment so that you can study in a wide range of environments.

Recommended Posts

Do embedded programming by test-driven development with google test-SOLID design-
Do embedded programming with test-driven development with googletest
Do embedded programming with test-driven development with googletest Chapter 8
Test embedded software with Google Test
GUI development with Fyne by Go
Google App Engine development with Docker
What you can do with programming skills