Skip to content
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d8cab23
Added first test cases for init
pietercolpaert Feb 17, 2025
1f4f7a2
Correct title
pietercolpaert Feb 17, 2025
85b979a
Minor fixes
pietercolpaert Feb 17, 2025
2c00a26
Test cases further worked out
pietercolpaert Feb 24, 2025
d415252
Remove chapter numbers
pietercolpaert Mar 3, 2025
8c2e50b
Update 04-tests.bs
pietercolpaert Mar 31, 2025
cb1c0f5
Update 04-tests.bs
pietercolpaert Mar 31, 2025
d8919af
Apply suggestions from code review
pietercolpaert Mar 31, 2025
8f7835f
Further tests based on code review
pietercolpaert Mar 31, 2025
5a5af5f
feat: update test specification
xdxxxdx May 22, 2025
36a6755
Merge pull request #142 from xdxxxdx/feat-tests
pietercolpaert Jun 5, 2025
6d213be
Update 04-tests.bs
xdxxxdx Jun 19, 2025
4b3b299
Update 04-tests.bs
xdxxxdx Jun 19, 2025
b3b47fb
Update 04-tests.bs
xdxxxdx Jun 20, 2025
60cc303
feat: add test spec
xdxxxdx Jul 31, 2025
2f23d7d
Update 04-tests.bs
xdxxxdx Jul 31, 2025
ade9082
feat: delete redundancy
xdxxxdx Jul 31, 2025
70b9c85
Update 04-tests.bs
xdxxxdx Aug 29, 2025
078d212
Merge pull request #153 from TREEcg/master
xdxxxdx Sep 25, 2025
3d6383d
feat: init commit
Sep 25, 2025
e91f1f3
Delete 04-tests.html
xdxxxdx Sep 25, 2025
3f81486
Update 04-tests.bs
xdxxxdx Sep 25, 2025
cdbcaf6
feat: first draft for test spec
Sep 26, 2025
6842d89
refactor: update terminology from 'Tree Stream' to 'TREE view' for co…
xdxxxdx Dec 12, 2025
a36699d
fix: update test prerequisites to clarify TREE client reference
xdxxxdx Dec 12, 2025
4471f19
fix: correct reference in test case for TREE view
xdxxxdx Dec 12, 2025
de6b44f
fix: update section title.
xdxxxdx Dec 12, 2025
50f1682
fix: update wording in overview section for clarity
xdxxxdx Dec 12, 2025
443b122
fix: update section titles for consistency in TREE documentation
xdxxxdx Dec 12, 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
29 changes: 29 additions & 0 deletions .github/workflows/Build-test-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build TREE tests spec
on:
workflow_dispatch: {}
pull_request: {}
push:
branches: [master]
jobs:
main:
name: Build, Validate and Deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: w3c/spec-prod@v2
with:
TOOLCHAIN: bikeshed

# Modify as appropriate
GH_PAGES_BRANCH: gh-pages

# if your doc isn’t in the root folder,
# or Bikeshed otherwise can’t find it:
SOURCE: 04-tests.bs

# output filename defaults to your input
# with .html extension instead,
# but if you want to customize it:
DESTINATION: tests.html
297 changes: 297 additions & 0 deletions 04-tests.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
<pre class='metadata'>
Title: TREE Test Specification
Shortname: tests
Level: 1
Status: w3c/CG-DRAFT
Markup Shorthands: markdown yes
URL: https://w3id.org/tree/specification/tests
Repository: https://github.com/treecg/specification
Mailing List: public-treecg@w3.org
Mailing List Archives: https://lists.w3.org/Archives/Public/public-treecg/
Editor:
- Pieter Colpaert, https://pietercolpaert.be
- Xueying Deng, https://xdxxxdx.github.io/
Abstract: The TREE Test Specification offers a test plan for Tree Client implementations, enabling implementers to validate their conformance with the TREE Specification. This test specification will be regularly updated to reflect changes and enhancements in the TREE specification.
Comment thread
xdxxxdx marked this conversation as resolved.
Outdated
</pre>
# Overview # {#overview}
This specification targets implementations of TREE client services and outlines a comprehensive suite of test cases to assess their compliance with the TREE specification.
Comment thread
xdxxxdx marked this conversation as resolved.
Outdated
It covers functional, boundary, error handling, and nonfunctional performance testing.
Each test case specifies its purpose, input data, expected output, and clear pass/fail criteria.

# Functional Tests # {#functional-tests}

## Client Initialization ## {#client-initialization}

### Test Case 1.1.1 : tree client initialization without redirection ### {#test-case-1-1-1-tree-client-initialization}
Comment thread
xdxxxdx marked this conversation as resolved.
Outdated

