Add Requirements
The EmbedOps CLI uses the eo requirements
command to connect a requirements document with the code and unit tests for your project. These associations can then be uploaded to the EmbedOps platform to track implementation and current status of tests that test a given requirement.
EmbedOps supports the StrictDoc Syntax. An example of a document written in this format is Zephyr's StrictDoc for System Requirements
Prerequisites
Required
- Have an EmbedOps project registered on the EmbedOps Platform
- Have the Dev Container setup to use git, with a
user.name
configured. This allows EmbedOps Platform to know who is syncing requirements
Optional
- Have Unit tests. Can set them up following the Unit Tests How-to.
Testing Out Requirements
To simply test out this functionality, you can follow the HIL Quick Start and add requirements to that project using the examples in the steps below.
Steps
-
Create a requirements doc
Add a
.sdoc
requirements document in the root of the project. Example of a minimal document: -
Tag implementations
In your project's source code, add a
@implements
comment as shown below with the appropriate UID at the start of a function to link the function to the requirement. One requirement can have multiple@implements:
tags in the code. -
OPTIONAL: Tag a test
In your project's unit tests, add a
@tests
comment as shown below with the appropriateUID
at the start of a unit test function, to link the function to the requirement. A pass or fail of this unit test will roll up to the requirement on the EmbedOps Platform. One requirement can have many associated tests. -
View requirements relations
The relation between the requirement, the implementation, and the tests can now be seen when using
eo requirements list
. Example output:eo requirements list Requirement Implementations Tests ------------------------------------------------------------------------------------------------------------------------------------------------------------------- UI-101 - Does the thingy src/main.c:27 test/test_template.c:12
Troubleshooting
The implementation or test not showing up in the
and NOT like this:eo requirements list
? Double check the comment with the tag is directly above the related function definition. So it should NOT look like this: -
Sync the requirements with EmbedOps and view status
Troubleshooting
You will need to be logged in to the EmbedOps Platform to sync with it. You can make sure you're logged in by running
eo login
firstThis will sync the current state of the requirements with the EmbedOps Platform. It can now be viewed under the project's repo "Requirements" section. The status will have a pass or fail depending on if the associated tests fail.
You can check the current status of the requirements with the below
eo
command:
Next Steps
You can find out more about requirements by looking at the eo requirements Reference page