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:

  1. Statement of Work - The overall scope document
  2. Task Items - Specific work within the SOW that must be accomplished
  3. Criterion - Binary pass/fail conditions for each Task Item
  4. 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

  1. Navigate to a Task Item
  2. Click "Add Test"
  3. Link the test to the relevant criterion
  4. Fill in the test details:
    • Title
    • Description
    • Setup requirements (if needed)
    • Test sections and functions
    • Expected results
  5. 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:

  1. Navigate to a Task Item
  2. Click the "Generate Tests" button
  3. Review and edit the auto-generated test procedures
  4. Save the finalized tests

Test Structure

A well-structured test typically includes:

  1. Setup (Optional): Any required setup or preconditions
  2. Test Sections: Logical groupings of related test functions
  3. Test Functions: The exact instructions for performing the test
  4. Expected Results: Clear definition of what indicates success for each function
  5. Overall Expected Results: The outcome that proves the criterion is met

Executing Tests

To execute a test:

  1. Navigate to the test procedure
  2. Ensure any setup requirements are in place
  3. Follow each test function in sequence
  4. Compare actual results to expected results
  5. Update the test status (passed/failed)
  6. 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

EndpointMethodDescription
/api/v1/sows/{sowId}/testsGETList all tests for a SOW
/api/v1/sows/{sowId}/items/{itemId}/testsGETList tests for a Task Item
/api/v1/tests/{id}GETGet test by ID
/api/v1/sows/{sowId}/items/{itemId}/testsPOSTCreate a new test
/api/v1/tests/{id}PUTUpdate a test
/api/v1/tests/{id}DELETEDelete a test
/api/v1/tests/{id}/structureGETGet test with full structure

For complete API details, refer to the API Reference.

Was this page helpful?