MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Overview of Performance Testing Framework


In this section...
“Determine Bounds of Measured Code” on page 33-178
“Types of Time Experiments” on page 33-179
“Write Performance Tests with Measurement Boundaries” on page 33-180
“Run Performance Tests” on page 33-181
“Understand Invalid Test Results” on page 33-181

The performance test interface leverages the script, function, and class-based unit testing
interfaces. You can perform qualifications within your performance tests to ensure correct
functional behavior while measuring code performance. Also, you can run your
performance tests as standard regression tests to ensure that code changes do not break
performance tests.

Determine Bounds of Measured Code


This table indicates what code is measured for the different types of tests.

Type of Test What Is Measured What Is Excluded
Script-based Code in each section of the
script


  • Code in the shared
    variables section

  • Measured estimate of the
    framework overhead
    Function-based Code in each test function • Code in the following
    functions: setup,
    setupOnce, teardown,
    and teardownOnce

  • Measured estimate of the
    framework overhead


33 Unit Testing

Free download pdf