Tests
Tests are documented procedures that verify whether specific criterion have been met. Each test has a one-to-one relationship with a criterion and provides instructions for proving that the criterion is satisfied.
Overview
Tests in Test & Accept directly verify specific criterion within Task Items. This relationship forms a complete traceability chain from high-level project objectives down to detailed verification procedures.
The hierarchy is:
- Statement of Work - The overall scope document
- Task Items - Specific work within the SOW that must be accomplished
- Criterion - Binary pass/fail conditions for each Task Item
- Tests - Procedures that prove each criterion is met
Tests:
- Provide detailed verification procedures for each criterion
- May include setup instructions
- Can contain one or many steps
- Specify expected outcomes
- Document the evidence of task item completion
- Ensure complete traceability from task items to verification
By linking tests directly to criterion, Test & Accept ensures comprehensive coverage and traceability throughout the project lifecycle.
The Test Model
- Name
id
- Type
- string
- Description
Unique identifier for the test.
- Name
taskItemId
- Type
- string
- Description
ID of the Task Item this test belongs to.
- Name
criterionId
- Type
- string
- Description
ID of the criterion this test verifies (one-to-one relationship).
- Name
title
- Type
- string
- Description
The title of the test procedure.
- Name
description
- Type
- string
- Description
Overall description of what the test verifies.
- Name
setup
- Type
- string
- Description
Optional setup requirements before the test can be executed.
- Name
sections
- Type
- array
- Description
Array of test sections containing the test functions.
- Name
expectedResults
- Type
- string
- Description
The results that indicate a successful test.
- Name
status
- Type
- string
- Description
Current status (e.g., "pending", "passed", "failed").
- Name
createdBy
- Type
- string
- Description
The user ID of who created the test.
- Name
createdAt
- Type
- timestamp
- Description
Timestamp of when the test was created.
- Name
updatedAt
- Type
- timestamp
- Description
Timestamp of when the test was last updated.
Creating Tests
Via the UI
- Navigate to a Task Item
- Click "Add Test"
- Link the test to the relevant criterion
- Fill in the test details:
- Title
- Description
- Setup requirements (if needed)
- Test sections and functions
- Expected results
- Click "Save Test"
Via the API
// Create a new test
const newTest = await apiClient.tests.create(
"sow_id",
"task_item_id",
{
criterionId: "criterion_id",
title: "User Login Test",
description: "Verify that users can log in with valid credentials",
setup: "Test user account must exist in the system",
sections: [
{
title: "Login Process",
functions: [
{
step: 1,
instructions: "Navigate to the login page",
expectedResult: "Login page displays with username and password fields"
},
{
step: 2,
instructions: "Enter valid username and password",
expectedResult: "Credentials are accepted in the form fields"
},
{
step: 3,
instructions: "Click the 'Login' button",
expectedResult: "Form submits without errors"
}
]
}
],
expectedResults: "User is authenticated and redirected to the dashboard",
status: "pending"
}
);
AI-Generated Tests
Test & Accept includes AI capabilities that can automatically generate tests based on criterion:
- Navigate to a Task Item
- Click the "Generate Tests" button
- Review and edit the auto-generated test procedures
- Save the finalized tests
When using AI-generated tests, always review them carefully to ensure they completely verify the criterion. Make edits as needed to improve coverage and clarity.
Test Structure
A well-structured test typically includes:
- Setup (Optional): Any required setup or preconditions
- Test Sections: Logical groupings of related test functions
- Test Functions: The exact instructions for performing the test
- Expected Results: Clear definition of what indicates success for each function
- Overall Expected Results: The outcome that proves the criterion is met
Executing Tests
To execute a test:
- Navigate to the test procedure
- Ensure any setup requirements are in place
- Follow each test function in sequence
- Compare actual results to expected results
- Update the test status (passed/failed)
- Add any evidence or notes about the execution
Test Status Management
Tests have three possible statuses:
- Pending: The test has been defined but not yet executed
- Passed: The test has been executed and the criterion was met
- Failed: The test has been executed and the criterion was not met
To update a test's status:
// Update test status
await apiClient.tests.updateStatus(
"test_id",
"passed",
{
notes: "All steps executed successfully, verified dashboard redirect",
executedBy: "user_id",
executedAt: new Date().toISOString()
}
);
Best Practices
- One-to-One Mapping: Each test verifies exactly one criterion
- Clear Instructions: Write test functions that anyone could follow
- Specific Expectations: Define precisely what success looks like for each function
- Simple or Complex: Tests can be as simple as one step or contain multiple sections
- Reusable Tests: Design tests to be repeatable across versions
- Evidence-Based: Include provisions for capturing verification evidence
- Maintainable: Update tests when task items change
API Reference
Endpoint | Method | Description |
---|---|---|
/api/v1/sows/{sowId}/tests | GET | List all tests for a SOW |
/api/v1/sows/{sowId}/items/{itemId}/tests | GET | List tests for a Task Item |
/api/v1/tests/{id} | GET | Get test by ID |
/api/v1/sows/{sowId}/items/{itemId}/tests | POST | Create a new test |
/api/v1/tests/{id} | PUT | Update a test |
/api/v1/tests/{id} | DELETE | Delete a test |
/api/v1/tests/{id}/structure | GET | Get test with full structure |
For complete API details, refer to the API Reference.