Metamation Developer Notes

  • Developer Notes
  • Resource Map
  • Tools
    • Code Formatting
    • Configuring Git
    • Assignments
    • Testing with Windows Sandbox
    • Single Binary Applications
    • Self-Updating Applications
  • Flux Workflow
    • Flux Workflow
    • Flux Development Style Guide
    • Release notes for Flux
    • SonarCloud analysis for Flux
    • Build a Flux SDK Program
    • Shipping Flux
    • Flux.Test
      • BasicBendAuto Test
      • LaserAuto.cs Detailed Documentation
      • Laserexample:Test1
  • Technical Notes
    • File formats
      • .FX File Format
      • Au(Gold) streams
      • .GEO File Format
      • .LST File Format
      • .LST file - technology
      • .BNC File Format
      • .WAD Files: Flux Resource Packages
      • .Curl Files: ASCII config information
    • Folders App
      • Data\Bendtools
      • Data\Machines
    • FluxCode
      • Welcome & Repo Map
      • Architecture & System Context
      • Subsystem *Bend* (Press Brake)
      • Subsystem *BCell* (Bend Cell Automation)
      • API Maps
      • Data Model Catalog
      • Design Patterns -- A Reader's Guide
      • Tests and Golden Paths
      • Guided Code Tours
      • CAM Glossary with Code Mapping
      • Assignments
      • Flux Onboarding Handbook
    • Data flow
      • Part
        • Part.Dwg
        • Part.Load
        • Part.Load to Part.Dwg
      • BendTech.cs
      • Bend Technology
      • Laser Cutting Technology
    • LTS (Long term support mechanism)
    • Machine ID Scheme
  • FluxTester
    • Commands and Scripts
    • Command Cookbook
    • Script Commands
    • BendTooling.cs Test Inventory
    • LaserTooling.cs Test Steps
    • Fluxtester Recipe Book
    • Nesting.cs Overview
    • Nesting.cs Recipe Book
    • Job.cs Overview
    • Job.cs Recipe Book
  • Software license
  • 3d party software
    • Python
  • Documentation
    • Bento documentation
      • Structure of a Bento page
      • Attributes
    • Software
      • Software Requirement
      • Installation
      • Git workflow for documentation contributors
    • Quick start guide
    • Workflow
      • Roles and responsibilities
      • Analyze
      • Edit
      • Proofread
      • Pre-Publish
      • Publish
      • Release cycle
      • Information required for Documentation Team
      • Checklist for Documenters
    • Styleguide
    • Flavoring
    • Translation
      • Ordering translation for a new document
    • Citations
    • Annotation
Flux Workflow
/
Flux.Test
/
Laserexample:Test1

Laserexample:Test1

1. Overview

Test1 is a performance regression test in LaserAuto.cs that validates the runtime of automatic laser tooling for a specific GEO input (ZuriTrimmed.geo).

The method is intentionally small and linear. It does not verify tooling geometry correctness; it verifies elapsed execution time of the tooling pipeline.

2. Source Signature

  • Attribute: [Test (6147, "Time test on Zuri.geo")]

  • Method: void Test1 ()

  • Fixture: LaserAutotooling

3. Exact Implementation Flow

Test1 performs the following steps in order:

  1. Load test data into a Part object:

    var part = LoadPart ("ZuriTrimmed.geo");

    LoadPart resolves the test file path via FilePath("…​"), then calls FX.LoadPart(…​).

  2. Construct a stopwatch instance:

    var sw = new System.Diagnostics.Stopwatch ();
  3. Start timing just before tooling:

    sw.Start ();
  4. Execute automatic laser tooling:

    part.DoCutTooling ();

    This call is the operation under measurement.

  5. Stop timing immediately after tooling returns:

    sw.Stop ();
  6. Enforce the runtime threshold:

    Assert.True (sw.ElapsedMilliseconds < 8000);

    The test fails if tooling takes 8 seconds or more.

4. What Is Being Measured

The measured interval starts immediately before DoCutTooling() and ends immediately after it completes.

So, measured time includes:

  • Internal cut tooling computations performed by DoCutTooling()

  • Any synchronous processing performed inside that method

Measured time excludes:

  • File loading and part construction (LoadPart(…​) happens before sw.Start())

  • Assertion overhead and post-processing

5. Why the Test Is Implemented This Way

  • Isolates runtime of tooling generation itself, not I/O setup.

  • Uses a fixed representative geometry to make baseline comparisons stable over time.

  • Applies a single hard threshold (8000 ms) to catch major performance regressions quickly.

  • Keeps logic minimal to reduce noise and make failures easy to interpret.

6. Behavioral Contract Enforced by Test1

Test1 effectively defines this contract:

  • Given input ZuriTrimmed.geo, the current implementation of DoCutTooling() should complete in less than 8 seconds on the test environment baseline.

If this contract is violated, either:

  • A performance regression was introduced, or

  • The runtime environment has changed enough to invalidate the threshold.

7. Limitations and Interpretation Notes

  • This is not a microbenchmark; wall-clock timing can vary by machine load and hardware.

  • The threshold is coarse-grained and intended for regression detection, not fine performance tuning.

  • The test does not validate output correctness (only completion time).

8. Related Helpers Used Indirectly

Test1 relies on these helper methods in the same fixture:

  • FilePath(string fileName)

  • LoadPart(string file)

Together they map ZuriTrimmed.geo to the fixture data directory (Laser\\Auto\\) and return a loaded Part ready for tooling.

9. Minimal Pseudocode

part = LoadPart("ZuriTrimmed.geo")
start stopwatch
part.DoCutTooling()
stop stopwatch
assert elapsed_ms < 8000

10. Maintenance Guidance

When modifying DoCutTooling() internals:

  • Keep Test1 as an early warning gate for high-impact runtime regressions.

  • If a legitimate algorithmic change increases runtime, review whether:

    • The threshold should be updated, or

    • Input fixture and performance expectations should be re-baselined.

  • Pair this test with correctness tests, since Test1 alone cannot guarantee valid tooling output.

Contents

  • 1. Overview
  • 2. Source Signature
  • 3. Exact Implementation Flow
  • 4. What Is Being Measured
  • 5. Why the Test Is Implemented This Way
  • 6. Behavioral Contract Enforced by Test1
  • 7. Limitations and Interpretation Notes
  • 8. Related Helpers Used Indirectly
  • 9. Minimal Pseudocode
  • 10. Maintenance Guidance
LaserAuto.cs Detailed Documentation Technical Notes

      Copyright © 2025 TRUMPF Metamation. All rights reserved.

    Compiled by Bento