So you write embedded software in C and you've read about unit testing. You think unit tests will help you write better software, but how do you actually write code that's testable? What are some coding patterns that make unit testing easier?
Read MoreAdd unit tests to your current project with Ceedling
You want to try unit testing your embedded software but there's a problem -- you've got an existing project and a whole lot of code already written. Maybe it's even embedded legacy code.
Read MoreFor embedded TDD, don't worry so much about testing on the target
If you want to do embedded test-driven development (TDD), running your automated unit tests on the target is too slow. When you're test-driving, you're running the tests very frequently. You will not want to wait for the tests to download to the target. It will disrupt your flow and you'll get more easily distracted.
Read MoreMore flexible mocks for Ceedling with the Fake Function Framework (FFF)
I've created a plug-in for Ceedling which lets you use the Fake Function Framework (instead of CMock) to automatically create the mock interfaces used in your unit tests. You can find the plug-in (along with complete instructions for how to use it) in the GitHub repository.
Read MoreAn Introduction to Unit Testing
Do you write embedded software? Looking for an introduction to unit testing?
I've written a bit of an introduction to unit testing, especially for embedded systems developers.
Read MoreUsing Catch to Write BDD-Style Unit Tests for C
Catch is a unit testing framework that has some interesting (better!) ways to write tests for C and C++.
Instead of naming your tests with function calls, you can write your tests as a nested series of Given-When-Then statements.
Read MoreCMock vs FFF - A Comparison of C Mocking Frameworks
Did you know you have options when it comes to creating mocks for your C-language unit tests?
I've been spending a lot of time working with CMock -- since it's used by Ceedling -- but I've just been checking out FFF (the "fake function framework"). It's well done and I think it deserves a closer look.
Read MoreMocking Embedded Hardware Interfaces with Ceedling and CMock
How can you unit test your embedded software? What about your hardware dependencies?
The secret is mocking.
We can mock the interfaces to our hardware so that we don't need the actual hardware to test.
Read MoreSlicing Embedded Software for Continuous Delivery
The first principle behind the Agile Manifesto is:
Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.
It's the highest priority! This has got to be really important, but why? What good is delivering software that can't do everything the customer wants? Well...
Read MoreWhy I Like to Write the Tests First
If you're on board with unit testing, but not quite sure about test-driven development, I want to share my experience for why I think writing the tests first is the way to go.
Read MoreA Test-Driven Development Environment for the Tiva C Series Launchpad
For embedded test-driven development in C, you need to use a unit test framework to make testing easier. This can take some work to set up. I've created a reproducible environment with Vagrant that you can start using in just a few simple steps.
Read MorePortable, Reproducible Embedded Build Environments with Vagrant
All of your source code is in your version control system, but what about your build environment?
If your development machine crashed, would you be able to recreate your build environment?
Read MoreWhy Isn't Unit Testing Used in Embedded Software?
Unit testing is not widely used in embedded software, but it should be. In my experience the best way to learn is to start writing some unit tests right now.
Read MoreTry Embedded Test-Driven Development Right Now with Ceedling
Maybe you've heard of Test-Driven Development (TDD), and maybe you've even thought it seemed like a reasonable idea. If you haven't tried TDD yet though, you really should. Here's some help to get you started right now.
Read MoreEscape Your Embedded Vendor's IDE
Every embedded processor vendor now has it's own IDE (e.g. MPLAB, Code Composer Studio, etc.) available to embedded software developers, but you shouldn't use it to compile and build your project. Here's why.
Read MoreUsing GCC for Automatic C-Language Dependency Management with Rake
When using a build system for building embedded C applications, we want to be able to automatically track our source file dependencies. This allows us do incremental builds, where each time we build we only build what is necessary based on what has changed. This saves us time...
Read MoreUsing Rake to Build a Simple C Application
In this example we'll set up a simple build system for a C application to be complied with gcc. Using a similar method, we could use a cross-compliler (gcc or otherwise) to compile for whatever embedded target we would like.
Read MoreRake: An Alternative to Make for Embedded C Applications
Make has been traditionally been used for building embedded applications written in C. However Make has its issues. For example, it suffers from heavy reliance upon the host environment, arcane syntax and mysterious bugs due to whitespace issues.
Read More