Skip to content

Commit a9ef40d

Browse files
author
ss7536
committed
requirements & test oracle
1 parent 16709f6 commit a9ef40d

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

courseProjectDocs/requirements-and-oracles.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,36 @@
33
## Functional Requirements
44

55
The described data structures should be able to:
6+
67
1. **Traversal:** Enable traversal methods (e.g., in-order, pre-order, post-order for trees; forward/backward for linked lists).
78
2. **Sorting:** Provide built-in or integrable sorting mechanisms where applicable.
89
3. **Search & Access:** Support efficient search and retrieval of elements.
910
4. **Error Handling:** Gracefully handle invalid operations (e.g., removing from an empty queue).
10-
11+
5. **Insertion & Deletion:** Allow insertion and deletion operations at appropriate positions.
12+
6. **Integration with Algorithms:** Data structures shall support direct usage with sorting, searching, or graph algorithms.
1113

1214
## Non-Functional Requirements
1315

1416
The data structure should ensure:
17+
1518
1. **Testability:** Design should allow easy integration with unit testing frameworks.
1619
2. **Performance / Efficiency:** Operations should be optimized for time and space complexity (e.g., O(1) for stack push/pop).
1720
3. **Scalability:** Data structures should handle large datasets without significant performance degradation.
18-
21+
4. **Reliability:** Functions should consistently return correct results under normal usage.
22+
5. **Maintainability:** Code should be modular, well-documented, and easy to update or extend.
1923

2024
## Test Oracles
2125

22-
| Requirement ID | Requirement Description | Test Oracle (Expected Behavior) |
23-
|----------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
24-
| FR-1 | Enable traversal methods (e.g., in-order, pre-order, post-order for trees; forward/backward for linked lists) | Traversal methods should return elements in the correct sequence based on the traversal type. |
25-
| FR-2 | Provide built-in or integrable sorting mechanisms where applicable | Sorting operations should generate a correctly ordered sequence of elements. |
26-
| FR-3 | Support efficient search and retrieval of elements | For a known dataset, search operations should return the correct element or index in expected time (e.g., O(log n)). |
27-
| FR-4 | Gracefully handle invalid operations (e.g., removing from an empty queue) | Invalid operations should raise appropriate exceptions or return error codes without crashing.
28-
| NFR-1 | Design should allow easy integration with unit testing frameworks | All public methods should be testable via standard unit testing frameworks. |
29-
| NFR-2 | Data structures should handle large datasets without significant performance degradation | Usage with large datasets should show stable performance metrics and no memory overflows or timeouts. |
30-
| NFR-3 | Operations should be optimized for time and space complexity (e.g., O(1) for stack push/pop) | Operations should meet the expected time/space complexity bounds under typical scenarios. |
26+
| Requirement ID | Requirement Description | Test Oracle (Expected Behavior) |
27+
| -------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
28+
| FR-1 | Enable traversal methods (e.g., in-order, pre-order, post-order for trees; forward/backward for linked lists) | Traversal methods should return elements in the correct sequence based on the traversal type. |
29+
| FR-2 | Provide built-in or integrable sorting mechanisms where applicable | Sorting operations should generate a correctly ordered sequence of elements. |
30+
| FR-3 | Support efficient search and retrieval of elements | For a known dataset, search operations should return the correct element or index in expected time (e.g., O(log n)). |
31+
| FR-4 | Gracefully handle invalid operations (e.g., removing from an empty queue) | Invalid operations should raise appropriate exceptions or return error codes without crashing. |
32+
| FR-5 | Allow insertion and deletion operations at appropriate positions | After insertion or deletion, the data structure should reflect the updated state accurately. |
33+
| FR-6 | Data structures shall support direct usage with sorting, searching, or graph algorithms | The data structure should be able to produce correct results when used with algorithms like sorting, searching, etc. |
34+
| NFR-1 | Design should allow easy integration with unit testing frameworks | All public methods should be testable via standard unit testing frameworks. |
35+
| NFR-2 | Data structures should handle large datasets without significant performance degradation | Usage with large datasets should show stable performance metrics and no memory overflows or timeouts. |
36+
| NFR-3 | Operations should be optimized for time and space complexity (e.g., O(1) for stack push/pop) | Operations should meet the expected time/space complexity bounds under typical scenarios. |
37+
| NFR-4 | Functions should consistently return correct results under normal usage | Repeated calls with valid inputs should yield consistent and correct outputs. |
38+
| NFR-5 | Code should be modular, well-documented, and easy to update or extend | Code analysis and reviews should confirm modularity, ease to update, and presence of meaningful documentation. |

0 commit comments

Comments
 (0)