source_code stringclasses 3
values | faulty_branch stringclasses 3
values | defect_root_cause stringclasses 3
values | protection_category stringclasses 3
values | verification_rationale stringclasses 3
values | boundary_condition_description stringclasses 3
values | protection_condition_satisfied bool 2
classes |
|---|---|---|---|---|---|---|
#include <stdbool.h>
#include <stdint.h>
#define OC_TRIP_MA 18000
// pack_current_ma is signed. Requirement: assert overcurrent when its magnitude exceeds OC_TRIP_MA.
bool detect_pack_overcurrent(int32_t pack_current_ma)
{
if (pack_current_ma > OC_TRIP_MA) {
return true;
}
return false;
} | if (pack_current_ma > OC_TRIP_MA) | The logic detects only positive current above the threshold and does not detect discharge current whose negative magnitude exceeds the threshold. | overcurrent | Because pack_current_ma is signed and the requirement applies to its magnitude, the positive-only comparison leaves the negative overcurrent direction unprotected. | A positive current of 18000 mA is not flagged, consistent with the strict exceeds condition, but a current of -18001 mA is also not flagged even though its magnitude exceeds the threshold. | false |
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define OV_TRIP_MV 4200U
// Requirement: assert the overvoltage condition when any cell is at or above OV_TRIP_MV.
bool detect_cell_overvoltage(const uint16_t *cell_mv, size_t count)
{
for (size_t i = 0; i < count; ++i) {
if (cell_mv[i] > OV_TRI... | if (cell_mv[i] > OV_TRIP_MV) | The comparison is strict, so a cell voltage equal to OV_TRIP_MV does not assert the overvoltage condition despite the at-or-above requirement. | overvoltage | The loop checks each cell, but the strict greater-than comparison excludes the specified trip threshold itself. | A cell at 4200 mV is not flagged; a cell above 4200 mV is flagged. The required boundary is inclusive. | false |
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define UV_TRIP_MV 2800U
// Requirement: assert the undervoltage condition when any monitored cell is at or below UV_TRIP_MV.
bool detect_cell_undervoltage(const uint16_t *cell_mv, size_t count)
{
for (size_t i = 0; i < count; ++i) {
if (cell_mv... | undervoltage | The function examines every monitored cell and returns true as soon as a voltage is less than or equal to the stated threshold, matching the requirement. | A cell at 2800 mV or below is flagged; a cell at 2801 mV does not satisfy the undervoltage condition. | true |
Battery Management System Protection Logic Code Verification Dataset
This dataset contains source code samples from battery management system (BMS) firmware covering overvoltage, undervoltage, overcurrent, and temperature protection. Annotations indicate whether protection conditions are satisfied and identify defect root causes, faulty branches, and boundary-condition behavior. It supports model training and evaluation for protection logic verification, defect localization, threshold analysis, and explanation of verification results. Typical uses include battery control firmware development, embedded software testing, and code review.
Technical Specifications
| Field | Type | Description |
|---|---|---|
| source_code | string | A BMS firmware source code sample containing overvoltage, undervoltage, overcurrent, or temperature protection logic. |
| faulty_branch | string | The conditional branch or decision path responsible for an identified protection logic defect, or an empty string when no faulty branch exists. |
| defect_root_cause | string | The root cause of a protection logic defect, or an empty string when no defect is identified. |
| protection_category | string | The protection function addressed by the code, such as overvoltage, undervoltage, overcurrent, or temperature protection. |
| verification_rationale | string | A concise explanation supporting the protection-condition result and defect analysis. |
| boundary_condition_description | string | A description of relevant threshold, comparison, or boundary-condition behavior identified during verification. |
| protection_condition_satisfied | boolean | Indicates whether the source code correctly satisfies the required protection condition. |
Compliance Statement
| Authorization Type | CC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike) |
| Commercial Use | Requires exclusive subscription or authorization contract (monthly or per-invocation charging) |
| Privacy and Anonymization | No PII, no real company names, simulated scenarios follow industry standards |
| Compliance System | Compliant with China's Data Security Law / EU GDPR / supports enterprise data access logs |
Source & Contact
- Downloads last month
- 22