Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
78bab63
XML Parser pre-rebase squash
MaximilianSoerenPollak Jul 29, 2025
6256e49
Fix screwed merge
MaximilianSoerenPollak Aug 15, 2025
cc10240
Fix tests
MaximilianSoerenPollak Aug 15, 2025
423fd92
Fixing naming and circular deps
MaximilianSoerenPollak Aug 15, 2025
e82aae0
Formatting
MaximilianSoerenPollak Aug 15, 2025
78cac7d
Add copyright
MaximilianSoerenPollak Aug 15, 2025
8c5e32e
Fix testcase id
MaximilianSoerenPollak Aug 15, 2025
5a7e10d
Incooperated PR Comments
MaximilianSoerenPollak Aug 15, 2025
fcd03e7
Rename TestLink & TestCaseNeed
MaximilianSoerenPollak Aug 15, 2025
655dcd2
Formatting
MaximilianSoerenPollak Aug 18, 2025
3bfaf2e
Fixing golden files
MaximilianSoerenPollak Aug 18, 2025
bb3f9c3
Enable vv
MaximilianSoerenPollak Aug 18, 2025
43a39a4
Update comparission of golden files
MaximilianSoerenPollak Aug 18, 2025
da4ec0c
Testing different way of golden files
MaximilianSoerenPollak Aug 18, 2025
53b58b9
Simplification of tests
MaximilianSoerenPollak Aug 18, 2025
93b48f8
Fix consumer tests / circular import
MaximilianSoerenPollak Aug 18, 2025
8e9577d
Formatting
MaximilianSoerenPollak Aug 18, 2025
8b19f17
Add missing copyright
MaximilianSoerenPollak Aug 18, 2025
cdb9d4d
Formatting & Linting
MaximilianSoerenPollak Aug 18, 2025
a5a8175
Add small note about documentation missing
MaximilianSoerenPollak Aug 18, 2025
1e1a8cb
Delete not needed file
MaximilianSoerenPollak Aug 18, 2025
60698e6
Fixing PR comments
MaximilianSoerenPollak Aug 18, 2025
b125b34
Remove junitparser
MaximilianSoerenPollak Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"myst_parser",
"sphinxcontrib.plantuml",
"score_plantuml",
"score_source_code_linker",
"score_metamodel",
"score_draw_uml_funcs",
"score_source_code_linker",
"score_layout",
]

Comment thread
MaximilianSoerenPollak marked this conversation as resolved.
Expand Down
3 changes: 3 additions & 0 deletions docs/internals/extensions/source_code_linker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ A Sphinx extension for source code traceability for requirements. This extension
In a first step it parses the source code for requirement tags. All discovered tags including their file and line numbers are written in an intermediary file before the sphinx build.
In a second step this intermediary file is parsed during sphinx build. If a requirement Id is found in the intermediary file a link to the source is added.

** Please note that the 'test parsing & linking' has been added to the source-code-linker. **
* The documentation for this part will follow soon *

## Implementation Components

### Bazel Integration
Expand Down
1 change: 1 addition & 0 deletions docs/requirements/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Requirements
capabilities
process_overview
requirements
test_overview
1 change: 1 addition & 0 deletions docs/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Tool Requirements
=================================


📈 Status
##########

Expand Down
55 changes: 55 additions & 0 deletions docs/requirements/test_overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _testing_stats:

TESTING STATISTICS
==================


.. needtable:: SUCCESSFUL TEST
:filter: result == "passed"
:tags: TEST
:columns: external_url as "source_link"; name as "testcase";result;fully_verifies;partially_verifies;test_type;derivation_technique


.. needtable:: FAILED TEST
:filter: result == "failed"
:tags: TEST
:columns: external_url as "source_link"; name as "testcase";result;fully_verifies;partially_verifies;test_type;derivation_technique


.. needtable:: OTHER TEST
:filter: result != "failed" and result != "passed"
:tags: TEST
:columns: external_url as "source_link"; name as "testcase";result;fully_verifies;partially_verifies;test_type;derivation_technique


.. needpie:: Test Results
:labels: passed, failed, skipped
:colors: green, red, orange
:legend:

type == 'testcase' and result == 'passed'
type == 'testcase' and result == 'failed'
type == 'testcase' and result == 'skipped'


.. needpie:: Test Types Used In Testcases
:labels: fault-injection, interface-test, requirements-based, resource-usage
:legend:

