Embedded software app testing

embeddedjtagmicrocontrollersoftwaretesting

The software app being developed runs on the embedded hardware and spits the debug output through a serial port during various functionality of the app. Following are the questions.

  1. Can I use the JTAG interface to the MCU in testing the app flashed on to it ?

  2. Is there a way to automate testing especially for regression testing?

I am currently thinking of creating an app that looks for the debug output over the serial and scans for various sentences spitted out? Is this a good idea.

Any ideas pertaining to this topic will be appreciated.

Best Answer

Using JTAG allow you to take full control over the MCU. Depending on MCU hardware settings (see pin BOOT0 description for STM32F4), the MCU will decide if

  1. It will read the content of the application stored in flash into MCU's RAM. Then execute jumps to the beginning of the RAM address. This is the normal bootloading process, for final application.
  2. It will receive the content of the application through the JTAG into MCU's RAM. Then execute jumps to the beginning of the RAM address. This is the debugging/hacking process.

So, my answer to your question

Can I use the JTAG interface to the MCU in testing the app flashed on to it ?

is No. You can't. But you can test the app that will be finally flashed to it with JTAG, and then flash it once you're happy with it.

Is there a way to automate testing especially for regression testing?

Sure, many ways but it really depends on your application. Consider a simple APP that will take INPUT data (from sensors for example) to produce OUTPUT data (LED lighting for example).

For non-regression testing it is a good idea to have a library of INPUT test data, for which you know the expected OUTPUT results. The main challenge there is how you could send the INPUT test data in place of the sensors. And this will depends on you application.

I suggest you to take the non-regression testing as a requirement of your embedded application, and consider an architecture where you could easily switch the INPUT data receiver from JTAG input to actual sensors.