* **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint.
* **Test Prerequisites**:
* A valid Tree Stream endpoint URL, the URL that is the IRI of the root `tree:Node`, and there is no redirection.
Comment thread
xdxxxdx marked this conversation as resolved.
Outdated
* The TREE client service is up and running.
* **Test Steps**:
1. Initialize the TREE client with the provided Tree Stream endpoint URL.
* **Expected Output**: Client initializes without errors and is ready to make requests.
* **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization.

---

### Test Case 1.1.2 : tree client initialization with redirection ### {#test-case-1-1-2-tree-client-initialization-redirection}

* **Test Description**: Verify that the client initializes correctly with a Tree Stream endpoint that involves redirection.
* **Test Prerequisites**:
* A valid Tree Stream endpoint URL, the URL leads to the IRI of the root `tree:Node` with one or more HTTP redirections.
* The TREE client service is up and running.
* **Test Steps**:
1. Initialize the TREE client with the provided Tree Stream endpoint URL.
* **Expected Output**: Client initializes without errors and is ready to make requests following any redirections as necessary. The final IRI after all HTTP redirects corresponds to the object of a `tree:view` triple linking it to a `tree:Collection`.
* **Pass/Fail Criteria**: Pass if the client initializes successfully; fail if any errors occur during initialization.

---

### Test Case 1.1.3 : Invalid client initialization ### {#test-case-1-1-3-invalid-client-initialization}

* **Test Description**: Verify that the client handles invalid initialization parameters gracefully.
* **Test Prerequisites**:
* An invalid Tree Stream endpoint URL (e.g., the content is an invalid `tree:Node`).
* The TREE client service is up and running.
* **Test Steps**:
1. Attempt to initialize the TREE client with the invalid Tree Stream endpoint URL.
* **Expected Output**: Client returns an appropriate error message indicating why the initialization failed, such as "Invalid `tree:Node`".
* **Pass/Fail Criteria**: Pass if the client returns an error message; fail if it initializes without an error message.

---

## Traverse Search Tree ## {#traverse-search-tree}

### Test Case 1.2.1 : Retrieve members from a Tree Stream ### {#test-case-1-2-1-retrieve-data-from-a-tree-stream}

* **Test Description**: Verify that the client can successfully retrieve members from a Tree Stream.
* **Test Prerequisites**:
* A valid Tree Stream endpoint URL with a known number of members.
* The TREE client service is up and running.
* **Test Steps**:
1. Initialize the TREE client with the Tree Stream endpoint URL.
2. Wait for the client synchronization to complete.
3. Collect retrieved members.
* **Expected Output**: Client retrieves all members from the Tree Stream, and the number of retrieved members matches the expected count.
* **Pass/Fail Criteria**: Pass if the client retrieves the expected number of members; fail if the count does not match or if any errors occur during retrieval.

---
## Traverse Search Tree: Relation Handling ## {#relation-handling}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would make these test cases optional to implement: depends on the goals of the client which relations it wants to support. However, the test cases are important: we need to be able to point to the fact that a client does support a specific type of relation and thus point at those specific test cases

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Marked the optional(s).


### Test Case 1.3.1 : tree:PrefixRelation ### {#test-case-1-3-1-prefix-relation}

