Previous Next        Current Page: NeXtMidas Training / Primitives / Test Macros / Test Strategy
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
   + Overview   
   + Open, Process, Close   
   + Building   
   + The NeXtMidas API   
   + Lab 1   
   + Special Variables   
   + Lab 2   
   + Lab 3*   
   + Files in a Primitive   
   + Lab 4   
   + Lab 5*   
   - Test Macros   
      - Introduction to Test Macros   
      - Lamest Reasons for not Testing   
      - Creating a Test Macro   
      - Test Strategy   
      - Layout of a Test Macro   
   + Lab 6   
   + Real Time Controls   
   + Lab 7   
   + Working with Messages   
   + Lab 8   
   + Primitive Restarts   
   + Introduction to DSP   
   + Lab 9   
   - Commands executing commands   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Typical (non-interactive) test strategy:
    • Run a few test cases.
      • Use pre-defined files or a waveform as input file.
    • Check the output.
      • When possible compare to a known output file.
        • Use the nxm.<opt>.test.filename.prm syntax for files in the test area.
      • When comparing output values consider using EQT (equals with tolerance) for cases where minor rounding errors are not a problem.
      • Where it makes sense (usually for record-based output) compare a few random rows against expected values.
        • Use FILE command to open the file and then use getDataTable(offset) to read an individual row.
    • Run more test cases for special options or switches.
    • Whenever a bug is discovered in an existing primitive add a test for that bug.
  • Be sure to check out IF:
    • The NeXtMidas IF contains many tests that are useful when writing test macros. Some of these include:
      EQT Numeric equality with a tolerance.
      FEXISTS Tests to see if a file exists.
      REXISTS Tests to see if a result exists.
      FEQ Tests file equality.
    • For more details see the explain file for IF.
Don't Make This Mistake:
The byte ordering of a Data File (Blue File) is dependent on the host system. If you do a binary comparison (FEQ/B) between files created on different systems, the test may fail, even though the data in the file is correct. In general you should avoid the use FEQ/B when working with a Data File (Blue File).

back