---
title: "Behavioral model and test"
description: "A BCM model and a test of the hazard lights, explained step by step"
source: https://developer.remotivelabs.com/docs/get-started/examples/behavioral-model-test
last_updated: 2026-11-24
---

# Behavioral model and test

- Goal: Start here
- From: [Topology examples v0.9.0](https://github.com/remotivelabs/remotivelabs-topology-examples/tree/v0.9.0)
- Protocols: CAN
- Vehicle domains: Lighting

## Run it

```bash
git clone https://github.com/remotivelabs/remotivelabs-topology-examples.git
cd remotivelabs-topology-examples

remotive topology build \
  -f getting_started/instances/main.instance.yaml \
  -f getting_started/settings/can_over_udp.settings.instance.yaml \
  build

docker compose -f build/getting-started/docker-compose.yml --profile tester up --build --abort-on-container-exit
```

The tester container runs the test and exits; run the command again to rerun it.

The hello world of RemotiveTopology: describe a small platform, write a behavioral model for one ECU, and test it.

The test checks that the front light control module (`FLCM`) gets the right signal when the hazard lights button is
pressed. The button makes the steering column module (`SCCM`) send a message to the body control module (`BCM`),
whose behavioral model forwards it to the light control modules.

- [Getting started example](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/README.md), which explains every file
- Platform: [topology.platform.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/platform/topology.platform.yaml)
- Behavioral model of the `BCM`: [models/bcm](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/models/bcm/__main__.py) and its
  [instance file](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/models/bcm.instance.yaml)
- Test case: [test_hazard_light.py](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/tests/test_hazard_light.py), run by
  [tester.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/tests/tester.instance.yaml)

Build and run the test:

```bash
remotive topology build \
  -f getting_started/instances/main.instance.yaml \
  -f getting_started/settings/can_over_udp.settings.instance.yaml \
  build
docker compose -f build/getting-started/docker-compose.yml --profile tester up --abort-on-container-exit --build
```

Notice:
- The test controls the `SCCM` mock to simulate the button and checks what `FLCM` receives, so it tests the `BCM`
  model through the bus only.
- The same test can run against real ECU software or hardware by replacing the `bcm` instance.

## Where it lives in the repo

- [getting_started/instances/main.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/instances/main.instance.yaml)
- [getting_started/models/bcm/__main__.py](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/models/bcm/__main__.py)
- [getting_started/models/bcm.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/models/bcm.instance.yaml)
- [getting_started/platform/topology.platform.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/platform/topology.platform.yaml)
- [getting_started/tests/test_hazard_light.py](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/tests/test_hazard_light.py)
- [getting_started/tests/tester.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/getting_started/tests/tester.instance.yaml)

[Read this use case on GitHub](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/usecases/BEHAVIORAL_MODEL_TEST.md)

## Works well with

- [Your first topology](https://developer.remotivelabs.com/docs/get-started/first-topology.md): Describe a sample vehicle from two DBC files, then build, run and view it
- [Python behavioral models](https://developer.remotivelabs.com/docs/get-started/examples/python-models.md): Model ECUs that don't exist yet, in a few lines of Python
- [Test cases with pytest](https://developer.remotivelabs.com/docs/get-started/examples/pytest.md): Integration tests as Python code, run as part of the topology
