Archive for the ‘Embedded TDD’ Category

Spying on Embedded ‘asm’ directives

Thursday, June 2nd, 2011

Sometimes embedded developers have to use inline assembler instructions to get better control of the processor, or to improve performance. How should we deal with those when we’re doing TDD and testing off the target?

What’s the problem? The embedded asm statements cause compilation errors if the assembler instructions are not part of the off-target test platform instruction set. Also some of the instructions might not be legal in the test environment. This article shows how to insert a test double for the asm directives with gcc and CppUTest.

(more…)

Agile Design and Embedded

Thursday, November 12th, 2009

One important realization on the journey from a BDUF approach to an iterative and agile approach is that design is never done. Designs evolve. The waterfall emphasis has been to unnaturally try to control software physics by imposing requirements freezes and burdensome change control. The process of developing software is part science and part creative. You are applying science toward the invention of something. Design is capturing knowledge both about what the end user need is, and one solution to that need.
(more…)

Embedded Memory Constraints and TDD

Tuesday, November 10th, 2009

Constrained Memory is the reality for many embedded developers. Running tests in the development system won’t suffer the same memory constraints found in the target. Here are a few things to help TDD in constrained memory situations.
(more…)

Why Test Driven Development for Embedded?

Wednesday, October 7th, 2009

Embedded software has all the challenges of “regular” software, like poor quality and unreliable schedules. It is just software with some additional challenges. The additional challenges do not disqualify TDD for embedded. TDD even helps with some of those uniquely embedded challenges.
(more…)

What Should you Expect from a Unit Test Harness

Tuesday, October 6th, 2009

A unit test harness’ job is to provide:

  • A concise common language to express test cases
  • A concise common language to express expected results
  • A place to collect all the unit test cases for the project, system, or subsystem
  • The facilities to run the test cases, either in full or partial batches
  • A concise report of the test suite success or failure
  • A detailed report of any test failures

Deep Agile Panel Questions – Change

Wednesday, May 6th, 2009

Prior to the Deep Agile conference, I received a number of questions about getting people to change, to try new things. Change is hard. People need to be motivated to change. “If it ain’t broke, don’t fix it” they say. But there is always some things that are broken.

First there needs to be awareness/acceptance that there are problems to solve. Do a retrospective of the last release. Find the problems that people are passionate about. Try not have blame session. Build a logic chain from the problem to some solution you think will help. Get people to sign up to try the new approach for a month or two, not the rest of their lives. Iterations give a great opportunity for this kind of experimentation.

You have to try things, rather than just talk about them. I am not sure where this quote is from, but it is profound:

“It’s easier to act your way into thinking differently than to think your way into acting differently”

Read on for some specific questions, and my answers.
(more…)

Don’t Let Embedded Tool Chain Slow You Down.

Wednesday, April 1st, 2009

During my TDD session at the Embedded Systems Conference yesterday, I did a demo. Before the demo, I make the case for TDD as a way to prevent bugs (see Physics of TDD). For the live demo I usually code on my mac and run the tests there as well. The question always comes up: “You are running tests on your PC, can you run them on the target?” or maybe “Sure you can TDD on a PC, but what about the real hardware?”
(more…)

Deep Agile Embedded Brain Storm

Tuesday, February 24th, 2009

Let’s say you were an embedded systems developer, and you were planning on attending a conference like the Deep Agile Embedded.

What questions would you hope you could get answers for at the conference?

What if you already knew it all but were sending your boss, co-worker, or CEO who needed to learn more, what would you want them to hear about?

Would you want to do some hands on Test Driven Development?

Here are some of the questions we have so far:
(more…)

Zune Bug: Test Driven Bug Fix

Thursday, February 19th, 2009

The Microsoft Zune 30G had a well known crash to bring in the new year. Here is the snippet of code that is the alleged culprit, from one of MS’s suppliers (Freescale).
(more…)

Crashing Your Way to Great Legacy C Tests

Friday, December 19th, 2008

Adding tests to legacy C or C++ code can be a challenge. Code not designed to be tested won’t naturally be testable. Dependencies will be unmanaged and invisible. Getting that first test written will hurt, a lot. Don’t despair! The first test is the hardest, but subsequent tests are much easier.

Knowing what to do and what to expect, when you start adding tests to your legacy code, can ease the journey. This article will give you an idea of what to expect when getting that first bit of C or C++ into the test harness.
(more…)