Skip to content

Repository files navigation

Generic CAPL Test Automation Framework

📌 Overview

This repository contains a highly scalable, database-agnostic test automation framework written in CAPL. It is designed to validate Rx (Receive) communication across automotive networks, primarily supporting CAN and FlexRay protocols.

By decoupling the core test logic from project-specific database files (DBC, ARXML), these generic functions can be universally applied to any automotive project. Testers simply write lightweight test cases that pass their domain-specific signals and system variables into these robust generic functions.

Only for learning purpose

🚀 Key Features (Validation Scenarios)

The current release focuses on comprehensive validation of incoming (Rx) messages and signals from other ECUs. The generic functions support the following scenarios:

  • ⏱️ Timeout Validation: Verifies that expected cyclic messages are received within their specified timing thresholds.
  • 🛡️ E2E (End-to-End) Protection Check: Validates safety-critical communication by verifying the CRC (Cyclic Redundancy Check) and SQC (Sequence Counter / Alive Counter).
  • 📏 DLC (Data Length Code) Validation: Ensures received frames match the expected byte length defined in the network database.
  • ⚠️ Signal Fault Testing: Injects and validates network-level signal faults and invalid values.
  • 📊 Signal Range Validation: Dynamically checks if received signal values fall within expected Min/Max boundaries (incorporating epsilon handling for floating-point accuracy).

🏗️ Architecture & Usage

The framework relies on a master-slave architecture between your Test Cases and the Generic Functions.

  1. Databases: Attach your project-specific .dbc or .arxml to your CANoe simulation.
  2. Includes: Include the generic CAPL script (.cin or .can) in your vTESTstudio or CANoe Test Module.
  3. Test Execution: Write test cases that pass native database references (Signals, System Variables) into the generic functions.

Example Implementation

// Inside your project-specific Test Case
testcase TC01_EngineSpeed_RangeCheck()
{
  long inputs[3] = {0, 3000, 8000};
  float expected[3] = {0.0, 3000.0, 8000.0};

  // Calling the generic function using ARXML/DBC definitions
  Check_signal_value_float_type("EngineSpeed", sysvar::RTE::EngineSpeed, inputs, expected);
}

🛠️ Prerequisites

  • Vector CANoe (Version 11.0 or higher recommended)
  • Properly configured Network Node or Test Setup block.
  • Relevant Network Databases (.dbc, .arxml, or .fibex).

🛣️ Future Improvements (Roadmap)

The next major iterations of this framework will expand diagnostic capabilities and introduce robust support for Tx (Transmit) message manipulation:

  • Fault Testing Phases: Validation of DTCs (Diagnostic Trouble Codes) and signals before the fault, during the active fault, and after the fault is healed.
  • Generic functions for Tx signal stimulation.
  • Dynamic manipulation of Tx E2E profiles (corrupting CRC/SQC for negative testing).
  • Tx physical value mapping and scaling verification.
  • Automated Tx timing and jitter analysis.

📄 License

This project is licensed under the MIT License.

About

This Repository contains CAPL code which show how to test Communication Systems for Transmitter, Receiver signals, how SW handles during unexpected conditions for an ECU. This scripts will work for FlexRay and CAN communication systems.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors