dual target embedded C

  1. Challenge for TDD Embedded is:

    1. Without a standard C libraries which always ready on build x86 machines

    2. HW dependency

      1. This may be a fake issue, HW dependency is another face as other sw module dependency

      2. Tackling this with mock object

    3. Whether target unit test required

      1. 99% is not necessary, since the logic is not different for different platform

      2. 1% for different logic is a good choice for adding target unit test

    4. No target unit test framework 

      1. Choose or add one.

      2. A simple test loop for the changed 1% may be a good starting point
  2. For embedded development the TDD phases will be a little changed since Dual-Target is a must

    A standard TDD state machine should be something like following:

 

A dual-target TDD state machine should be something like this

 

code structure:

Some thinking on tackling with each challenge

  1. Without a standard C libraries which always ready on build x86 machines

    1. usually a bare metal platform will have a standard C library, or a de-factor C library having most of the api and class

    2. some could be replaced with a simple substitution. e.g. malloc could be used with static arrays which has defined size on compiling

  2. No other option, mock. May be simulation is another option depends on the readiness for simulation platform itself

  3. write done the remain 10% unit test cases for those difference between 2 targets

  4. Use the real logic to test the 10%, it seems not a big effort since the remaining logic has been verified.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值