Scenarios

Scenarios describe what you need. They define the tests and the necessary devices for them. Here you can find all scenarios that are implemented in this BalderHub package.

Heart-Rate Measurement Strap Scenarios

class balderhub.heart.scenarios.strap_sensor.ScenarioAwakeningTiming

Bases: BaseScenarioEnv

Test scenario that validates the timing for awaking again depending on heart beat and if the strap is attached

class BatterySim

Bases: BatterySim

device simulating the battery

class HeartRateGiver

Bases: HeartRateGiver

simulation device that initiate the hear rate

class HeartRateHost

Bases: HeartRateHost

device receiving the heart rate data

class HeartRateSensor

Bases: HeartRateSensor

device detecting the row heart rate

make_sure_device_powered_on()

fixture that ensures that the device is powered on before entering the variation

make_sure_has_no_skin_contact()

fixture that ensures no skin contact before every testcase

make_sure_has_no_skin_contact_for_variation()

fixture that ensures no skin contact before entering the variation

make_sure_to_be_not_active_anymore(make_sure_has_no_skin_contact, prepare_activity_feature)

fixture that ensures that sensor is not active before every testcase

prepare_activity_feature()

prepares the activity feature for checking its activity

test_auto_awake_with_contact_and_signal(with_bpm, with_noice)

test that validates that the sensor will automatically awake as soon as the heart rate sensor is in contact with the skin and a valid heart beat is aligned

test_auto_awake_with_contact_but_without_signal()

test that validates that the sensor will automatically awake as soon as the heart rate sensor is in contact with the skin

class balderhub.heart.scenarios.strap_sensor.ScenarioHeartRateCheck

Bases: BaseScenarioEnv

Base test scenario validating the accuracy of the beat-per-minute value and it’s update timing behavior

class BatterySim

Bases: BatterySim

device simulating the battery

class HeartRateGiver

Bases: HeartRateGiver

simulation device that initiate the hear rate

class HeartRateHost

Bases: HeartRateHost

device receiving the heart rate data

class HeartRateSensor

Bases: HeartRateSensor

device detecting the row heart rate

heart_started(make_sure_has_skin_contact, make_sure_device_powered_on)

makes sure that the heart is started before the variation is entered and restores it afterwards

make_sure_device_powered_on(make_sure_has_skin_contact)

fixture that ensures that device is powered ob before entering the variation

make_sure_has_skin_contact()

fixture that ensures skin contact before entering the variation

prepare_reader_feature(heart_started)

prepares the heart rate bpm reader feature for checking its activity

test_normal_heart_rate(bpm, with_noice)

Base check that validates the transmitted heart beat and if it is updated within the expected timing

Parameters:
  • bpm – PARAMETRIZED VALUE for the beats-per-minute frequency that should be applied

  • with_noice – PARAMETRIZED VALUE if a noise should be added (None if no noise should be added, SNR in dB otherwise)

test_update_time(bpm_setting: UpdateTimeTestConfig, with_noice)

test that validates that the sensor will handle frequency changes - it makes sure that every frequency is transmitted correctly within the expected maximal reaction time

Parameters:
  • bpm_setting – PARAMETRIZED VALUE that describes the start and end time that should be tried

  • with_noice – PARAMETRIZED VALUE if a noise should be added (None if no noise should be added, SNR in dB otherwise)

class balderhub.heart.scenarios.strap_sensor.ScenarioRRValueCheck

Bases: BaseScenarioEnv

Test scenario that validates the timing for going to sleep and awake again depending on heart beat and if the strap is attached

class BatterySim

Bases: BatterySim

device simulating the battery

class HeartRateGiver

Bases: HeartRateGiver

simulation device that initiate the hear rate

class HeartRateHost

Bases: HeartRateHost

device receiving the heart rate data

class HeartRateSensor

Bases: HeartRateSensor

device detecting the row heart rate

heart_started(make_sure_has_skin_contact, make_sure_device_powered_on)

makes sure that the heart is started before the variation is entered and restores it afterwards

make_sure_device_powered_on(make_sure_has_skin_contact)

fixture that ensures that device is powered ob before entering the variation

make_sure_has_skin_contact()

fixture that ensures no skin contact before every testcase

prepare_reader(heart_started)

prepares the heart rate rr-value reader feature for checking its activity

test_normal_heart_rate(bpm, with_noice)

Base check that validates the transmitted heart beat and if it is updated within the expected timing

Parameters:
  • bpm – PARAMETRIZED VALUE for the beats-per-minute frequency that should be applied

  • with_noice – PARAMETRIZED VALUE if a noise should be added (None if no noise should be added, SNR in dB otherwise)

test_update_time(bpm_setting: UpdateTimeTestConfig, with_noice)

test that validates that the sensor will handle frequency changes - it makes sure that every frequency is transmitted correctly within the expected maximal reaction time

Parameters:
  • bpm_setting – PARAMETRIZED VALUE that describes the start and end time that should be tried

  • with_noice – PARAMETRIZED VALUE if a noise should be added (None if no noise should be added, SNR in dB otherwise)

wait_for_first_valid_rr_beat(make_sure_has_skin_contact, make_sure_device_powered_on, heart_started)

waits for the first valid rr value to sync (for a valid rr beat, we need more than two recorded beats)

class balderhub.heart.scenarios.strap_sensor.ScenarioSleepTiming

Bases: BaseScenarioEnv

Test scenario that validates the timing for going to sleep depending on heart beat and if the strap is attached

class BatterySim

Bases: BatterySim

device simulating the battery

class HeartRateGiver

Bases: HeartRateGiver

simulation device that initiate the hear rate

class HeartRateHost

Bases: HeartRateHost

device receiving the heart rate data

class HeartRateSensor

Bases: HeartRateSensor

device detecting the row heart rate

make_sure_device_powered_on()

fixture that ensures that the device is powered obn before entering the variation

make_sure_has_skin_contact()

fixture that ensures skin contact before entering the testcase

make_sure_to_be_active(make_sure_has_skin_contact, prepare_activity_feature)

fixture that ensures that sensor is not active before every testcase

make_sure_to_has_heartbeat()

fixture that ensures a valid heart beat before entering the variation

prepare_activity_feature()

prepares the activity feature for checking its activity

test_sleep_after_losing_heartbeat(with_noice)

Test that validates that device stops sending messages / closes the connection as soon as the heart rate sensor detects no heart beats anymore

test_sleep_after_losing_skin_contact()

Test that validates that device stops sending messages / closes the connection as soon as the heart rate sensor does not have skin contact anymore