-
Notifications
You must be signed in to change notification settings - Fork 8
5 REQ testcov
As a product owner, I want to ensure that implemented requirements are covered by tests, because this is required by safety-critical standards and improves software quality. To represent this information in traceability reports, mantra must be able to store this data.
Multiple tests may be grouped inside one test run. This is similar to a test suite, but test runs represent the execution of a test suite.
The name of the test run must be used as unique identifier. A test run may be executed multiple times and stored in mantra, but only the newest execution of a test run must be used to calculate the latest requirements coverage.
A test run represents the execution of a test suite, so it must store the date and time the test run was executed.
The name of a test run is used as identifier, and therefore only the newest execution of a test run must be stored.
The test run metadata is programming language, domain, and company specific, so it must be possible to store arbitrary information in mantra, but still be able to access the data for the report generation. e.g. enabled feature flags, target the tests were run on, ...
-
Parents: [
testcov.test_run,exchange.testcov.test.junit]
It must be possible to build a hierarchy of test-runs, because well-supported formats like JUnit allow nested test suites and mantra must be able to exchange test data that adheres to the JUnit format.
The number of test cases of a test run must be the sum of all test cases directly linked to the test run plus the number of test cases of all nested test runs.
Implementation Details:
Nested test runs are handled similar to the requirements hierarchy, by having a test run hierarchy table.
Cyclical dependencies between test runs must not be allowed and must be prevented in mantra internally.
A test case must be part of a test run, and must be uniquely identified within the test run.
The state of a test case must be one of the following:
-
passed: The test case passed. -
failed: The test case failed. -
skipped: The test case was skipped.
For state skipped, the reason for skipping the test case must be stored in mantra if such a reason exists in the provided data.
The name of a test case must be used as unique identifier per test run a test case is linked to. Testing tools must ensure that the name is unique per test run.
-
Parents: [
testcov.test_case,trace.origin]
The origin of a test case consists of the filepath and line number the test case is defined at. For mantra to link traces to test cases, the filepaths of traces and test cases must use the same relative path origin. Storing filepaths as absolute paths would prevent the database or reports from being portable.
The origin of a trace is its unique identifier, and therefore the test case origin must also be usable as unique identifier.
The metadata of a test case is programming language, domain, project, and company specific, so it must be possible to store arbitrary information in mantra, but still be able to access the data for the report generation. e.g. logs, pre-/post-conditions, description, etc.
-
Parents: [
testcov,trace.origin]
Code coverage data must be associated with test-runs or test cases to know if a requirement was successfully covered by one or more tests.
Detecting if a requirement was covered by a test is possible my mapping the line spans of linked traces with the covered lines of the test. For this to work, the filepaths of traces and coverage data must use the same relative path origin. Storing filepaths as absolute paths would prevent the database or reports from being portable.
The line numbers for coverage data must start at one for the first line to match with line numbers of traces.
Note: Preferably, the code coverage data should be linked per test case to get the most accurate requirement coverage, but not all test tools and formats support this fine grain coverage control.
It must be possible to store the line coverage of a specific test case or test-run, because this information is important for safety-critical certifications.
It must be possible to store the condition coverage of a specific test case or test-run, because this information is important for safety-critical certifications.
It must be possible to store MCDC data of a specific test case or test-run, because this information is important for safety-critical certifications.
It must be possible to store the multiple condition coverage of a specific test case or test-run, because this information is important for safety-critical certifications.
It must be possible to infer the function coverage of a specific test case or test-run based on the line coverage data and collected function information during trace collection.
It should be possible to use static code analysis to approximate requirement coverage of test cases without executing the test case. This improves mantra's usability, because covered requirements could already be displayed while writing a test case.
Please create an issue if you found any spelling mistakes.
You may also create an issue if you think the content of this wiki should be improved.
Note: This wiki is managed in its own repository. Any commits made using the edit button will be overwritten.
Note: Issues for the wiki are handled in the mantra repository, but pull requests for the wiki are handled in the mantra-wiki repository.
This wiki is MIT licensed, and works together with mantra.