Dataset Viewer
Auto-converted to Parquet Duplicate
repair_summary
stringclasses
3 values
flawed_test_code
stringclasses
3 values
fault_handler_code
stringclasses
3 values
repaired_test_code
stringclasses
3 values
The original test used an elapsed time of two seconds against a three-second timeout, so it exercised the healthy path despite its test name, and it did not check any state changes. The repaired tests use an expired heartbeat to verify the return value, fault latch, safe-mode transition, and payload shutdown, then sepa...
import unittest from flight_faults import check_heartbeat class HeartbeatFaultTests(unittest.TestCase): def test_timeout_enters_safe_mode(self): state = {"fault": None, "safe_mode": False, "payload_enabled": True} result = check_heartbeat( now_s=12.0, last_heartbeat_s=10.0...
def check_heartbeat(now_s, last_heartbeat_s, timeout_s, state): """Latch safe mode when the latest heartbeat exceeds its timeout.""" if now_s - last_heartbeat_s >= timeout_s: state["fault"] = "HEARTBEAT_TIMEOUT" state["safe_mode"] = True state["payload_enabled"] = False return Fa...
import unittest from flight_faults import check_heartbeat class HeartbeatFaultTests(unittest.TestCase): def test_expired_heartbeat_latches_safe_mode_and_disables_payload(self): state = {"fault": None, "safe_mode": False, "payload_enabled": True} result = check_heartbeat( now_s=13.0, ...
The handler passes the exact dependency argument "payload_bus" when current is above the limit, but the original mock assertion expected "payload". The repaired tests align the assertion with the handler and cover both the overcurrent isolation branch and the boundary case, which does not trigger isolation because the ...
import unittest from unittest.mock import Mock from flight_faults import isolate_payload_bus class PayloadBusFaultTests(unittest.TestCase): def test_overcurrent_disables_payload_bus(self): power_switch = Mock() tripped = isolate_payload_bus(2.4, 2.0, power_switch) self.assertTrue(tripped...
def isolate_payload_bus(current_a, limit_a, power_switch): """Disable the payload bus when measured current exceeds its limit.""" if current_a > limit_a: power_switch.disable("payload_bus") return True return False
import unittest from unittest.mock import Mock from flight_faults import isolate_payload_bus class PayloadBusFaultTests(unittest.TestCase): def test_overcurrent_disables_payload_bus_once(self): power_switch = Mock() tripped = isolate_payload_bus(2.4, 2.0, power_switch) self.assertTrue(tr...
The original test expected recovery after one healthy sample even though the handler requires two consecutive samples. The repaired test verifies that the first healthy sample only increments the counter, a below-threshold sample resets it, and recovery occurs only after two subsequent consecutive samples meet the thre...
import unittest from flight_faults import update_recovery_state class RecoveryStateTests(unittest.TestCase): def test_recovers_after_healthy_voltage_sample(self): state = {"fault_active": True, "good_samples": 0} recovered = update_recovery_state( state, voltage_v=7.4, ...
def update_recovery_state(state, voltage_v, recovery_threshold_v, required_good_samples): """Clear a latched fault after enough consecutive healthy voltage samples.""" if not state["fault_active"]: return False if voltage_v < recovery_threshold_v: state["good_samples"] = 0 return Fa...
import unittest from flight_faults import update_recovery_state class RecoveryStateTests(unittest.TestCase): def test_recovery_requires_consecutive_healthy_samples(self): state = {"fault_active": True, "good_samples": 0} recovered = update_recovery_state( state, voltage_v=...

CubeSat Fault Detection and Recovery Unit Test Repair Dataset

This dataset contains small-satellite flight software functions for fault detection, fault-state updates, and recovery, along with flawed and repaired unit tests for those functions. Examples cover common issues such as missing assertions, incorrect test inputs, and mismatched mock dependencies. The training objective is to generate repaired tests that verify fault-handling branches and expected state changes, supporting code SFT, spacecraft fault-handling test generation, and unit test repair.

Technical Specifications

Field Type Description
repair_summary string Summary of the test code changes and the fault-handling behavior verified after repair.
flawed_test_code string Original unit test code with issues such as missing assertions, incorrect test inputs, or mismatched mock dependencies.
fault_handler_code string Source code for the fault detection, fault-state update, or recovery function to be tested.
repaired_test_code string Unit test code repaired to verify fault-handling branches and expected state changes.

Compliance Statement

Authorization TypeCC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike)
Commercial UseRequires exclusive subscription or authorization contract (monthly or per-invocation charging)
Privacy and AnonymizationNo PII, no real company names, simulated scenarios follow industry standards
Compliance SystemCompliant with China's Data Security Law / EU GDPR / supports enterprise data access logs

Source & Contact

contact@mobiusi.com

Downloads last month
18