title: Testing Code for Embedded Application
body: <p>Background:</p>
  
  <p>I am developing a largish project using at Atmel AVR atmega2560.  This project contains a lot of hardware based functions (7 SPI devices, 2 I2C, 2 RS485 MODBUS ports, lots of Analogue and Digital I/O).  I have developed "drivers" for all of these devices which provide the main application loop with an interface to access the required data.</p>
  
  <p>Question:</p>
  
  <p>The project I am developing will eventually have to meet SIL standards.</p>
  
  <p>I would like to be able to test the code and provide a good level of code coverage.  However I am unable to find any information to get me started on how such a testing framework should be set up.</p>
  
  <p>The idea is that I can have a suite of automated tests which will allow future bug fixes and feature additions to be tested to see if they break the code.  The thing is I don't understand how the code can be tested on chip.</p>
  
  <p>Do I require hardware to monitor the I/O on the device and emulate externally connected devices?  Any pointers that could be provided would be highly appreciated.</p>
  
  <p>--Steve</p>