Back to CRM Data Hygiene

Test and QA Plan

How the build is validated before go-live: three sequential test phases, edge cases, and production verification.

4 pagesPDF · Quality
FS-DOC-06Quality

Test and QA Plan

CRM Data Hygiene Automation

[YourCompany.com] · Sales Department · Prepared by FullSpec · [Today's Date]

This document defines the complete test and quality assurance programme for the CRM Data Hygiene automation. It is written for the FullSpec build team and covers every test case that must pass before the workflow is considered production-ready. Testing is structured in three sequential phases: unit tests for each individual agent, integration and edge-case tests for agent handoffs and failure modes, and a final end-to-end run in production. No phase begins until the previous phase has fully passed. The process owner joins Phase 3 to verify the live output and record approval.

01Testing approach

All testing follows a strict three-phase sequence. Each phase has a defined scope, a dedicated environment rule, and an explicit pass condition tied to numbered test case IDs. A phase is considered complete only when every test case within it returns a pass result with no outstanding failures or unresolved warnings. Phase 3 is the final gate and requires process owner confirmation before go-live is authorised.

1
Phase 1: Unit Testing
Estimated time: 1 to 2 business days
Scope
Each agent tested in isolation: Deduplication Agent, Enrichment Agent, and Deal Hygiene Agent. No agent-to-agent handoffs tested in this phase.
Environment
Sandbox only. HubSpot sandbox account, Clearbit sandbox API key, Slack test workspace, and a dedicated Google Sheets test file.
Credential rule
Sandbox credentials exclusively. No production API keys, tokens, or CRM write access permitted during Phase 1.
Pass condition
All cases T01 through T15 return the expected output with no errors. Happy path and all key failure modes confirmed.
Who runs it
FullSpec team runs and records all Phase 1 cases. Process owner not required.
2
Phase 2: Integration and Edge Case Testing
Estimated time: 1 to 2 business days
Scope
Agent-to-agent handoffs tested end-to-end in the sandbox, plus a dedicated edge-case suite covering duplicate data, missing fields, tool unavailability, and human timeout scenarios.
Environment
Sandbox for all integration tests. Edge-case tests may use mocked API responses to simulate tool downtime and rate-limit conditions.
Credential rule
Sandbox credentials only. Mocked responses must be clearly labelled in the test log; no real Clearbit lookups or HubSpot writes against the production database.
Pass condition
All cases T16 through T24 and E01 through E07 pass. Every edge case produces the defined fallback or exception behaviour with no unhandled errors.
Who runs it
FullSpec team runs and records all Phase 2 cases. Process owner not required.
3
Phase 3: End-to-End Production Test
Estimated time: 1 business day plus owner review
Scope
A single full production run traced from trigger to Google Sheets log entry, using a controlled test record set in the live CRM. Error log verification included.
Environment
Production CRM, production Clearbit API, live Slack channel (#sales-ops), and the production Google Sheets hygiene audit log. A controlled test contact set is used.
Credential rule
Production credentials used for the first time in this phase. All test records must be clearly prefixed with TEST_ and voided immediately after the run.
Pass condition
All cases T25 through T29 pass, including the final process owner review case T29. Owner sign-off is recorded in the FullSpec confirmation system.
Who runs it
FullSpec team executes the run and monitors logs. Process owner reviews the Slack digest and Google Sheets output and records approval for T29.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only for all Phase 1 tests. Do not connect any production HubSpot, Clearbit, Slack, or Google Sheets credentials at this stage. All write operations must target the designated sandbox account. Any test that triggers a real CRM write in production is an automatic fail regardless of outcome.

Deduplication Agent — estimated build time: 12 hours, complexity: Moderate

ID
Scenario
Input
Expected output
Pass criteria
T01
Happy path: exact email duplicate
Two contacts with identical email addresses submitted to the agent
Pair scored above merge threshold; auto-merge executed; secondary record removed from sandbox CRM
Merged record retained in CRM; secondary record absent; merge event logged
T02
Happy path: fuzzy name and company match
Two contacts with same company, similar first name (e.g. Jon vs John), no shared email
Pair scored; confidence falls in borderline range; flagged for human review in Slack
No auto-merge executed; Slack message contains both record IDs and a review prompt
T03
Happy path: matching phone number
Two contacts with different emails but identical E.164-formatted phone number
Pair scored above merge threshold; auto-merge executed
Merged record in CRM; phone field preserved; run log updated
T04
Failure mode: below confidence threshold
Two contacts with similar names but different companies and different emails
Confidence score below threshold; neither auto-merge nor Slack flag triggered
Both records remain untouched; no Slack message sent; agent completes without error
T05
Failure mode: empty email field on one record
One contact with email, one contact with blank email field, same name
Agent handles null field gracefully; falls back to name-plus-company matching
No unhandled null error; matching proceeds via fallback fields; result logged correctly
T06
Failure mode: CRM API read error
HubSpot sandbox API returns a 503 on the contact pull request
Agent catches the error, retries up to three times with exponential backoff, then exits with an error status
No partial merge attempted; error written to run log; Slack alert posted to #sales-ops

Enrichment Agent — estimated build time: 10 hours, complexity: Moderate

ID
Scenario
Input
Expected output
Pass criteria
T07
Happy path: all priority fields blank
Contact record with empty job_title, company_size, and industry fields submitted to Clearbit
Clearbit returns values for all three fields; agent writes them to the CRM record without overwriting any existing field
CRM record updated with three new field values; no pre-existing field altered; enrichment count incremented
T08
Happy path: partial enrichment (some fields already populated)
Contact with job_title populated but company_size and industry blank
Agent submits to Clearbit; returned job_title value is discarded; company_size and industry values are written
Existing job_title unchanged; two new fields written; overwrite protection confirmed
T09
Clearbit returns no match for the contact
Contact email domain is a personal Gmail address with no Clearbit company profile
Enrichment failure recorded; contact added to exceptions digest count; no CRM fields altered
CRM record unchanged; enrichment failure count incremented by one; no unhandled error
T10
Clearbit rate limit hit mid-batch
Batch of 50 contacts submitted; rate limit (429) returned after 30th lookup
Agent pauses, respects Retry-After header, resumes from contact 31 after the wait window
All 50 contacts processed eventually; no duplicate lookups; total enrichment count accurate
T11
Failure mode: CRM write-back rejected (field validation error)
Clearbit returns a company_size value that fails HubSpot field type validation
Agent catches the 400 error, logs the field and value that caused the rejection, skips that field, and continues with valid fields
Other valid fields are written; invalid field skipped; error detail logged; no agent crash

Deal Hygiene Agent — estimated build time: 10 hours, complexity: Moderate

ID
Scenario
Input
Expected output
Pass criteria
T12
Happy path: stale deal detected
Open deal with last activity date more than 30 days ago
Deal flagged as stale; included in Slack digest with deal ID, owner, and days since last activity
Slack message contains correct deal details; deal record not closed automatically; Google Sheets row appended
T13
Happy path: hard-bounce contact suppression
Contact record with email_bounced: true flag in the CRM
Contact marked for suppression in Slack digest; not removed from CRM; flagged for ops review
Slack digest lists the contact; suppression flag set in CRM; no contact deletion performed
T14
Happy path: unsubscribed contact flagged
Contact with unsubscribed: true in HubSpot
Contact included in exceptions digest; sequences and future sends blocked; flagged for review
Slack digest entry present; CRM suppression field updated; Google Sheets audit row includes contact
T15
No stale deals or suppression contacts in the run window
All open deals have activity within the last 30 days; no bounce or unsubscribe flags
Agent completes without error; Slack digest posted noting zero exceptions; Google Sheets row still appended
Empty digest posted correctly; Sheets row shows zero flags; no error or silent failure
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Integration test cases verify that data passes correctly between agents in sequence, that outputs from one agent serve as valid inputs to the next, and that the end-to-end sandbox run produces a consistent audit trail. All cases below use sandbox credentials and a controlled record set.

ID
Scenario
Input
Expected output
Pass criteria
T16
Deduplication Agent output feeds Enrichment Agent correctly
Deduplication Agent completes a run producing a merged record set; Enrichment Agent triggered immediately after
Enrichment Agent receives the post-merge record list; does not attempt to enrich records that were removed in the merge step
No enrichment attempt on deleted secondary records; Enrichment Agent processes only surviving records
T17
Enrichment Agent output feeds Deal Hygiene Agent correctly
Enrichment Agent completes; updated records written to sandbox CRM; Deal Hygiene Agent fires
Deal Hygiene Agent reads the enriched record set from the CRM; stale deal and suppression logic applies to the updated data
Deal Hygiene Agent uses post-enrichment field values; no stale data from a prior snapshot used
T18
Full sequential run: trigger to Google Sheets log
Weekly schedule trigger fires in sandbox at the configured Monday 7am window
All three agents execute in sequence; Slack digest posted; Google Sheets row appended with accurate run counts
Run completes without manual intervention; Sheets row contains date, records processed, duplicates merged, fields enriched, deals flagged
T19
New contact creation trigger path
A new contact is created in the sandbox CRM mid-week (outside the scheduled run)
Deduplication Agent fires immediately for the new contact only; Enrichment Agent processes the new record; Deal Hygiene Agent skips (no new deal context)
Only the new record is scanned; no full-database rescan triggered; enrichment attempted for the new record
T20
Borderline duplicate handed off to Slack review
Deduplication Agent flags a borderline pair; auto-merge withheld; Slack message posted
Slack message includes both record IDs, the confidence score, and a clear prompt for the ops person to review
Slack message format matches the agreed template; no merge executed; records remain separate in CRM
T21
Enrichment failure count passed to exceptions digest
Five contacts return no Clearbit match during the Enrichment Agent run
Deal Hygiene Agent receives the failure count; Slack digest includes an enrichment failure section listing the five contact IDs
Slack digest section present with correct count; no enrichment failure silently dropped
T22
Stale deal rep confirmation loop
Deal Hygiene Agent flags a stale deal; rep is notified via Slack; rep confirms the deal should remain open
Rep response is captured; deal remains open; no closed-lost action taken; audit log updated with rep decision
Deal status unchanged after rep confirmation; Sheets log records the human decision with timestamp
T23
Google Sheets append: multiple runs in the same week
Two runs occur in the same week (one scheduled, one triggered by a new contact creation)
Google Sheets receives two separate appended rows, one per run, each with accurate and independent counts
Two distinct rows present in Sheets; neither row contains combined or duplicated counts from the other run
T24
Deduplication Agent fails; downstream agents do not run
HubSpot sandbox API returns a 500 error during the Deduplication Agent record pull
Orchestration layer detects the failure; Enrichment Agent and Deal Hygiene Agent are not triggered; error alert posted to Slack
No downstream agent runs; Slack error alert contains the failed step name and error code; run log records the failure

Edge case tests cover scenarios that fall outside the happy path but are realistic given the data volumes and tool dependencies in this process. IDs E01 through E07 run independently of the integration sequence above.

ID
Scenario
Input
Expected output
Pass criteria
E01
True duplicate: same contact created twice in rapid succession
Two identical contacts submitted within 90 seconds of each other via a form and an import
Deduplication Agent scores the pair on the next run; auto-merges if confidence is above threshold; no data lost from either submission
Merged record retains all field values from both submissions; no field is silently discarded
E02
Contact record with all priority fields missing
Contact has no email, no phone, no job title, no company name
Deduplication Agent cannot score the record; record is passed to enrichment with a low-data flag; Clearbit lookup attempted on whatever data is available
No agent crash; low-data flag recorded; enrichment attempted; failure logged if Clearbit returns no match
E03
Clearbit API entirely unavailable
Clearbit returns a 503 for all requests during a run
Enrichment Agent retries three times with exponential backoff; gives up gracefully; all contacts added to the enrichment failure list in the Slack digest
No partial enrichment writes; all affected contacts listed in digest; error logged with timestamp and HTTP status
E04
Slack API unavailable when digest is ready to post
Slack returns a 503 when the Deal Hygiene Agent attempts to post the exceptions digest
Automation platform retries the Slack post up to three times; if all retries fail, the digest content is written to the Google Sheets audit log as a fallback
Digest content preserved in Sheets even if Slack post fails; run does not error out; failure noted in run log
E05
Human reviewer does not act on a borderline duplicate within 7 days
A borderline duplicate pair is posted to Slack; no action taken by the ops person for 7 calendar days
On the next scheduled run the pair appears again in the Slack digest with a staleness indicator noting the number of days unreviewed
Re-flagged correctly on the next run; no automatic merge triggered due to inactivity; ops person prompted again
E06
Enrichment would overwrite an existing custom field
Contact has a manually maintained custom field (e.g. preferred_name) that conflicts with a Clearbit-returned value
Enrichment Agent detects the field is already populated; skips the write for that field; writes only to genuinely blank priority fields
Custom field value unchanged after enrichment run; overwrite protection confirmed for all non-blank fields
E07
Monthly Clearbit lookup cap reached mid-run
The configured monthly lookup cap is hit partway through an enrichment batch
Enrichment Agent stops sending new lookups immediately; remaining contacts in the batch are flagged in the Slack digest for manual follow-up; run completes without error
No lookups submitted beyond the cap; digest lists unfulfilled contacts; cap breach event recorded in run log
Test and QA PlanPage 3 of 4
FS-DOC-06Quality

04Phase 3 — end-to-end production test

Important before running Phase 3: use a dedicated internal test email address (e.g. qa-test@[YourCompany.com]) for any test contacts created in the production CRM. Prefix all test record names and company names with TEST_ so they are immediately identifiable. Void every test record immediately after the run by deleting or archiving it in HubSpot. Do not leave test records in the live database. Confirm with the process owner that the production Clearbit API key has sufficient remaining lookups before starting, and that the #sales-ops Slack channel participants have been notified that a test digest will be posted.

Phase 3 uses production credentials, the live CRM, and the live Slack channel. A controlled set of test records is introduced into the production database for the duration of the run only. The FullSpec team monitors all steps in real time and records the outcome of each case. The process owner reviews the Slack digest and Google Sheets audit row and records their approval as part of test case T29.

ID
Scenario
What is verified
Pass criteria
Status
T25
Production trigger fires and CRM records pulled
The weekly schedule trigger fires at the correct time (Monday 7am); the automation platform calls the HubSpot production API and retrieves the expected contact and deal record set
API call returns HTTP 200; record count matches the known production total within a 5% tolerance; trigger timestamp logged correctly
Pending
T26
Deduplication Agent merges test duplicates in production CRM
Two TEST_ contacts with identical emails are introduced; the Deduplication Agent identifies and auto-merges them; merged record is inspected in the live CRM
Merge is visible in HubSpot merge history; secondary TEST_ record is absent; no non-test records are affected; merge logged in the run log
Pending
T27
Enrichment Agent writes fields to a production test contact via Clearbit
A TEST_ contact with blank job_title and company_size is submitted through the Enrichment Agent against the production Clearbit API
Field values returned by Clearbit are written to the test contact in the live CRM; no existing fields overwritten; Clearbit lookup charged against the production account and count verified
Pending
T28
Slack digest and Google Sheets audit row verified end to end
After the full production run, the FullSpec team inspects the #sales-ops Slack message and the production Google Sheets hygiene log
Slack digest format matches the agreed template; all test-triggered exceptions appear; Google Sheets row appended with correct run date, record counts, duplicate count, enrichment count, and deals flagged; error log shows no unhandled exceptions
Pending
T29
Process owner review and approval
The process owner reviews the Slack digest, the Google Sheets audit row, and the merged and enriched TEST_ records in the live CRM. The owner confirms the output is accurate, the format is correct, and the automation behaved as expected. Owner approval is recorded in the FullSpec confirmation system, authorising go-live.
Process owner records a written approval in the FullSpec confirmation system. No anomalies are raised. All TEST_ records are confirmed voided after the review. Go-live is authorised.
Awaiting owner
Once T29 is approved and recorded in the FullSpec confirmation system, the automation is cleared for go-live. The FullSpec team will remove all test credentials and sandbox configurations, activate the production schedule, and monitor the first two live weekly runs. Contact the FullSpec team at support@gofullspec.com with any post-approval questions or to request a threshold adjustment before the first live run.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for CRM Data Hygiene.

Launch Plan
Operations · Owner
View
ROI and Business Case
Finance · Owner
View
Process Runbook / SOP
Operations · Owner
View
Developer Handover Pack
Technical · Developer
View
Integration and API Spec
Technical · Developer
View