Test Linking to Requirements#
Linking Requirements to Tests
|
status: valid
|
||||
For linking test suites to requirements following metadata shall be used:
More information can be found in the Verification Guideline (gd_guidl__verification_guide), Verification Concept (doc_concept__verification__process), and Test Specification Guideline (gd_guidl__verification_specification). |
|||||
Linking Requirements to Tests (C++)
|
status: valid
|
||||
For linking C++ test suites to requirements record properties shall be used. Attributes which are common for all test cases can be specified in the Setup Function (SetUp()), the other attributes which are specific for each test case need to be specified within the test case: class TestSuite : public ::testing::Test{
public:
void SetUp() override
{
RecordProperty("Status", "<Status>");
RecordProperty("ASIL", "<ASIL>");
RecordProperty("TestType", "<TestType>");
RecordProperty("DerivationTechnique", "<DerivationTechnique>");
...
}
};
TEST_F(TestSuite, <Test Case>)
{
RecordProperty("PartiallyVerifies", "ID_2, ID_3, ...");
RecordProperty("FullyVerifies", "ID_4, ID_5, ...");
RecordProperty("Description", "<Description>");
ASSERT ...
}
|
|||||
Linking Requirements to Tests (Python)
|
status: valid
|
||||
For linking python tests to requirements metadata shall be used. Attributes which are common for all test cases can be specified in the Test Suite (above the class), the other attributes which are specific for each test case need to be specified above the test case: @pytest.fixture(scope="session", autouse=True)
def add_metadata(record_testsuite_property):
record_testsuite_property("ASIL", "<ASIL>")
record_testsuite_property("TestType", "<TestType>")
record_testsuite_property("DerivationTechnique", "<DerivationTechnique>")
class Testclass(TestSim):
def TestFunction(self, record_property):
record_property("PartiallyVerifies", "ID_2, ID_3, ...")
record_property("FullyVerifies", "ID_4, ID_5, ...")
record_property("Description","<Description>")
|
|||||
Linking Requirements to Tests (Rust)
|
status: valid
|
||||
For linking Rust tests to requirements #[record_property] shall be used: use test_properties::record_property;
#[record_property("PartiallyVerifies", "ID_2, ID_3, ...")]
#[record_property("FullyVerifies", "ID_4, ID_5, ...")]
#[record_property("Description", "<Description>")]
#[record_property("Status", "<Status>")]
#[record_property("ASIL", "<ASIL>")]
#[record_property("TestType", "<TestType>")]
#[record_property("DerivationTechnique", "<DerivationTechnique>")]
#[test]
fn test_case_function() {
...
}
|
|||||
Test Independence
|
status: draft
|
||||
The approver of a pull request shall differ from the author(s) of the pull request in all pull requests. |
|||||