Skip to main content

IAR Embedded Workbench for Arm 9.70.x

Performing regression testing

In this section:

Regression testing is a method for testing the whole or parts of your source code after you have modified it, to verify that no errors have been added as a result of the modifications.

  1. After you have analyzed your project using C-STAT and possibly corrected some errors, it can be useful to perform regression testing using the IAR Command Line Build Utility (iarbuild.exe) located in the common\bin directory.

    To clean the database from old errors, use a command line like this:

    iarbuild.exe MyProject.ewp -cstat_clean Debug

    To analyze all files in the project, use a command line like this:

    iarbuild.exe MyProject.ewp -cstat_analyze Debug
  2. C-STAT generates output information, for example:

    Analyzing configuration: MyProject - Debug

    Updating build tree…

    Starting C-STAT analysis

    Analysis completed. 164 message(s)

  3. Compare the number of messages reported with the number of messages produced in previous builds. If the number has increased, new errors have been introduced as a result of earlier development.

  4. In the IDE, open your project, perform the analysis, and locate the cause of the new message.

    Alternatively, you can create an HTML report from the command line, for example like this:

    ireport.exe --db cstat.db --project MyProject.ewp --full --output MyProject.html

    This creates a report in MyProject.html, see also Generating an analysis report.

  5. Typically, you might want to repeat this process during nightly builds to continuously control that existing code is not affected by new code.

    For more information about the IAR Command Line Build Utility, see iarbuild—the IAR Command Line Build Utility.