Performing regression testing
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.
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 thecommon\bindirectory.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
C-STAT generates output information, for example:
Analyzing configuration: MyProject - DebugUpdating build tree…Starting C-STAT analysisAnalysis completed. 164 message(s)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.
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.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.