type == 'testcase' and test_type == 'fault-injection'
type == 'testcase' and test_type == 'interface-test'
type == 'testcase' and test_type == 'requirements-based'
type == 'testcase' and test_type == 'resource-usage'


.. needpie:: Derivation Techniques Used In Testcases
:labels: requirements-analysis, design-analysis, boundary-values, equivalence-classes, fuzz-testing, error-guessing, explorative-testing
:legend:

type == 'testcase' and derivation_technique == 'requirements-analysis'
type == 'testcase' and derivation_technique == 'design-analysis'
type == 'testcase' and derivation_technique == 'boundary-values'
type == 'testcase' and derivation_technique == 'equivalence-classes'
type == 'testcase' and derivation_technique == 'fuzz-testing'
type == 'testcase' and derivation_technique == 'error-guessing'
type == 'testcase' and derivation_technique == 'explorative-testing'
4 changes: 2 additions & 2 deletions src/extensions/score_layout/sphinx_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class SingleLayout(TypedDict):
"initial=False)>>",
],
"meta_left": [
'<<meta_all(no_links=True, exclude=["layout","style"])>>',
"<<meta_links_all()>>",
'<<meta_all(no_links=True, exclude=["layout","style", "fully_verified_by", "status", "security", "safety"])>>',
'<<meta_links_all(exclude=["fully_verified_by", "fully_verifies_back", "partially_verified_by", "partially_verifies_back"])>>',
Comment on lines +42 to +43
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outcommented partially & fully verifies_back. in the end render

],
"meta_right": [],
"footer_left": ["<<meta_id()>>"],
Expand Down
1 change: 0 additions & 1 deletion src/extensions/score_metamodel/checks/check_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import re
from os import error

from score_metamodel import (
CheckLogger,
Expand Down
28 changes: 27 additions & 1 deletion src/extensions/score_metamodel/metamodel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ needs_types_base_options:
optional_options:
# req-Id: tool_req__docs_dd_link_source_code_link
source_code_link: ^https://github.com/.*
testlink: ^https://github.com/.*
# Custom semantic validation rules

# Prohibited Word Option Checks
# Follow this schema to write new checks
Expand Down Expand Up @@ -372,7 +374,6 @@ needs_types:
optional_options:
codelink: ^.*$
tags: ^.*$
testlink: ^.*$
# req-Id: tool_req__docs_req_attr_reqcov
reqcovered: ^(YES|NO)$
# req-Id: tool_req__docs_req_attr_testcov
Expand Down Expand Up @@ -830,6 +831,23 @@ needs_types:
- safety_analysis
parts: 3

testcase:
title: Testcase Needs parsed from test.xml files
prefix: testcase__
mandatory_options:
id: ^testcase__
optional_options:
name: ^.*$
file: ^.*$
line: ^.*$
test_type: ^.*$
derivation_technique: ^.*$
result: ^.*$
result_text: ^.*$
optional_links:
fully_verifies: ^.*$
partially_verifies: ^.*$

# Extra link types, which shall be available and allow need types to be linked to each other.
# We use a dedicated linked type for each type of a connection, for instance from
# a specification to a requirement. This makes filtering and visualization of such connections
Expand Down Expand Up @@ -915,6 +933,14 @@ needs_extra_links:
violates:
incoming: violated_by
outgoing: violates

fully_verifies:
incoming: fully_verified_by
outgoing: fully_verifies

partially_verifies:
incoming: partially_verified_by
outgoing: partially_verifies
##############################################################
# Graph Checks
# The graph checks focus on the relation of the needs and their attributes.
Expand Down
25 changes: 24 additions & 1 deletion src/extensions/score_source_code_linker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
#*******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_library")
load("@pip_process//:requirements.bzl", "all_requirements")
load("@score_python_basics//:defs.bzl", "score_py_pytest")
Expand All @@ -27,6 +39,17 @@ py_library(
deps = ["@score_docs_as_code//src/helper_lib"],
)

py_library(
name = "source_code_linker_helpers",
srcs = [
"needlinks.py",
"testlink.py",
"xml_parser.py",
],
imports = ["."],
visibility = ["//visibility:public"],
)

score_py_pytest(
name = "score_source_code_linker_test",
size = "small",
Expand All @@ -42,5 +65,5 @@ score_py_pytest(
deps = [
":score_source_code_linker",
"@score_docs_as_code//src/extensions/score_metamodel",
] + all_requirements,
],
)
Loading
Loading