* **Test Description**: Verify that the client handles `tree:PrefixRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:PrefixRelation` with a `tree:value` (e.g., `"abc"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:PrefixRelation` points to a `tree:Node` whose members' `tree:path`'s value all start with `"abc"` consistent with the `STRSTARTS` SPARQL function.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Wait for the client synchronization to complete.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:PrefixRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.2 : tree:SubstringRelation ### {#test-case-1-3-2-substring-relation}

* **Test Description**: Verify that the client handles `tree:SubstringRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:SubstringRelation` with a `tree:value` (e.g., `"mid"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SubstringRelation` points to a `tree:Node` whose members' `tree:path`'s values all contain `"mid"`, consistent with the `SUBSTR` SPARQL function.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Wait for the client synchronization to complete.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:SubstringRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.3 : tree:SuffixRelation ### {#test-case-1-3-3-suffix-relation}

* **Test Description**: Verify that the client handles `tree:SuffixRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:SuffixRelation` with a `tree:value` (e.g., `"xyz"`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:SuffixRelation` points to a `tree:Node` whose members' `tree:path`'s values all end with `"xyz"`, consistent with the `STRENDS` SPARQL function.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Wait for the client synchronization to complete.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:SuffixRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.4 : tree:GreaterThanRelation ### {#test-case-1-3-4-greater-than-relation}

* **Test Description**: Verify that the client handles `tree:GreaterThanRelation`.

* **Test Prerequisites**:
* A Tree Stream containing a single `tree:GreaterThanRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than `10`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Wait for the client synchronization to complete.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.5 : tree:GreaterThanOrEqualToRelation ### {#test-case-1-3-5-greater-than-equal-relation}

* **Test Description**: Verify that the client handles `tree:GreaterThanOrEqualToRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:GreaterThanOrEqualToRelation` with a `tree:value` (e.g., `10`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:GreaterThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are greater than or equal to `10`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the node via the relation.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:GreaterThanOrEqualToRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.6 : tree:LessThanRelation ### {#test-case-1-3-6-less-than-relation}

* **Test Description**: Verify that the client handles `tree:LessThanRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:LessThanRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than `20`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the node via the relation.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:LessThanRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.7 : tree:LessThanOrEqualToRelation ### {#test-case-1-3-7-less-than-equal-relation}

* **Test Description**: Verify that the client handles `tree:LessThanOrEqualToRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:LessThanOrEqualToRelation` with a `tree:value` (e.g., `20`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:LessThanOrEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values all are less than or equal to `20`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the node via the relation.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:LessThanOrEqualToRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.8 : tree:EqualToRelation ### {#test-case-1-3-8-equal-relation}

* **Test Description**: Verify that the client handles `tree:EqualToRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:EqualToRelation` with a `tree:value` (e.g., `15`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:EqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all equal to `15`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the node via the relation.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:EqualToRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

### Test Case 1.3.9 : tree:NotEqualToRelation ### {#test-case-1-3-9-not-equal-relation}

* **Test Description**: Verify that the client handles `tree:NotEqualToRelation`.
* **Test Prerequisites**:
* A Tree Stream containing a single `tree:NotEqualToRelation` with a `tree:value` (e.g., `14`) for a specific `tree:path`. This short Tree Stream has only one `tree:Relation`: the `tree:NotEqualToRelation` points to a `tree:Node` whose members' `tree:path`'s values are all not equal to `14`.
* The number of members of the TREE is known.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the node via the relation.
3. Collect retrieved members.
* **Expected Output**: The client successfully traverses the TREE via `tree:NotEqualToRelation`. All members are retrieved by the client.
* **Pass/Fail Criteria**: Pass if all members are retrieved; fail otherwise.

---

## Edge Cases ## {#edge-cases}

### Test Case 1.4.1 : Empty Node ### {#test-case-1-4-1-empty-node}

* **Test Description**: Verify client behavior when a node has no members.
* **Test Prerequisites**:
* A Tree Stream endpoint only linking to an empty `tree:Node`.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse to the empty node.
* **Expected Output**: Client returns an empty member set gracefully.
* **Pass/Fail Criteria**: Pass if empty set is returned without error; fail otherwise.

---

### Test Case 1.4.2 : Circular Relation ### {#test-case-1-4-2-circular-relation}

* **Test Description**: Verify client behavior when relations form a circular loop.
* **Test Prerequisites**:
* A Tree Stream endpoint with circular relation between nodes.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the graph.
* **Expected Output**: Client detects and prevents infinite recursion or traversal.
* **Pass/Fail Criteria**: Pass if client terminates safely; fail if stuck in an infinite loop.

---

### Test Case 1.4.3 : Malformed Relation ### {#test-case-1-4-3-malformed-relation}

* **Test Description**: Verify client behavior when relation value is malformed (e.g., string instead of number).
* **Test Prerequisites**:
* A Tree Stream endpoint with invalid relation definition.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the malformed relation.

* **Expected Output**: Client raises an error or skips the invalid relation safely.
* **Pass/Fail Criteria**: Pass if client does not crash and handles gracefully; fail otherwise.

---

## Non-Functional Testing ## {#non-functional}

### Test Case 1.5.1 : Performance under load ### {#test-case-1-5-1-performance}

* **Test Description**: Verify client performance when traversing a large Tree Stream.
* **Test Prerequisites**:
* Endpoint with ≥ 10,000 members.
* **Test Steps**:
1. Initialize the TREE client.
2. Retrieve all members.
* **Expected Output**: Traversal completes within acceptable performance thresholds (e.g., <5s).
* **Pass/Fail Criteria**: Pass if traversal completes on time; fail otherwise.

---

### Test Case 1.5.2 : Scalability ### {#test-case-1-5-2-scalability}

* **Test Description**: Verify client scalability with increasing members and relations.
* **Test Prerequisites**:
* Endpoint with multiple large fragments and complex relations, please refer to [ldes-registry](https://imec-int.github.io/ldes-registry/dashboard.html) for example endpoints.
* **Test Steps**:
1. Initialize the TREE client.
2. Traverse the entire collection.
* **Expected Output**: Client retrieves all members without memory leaks or degradation.
* **Pass/Fail Criteria**: Pass if successful; fail otherwise.

---

### Test Case 1.5.3 : Robustness to network failures ### {#test-case-1-5-3-network-failure}

* **Test Description**: Verify client behavior during network interruptions.
* **Test Prerequisites**:
* Endpoint accessible over an unstable connection.
* **Test Steps**:
1. Initialize the TREE client.
2. Simulate network drop during traversal.
* **Expected Output**: Client retries automatically or fails gracefully with an error message.
* **Pass/Fail Criteria**: Pass if handled gracefully; fail otherwise.