Skip to Main Content
Test Driven Development for Embedded C
book

Test Driven Development for Embedded C

by James W. Grenning
April 2011
Intermediate to advanced content levelIntermediate to advanced
356 pages
8h 55m
English
Pragmatic Bookshelf
Content preview from Test Driven Development for Embedded C

Code Smells and How to Improve Them

In this section, we’ll look at many of the code smells found in C code. We’ll also envision some design changes that can make the situation better. As I mentioned, Fowler has a list of code smells, but his list is more suitable for the smells found in code written in an object-oriented programming language. Some apply to C, but then C also has its own common smells.

Duplicate Code

Duplicate code is essentially the root cause of most code smells. The problems of duplication are well known and were discussed earlier in DRY: Don’t Repeat Yourself .

Bad Names

Good names make code easier to understand; bad names make code obscure. Sometimes you’d think there is a penalty for using vowels or whole words ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Design Patterns for Embedded Systems in C

Design Patterns for Embedded Systems in C

Bruce Powel Douglass

Publisher Resources

ISBN: 9781941222997Errata Page