Test Integration

From STRIDE Wiki
Revision as of 09:34, 10 June 2009 by Timd (talk | contribs)
Jump to: navigation, search

In this article, we discuss establishment of continuous integration testing using STRIDE.

The starting point of this article assumes that your have completed the steps described in the article Test Integration.

Adding the TestIntro Tests to the Target Build

Here we will add the TestIntro sample tests to the target build. We suggest that you continue to include the STRIDE diagnostics in this build and all subsequent builds.

Copy the file s2_testintro_test.h to a designated SCL_DIRS directory (or alternative), include the TestIntro source files in the compile/link and perform a target build.

Download the binary to the target and start it running.

Running and Publishing the TestIntro Tests

To execute the TestIntro tests, use a Windows or Linux host computer that has connectivity with the target system via your configured STRIDE transport (TCP/IP or seral). Additionally, make the generated STRIDE database (.sidb) visible to the host computer via a shared filesystem or a file copy to the host system.

If not already present, install the appropriate Host Tools package on the host computer.

We will now run stride with options instructing it to upload results to your TestSpace site. The command line gets rather long when all this is specified, so it's recommended that you create an options file to submit the command line options.

Create a text file named TestIntroOpts.txt and add the following text. You will need to fill in your particular argument values where brackets [ ] are shown.

-r /(*) 
--database [path]/stride.sidb 
--device [arg] 
-u
--testspace [https://mycompany.stridetestspace.com@user:pwd]
--project stride_deployment
--space TestIntro
stride -O TestIntroOpts.txt

Viewing Results in TestSpace

Next Steps

Automated Regression Testing

best to set things up so that you automatically

  • build,
  • load binaries on the hardware,
  • start target running,
  • run Stride tests
  • publish results to test space

Organizing Tests

put test results in suites

develop tests with namespace conventions

Publication of Test Results

Upload to test space

comparison with previously uploaded data

immediately see trends in

  • number of tests in each suite and overall

Best Practices

Use C++ Test Classes if Possible

If possible, use C++ Test Classes to write your test units. Test Classes offer extra features and are the easiest to use for programmers.

Use Namespacing to Organize Tests

Over time, you will end up with lots of test units. Grouping these tests for display or running will become important as the count of test units grows. (You can see an example of C namespacing in the TestIntro tests.)