Skip to main content

Automated Test Generation

Saphira automatically generates comprehensive test plans that trace directly to requirements, safety analyses, and standards clauses—ensuring complete verification coverage for your safety-critical systems.

Test Generation Capabilities

Generate tests directly from requirements:
  • Each requirement gets one or more test cases
  • Tests verify specific requirement criteria
  • Automatic traceability links established
  • Coverage tracking for all requirements
Generate tests from safety artifacts:
  • HARA Tests: Verify hazard mitigations
  • FMEA Tests: Verify failure mode detection/prevention
  • TARA Tests: Verify cybersecurity controls
  • FTA Tests: Verify fault handling
Generate tests from standards clauses:
  • Tests aligned with verification methods
  • Acceptance criteria from standards
  • Evidence requirements identified
  • Compliance demonstration support

Test Case Structure

Generated Test Case Fields

FieldDescriptionExample
Test Case IDUnique identifierTC-REQ-001-01
Test ObjectiveWhat the test verifiesVerify emergency stop response time
Test MethodType of testingHardware-in-the-loop (HIL)
Test ConditionsSpecific test setupNormal operation, 25°C ambient
Expected ResultsPass criteriaStop achieved within 500ms
Test LevelUnit/Integration/SystemSystem
Requirement IDTraced requirementREQ-SAFETY-001
ASIL LevelSafety classificationASIL C

Test Generation Workflow

Choose what to generate tests from:
  • Individual requirements
  • Requirement groups by type
  • Control measures from HARA
  • Safety functions
  • Standards clauses
Specify test generation options:
  • Target test level (Unit, Integration, System, Acceptance)
  • Test methods to include (Analysis, Review, Simulation, HIL, Physical)
  • Industry-specific frameworks
  • Custom test templates
AI generates comprehensive tests:
  • Detailed test procedures
  • Expected results with acceptance criteria
  • Required equipment list
  • Estimated duration
  • Safety considerations
Edit generated tests:
  • Adjust test procedures
  • Modify acceptance criteria
  • Add specific parameters
  • Update traceability links
Generate test documentation:
  • Test plan documents (PDF)
  • Test case spreadsheets (Excel)
  • Code templates for automated testing
  • Integration with test management tools

Test Traceability

Traceability Matrix

Saphira maintains complete traceability between:
Requirements ← → Test Cases ← → Test Results
      ↑                              ↓
Safety Analyses              Evidence Documents
      ↑                              ↓
   Hazards              Standards Compliance

Traceability Features

Track verification coverage:
  • Requirements with/without tests
  • Safety functions test coverage
  • Standards clause verification status
  • Gap identification and recommendations
When requirements change:
  • Identify affected test cases
  • Highlight tests needing updates
  • Track test validity status
  • Maintain audit trail

Test Methods by Level

Multi-Level Testing Support

Component-level verification:
  • Individual function tests
  • Module interface tests
  • Code coverage requirements
  • Static analysis integration
Generates code templates for:
  • Python (pytest)
  • C/C++ (Google Test)
  • LabVIEW
  • MATLAB/Simulink
Subsystem interface verification:
  • Component interaction tests
  • Data flow verification
  • Protocol conformance tests
  • Timing and synchronization tests
Complete system verification:
  • End-to-end functional tests
  • Performance validation
  • Environmental testing
  • EMC and compliance tests
Simulation-based verification:
  • Model-in-the-loop (MIL)
  • Software-in-the-loop (SIL)
  • Hardware-in-the-loop (HIL)
  • Fault injection tests

Industry-Specific Testing

Automotive (ISO 26262)

Tests aligned with ASIL requirements:
  • Method selection per ISO 26262-8
  • Independence requirements
  • Diagnostic coverage verification
  • Fault handling tests
Verify safety mechanisms:
  • Safe state transition tests
  • Fault detection time tests
  • Diagnostic coverage tests
  • Degraded mode tests

Industrial (ISO 13849)

Tests for PL achievement:
  • Category validation tests
  • MTTFd verification
  • DCavg calculation verification
  • CCF measure validation
Control system testing:
  • Emergency stop tests
  • Guard interlock tests
  • Two-hand control tests
  • Safety relay tests

IEC 61508 Systems

Tests for SIL achievement:
  • PFH/PFD calculation verification
  • Hardware fault tolerance tests
  • Diagnostic coverage tests
  • Systematic capability verification

Code Template Generation

Executable Test Templates

Saphira generates runnable test code:
# Generated test case for REQ-SAFETY-001
def test_emergency_stop_response_time():
    """
    Test Objective: Verify emergency stop achieves safe state within 500ms
    Requirement: REQ-SAFETY-001
    Test Level: System
    ASIL: C
    """
    # Test setup
    system = initialize_system()
    
    # Preconditions
    assert system.state == OperatingState.NORMAL
    
    # Test execution
    start_time = time.perf_counter()
    system.trigger_emergency_stop()
    
    # Wait for safe state
    while system.state != SafeState.STOPPED:
        if time.perf_counter() - start_time > 0.6:  # 600ms timeout
            break
    
    response_time = time.perf_counter() - start_time
    
    # Assertions
    assert system.state == SafeState.STOPPED
    assert response_time <= 0.500, f"Response time {response_time}s exceeds 500ms limit"

Test Results Management

Recording Test Results

Track test execution:
  • Test status (Passed/Failed/Blocked/Not Run)
  • Execution date and tester
  • Actual vs expected results
  • Deviation documentation
Attach supporting evidence:
  • Test logs and reports
  • Screenshots and recordings
  • Measurement data
  • Third-party certifications
Generate coverage metrics:
  • Test execution status
  • Pass rate by requirement
  • Coverage by ASIL/PL level
  • Gap analysis reports

Export and Integration

Export Formats

  • PDF: Formatted test plan documents
  • Excel: Test case spreadsheets with traceability
  • CSV: Data for test management tools
  • JSON: API integration format

Tool Integration

Saphira test plans integrate with:
  • Jira (test case import)
  • Azure DevOps (test plans)
  • Jama Connect (requirements traceability)
  • HP ALM / Quality Center
  • Custom CI/CD pipelines