Back to Paid Ad Campaign Management

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

Paid Ad Campaign Management

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

This document defines the complete test and quality assurance programme for the Paid Ad Campaign Management automation. It covers three sequential phases: unit testing of individual agent logic, integration and edge-case testing across agent handoffs and failure modes, and end-to-end production verification. The FullSpec team runs Phases 1 and 2 entirely in sandbox environments. The process owner joins Phase 3 for final sign-off on a live production run. No phase begins until the previous phase fully passes.

01Testing approach

Testing is structured across three phases that must be completed in sequence. No phase begins until every test case in the previous phase has achieved a passing result and that result has been logged in the FullSpec test record. This prevents integration failures masking unit-level defects and prevents a production run from proceeding with unresolved issues.

1
Phase 1: Unit Testing
Each agent tested in isolation against sandbox data
Scope
Individual agent logic: Ad Data Sync Agent and Campaign Analysis and Alert Agent tested separately with mocked or sandbox inputs.
Environment
Sandbox only. No connection to production Google Ads, Meta Ads, HubSpot, or live Slack channels.
Credential rule
Sandbox API credentials exclusively. Production tokens must not be present in the environment during Phase 1.
Pass condition
All cases T01 through T10 return an explicit PASS result with no unhandled exceptions logged.
Who runs it
FullSpec team only.
2
Phase 2: Integration and Edge-Case Testing
Agent handoffs, tool connections, and failure modes
Scope
Full agent-to-agent handoffs, API response handling across Google Ads, Meta Ads, Google Sheets, Slack, HubSpot, and Looker Studio, plus edge cases including duplicates, missing data, and tool unavailability.
Environment
Sandbox with live API connections to staging accounts (Google Ads test account, Meta test ad account, staging HubSpot sandbox, Slack test workspace).
Credential rule
Staging credentials only. Production HubSpot, live Slack channels, and production Google Sheets must remain disconnected.
Pass condition
All cases T11 through T18 and edge cases E01 through E06 return an explicit PASS with correct error handling behaviour confirmed.
Who runs it
FullSpec team only.
3
Phase 3: End-to-End Production Test
Full production run with process owner present
Scope
One complete, uninterrupted production run traced from the daily schedule trigger through to Slack alert delivery, Looker Studio refresh, and HubSpot attribution write.
Environment
Live production: real Google Ads account, live Meta Ads Manager, production Google Sheets master log, live Slack channel, production HubSpot.
Credential rule
Production credentials active. A designated internal test campaign must be used. The test record is voided in all connected systems immediately after the run.
Pass condition
All cases T19 through T22 pass, including the final process owner review case T22, confirmed in the FullSpec test record.
Who runs it
FullSpec team executes; process owner (Marketing Manager) reviews outputs and confirms approval for T22.
Test and QA PlanPage 1 of 4
FS-DOC-06Quality

02Phase 1 — unit test cases

Sandbox credentials only. All Phase 1 tests must run against mock or sandbox API responses. Do not connect production Google Ads, Meta Ads Manager, HubSpot, or live Slack workspaces during this phase. Any test that inadvertently touches a production system is automatically voided and must be re-run in the correct environment.

Ad Data Sync Agent — Unit Test Cases

ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: Google Ads API returns full daily metrics for all active campaigns
Sandbox Google Ads API response: 5 campaigns, spend, clicks, impressions, conversions all populated
All 5 campaign rows written to the correct columns in the sandbox Google Sheets master log with no missing fields
Row count in sheet equals API campaign count; all metric fields non-null; no duplicate rows inserted
T02
Happy path: Meta Ads API returns full daily metrics for all active campaigns
Sandbox Meta Ads API response: 4 campaigns, spend, clicks, impressions, conversions all populated
All 4 campaign rows written to the correct columns alongside Google Ads rows; platform column correctly labelled 'Meta'
Row count accurate; platform field correct; no overwrite of Google Ads rows
T03
Google Ads API returns zero-spend campaigns (paused or budget exhausted)
Sandbox response: 2 campaigns with spend = 0, status = PAUSED
Zero-spend rows written to sheet with spend = 0 and status flag set; no row skipped
Paused campaigns appear in sheet; spend field = 0; status column shows PAUSED
T04
Google Ads API returns a 429 rate-limit error on first call
Sandbox mock: HTTP 429 response on initial request
Agent retries after configured back-off interval (60 seconds); succeeds on second attempt; error logged
Retry triggered; successful write on retry; error event present in run log with timestamp
T05
Meta Ads API returns a 503 service unavailable error
Sandbox mock: HTTP 503 response
Agent retries up to 3 times with exponential back-off; after third failure, writes a partial-data flag to Google Sheets and logs the failure
Three retry attempts confirmed in log; partial-data flag visible in sheet; no unhandled exception thrown
T06
Google Sheets write fails due to invalid OAuth token
Sandbox: expired write token injected
Agent attempts token refresh; if refresh fails, error is logged and a failure notification is queued for the run summary
Token refresh attempt logged; on failure, error recorded with detail; no silent failure

Campaign Analysis and Alert Agent — Unit Test Cases

ID
Scenario
Input
Expected Output
Pass Criteria
T07
Happy path: campaign spend within threshold, no anomaly
Sheet row: campaign spend at 60% of monthly budget, CPC within target
No Slack alert sent; campaign scored as normal; Looker Studio refresh triggered
Slack message count = 0 for this campaign; score field = 'normal'; dashboard refresh event logged
T08
Anomaly detected: campaign spend exceeds 90% of daily budget cap
Sheet row: spend = 92% of daily cap, CPC normal
Slack alert sent to marketing channel naming the campaign, metric, and recommended action; anomaly flag written to sheet
Slack message received in sandbox channel within 30 seconds; message contains campaign name, spend percentage, and action text; sheet anomaly flag = true
T09
Anomaly detected: cost-per-click exceeds configured ceiling
Sheet row: CPC = 2.4x the configured threshold value
Slack alert generated with CPC metric and recommended action; HubSpot attribution write still proceeds
Alert message references CPC value; HubSpot write is not blocked by alert; both events logged in sequence
T10
HubSpot attribution write: conversion event with valid UTM parameters
Conversion event: campaign name, UTM source = google, UTM medium = cpc, matched HubSpot contact ID present
Deal source property updated on the HubSpot contact record; write confirmation returned
HubSpot sandbox contact record shows updated deal source field; write timestamp within 60 seconds of agent run
Test and QA PlanPage 2 of 4
FS-DOC-06Quality

03Phase 2 — integration and edge case tests

Phase 2 integration tests verify that the two agents hand off correctly and that all six connected tools respond as expected within a staging environment. These cases use live staging API connections and continue the T-sequence from Phase 1.

ID
Scenario
Input
Expected Output
Pass Criteria
T11
Full agent handoff: Ad Data Sync Agent completes write; Campaign Analysis and Alert Agent fires automatically
Staging: sync agent writes 9 campaign rows to staging sheet
Analysis agent triggers within 2 minutes of sheet write completing; all 9 rows evaluated
Analysis agent run timestamp follows sync agent completion; all 9 rows have a score field populated
T12
Slack alert delivery confirmed end-to-end in staging workspace
Analysis agent flags 2 anomalous campaigns in staging
Two distinct Slack messages appear in the staging marketing channel, one per campaign
Message count = 2; each message contains correct campaign name, metric, and action; no duplicate messages
T13
HubSpot staging write with multiple conversion events in a single run
Three conversion events in one agent run, each with a matched staging HubSpot contact
All three HubSpot contact records updated in the same run; no partial write
Three contact records show updated deal source; write count in log = 3; no records skipped
T14
Looker Studio refresh triggered after sheet write completes
Staging sheet updated with new daily data
Looker Studio data source refresh event fires; dashboard reflects updated row data
Refresh event logged; dashboard last-updated timestamp changes within 5 minutes of sheet write
T15
Threshold configuration table is updated mid-test; agent reads new values on next run
Budget threshold for one campaign updated in the Google Sheets config table between two runs
Second run applies the new threshold; first run's threshold no longer referenced
Alert behaviour changes in line with the updated threshold; no cached value used
T16
Both ad platform APIs respond successfully but Google Sheets write token expires mid-run
Staging: token expiry injected after Meta API data is fetched
Agent attempts token refresh; on success, write proceeds with all data; no rows lost
All rows written after token refresh; refresh attempt in log; run completes without manual intervention
T17
Slack API rate limit hit mid-alert batch
4 anomalous campaigns; Slack mock returns 429 after second message
Agent queues remaining messages and retries after back-off; all 4 messages eventually delivered
All 4 Slack messages delivered; retry events in log; no alerts silently dropped
T18
HubSpot write blocked by permission scope error
Staging: HubSpot token missing deals write scope
Error caught; descriptive error logged; Slack and Google Sheets steps are not blocked; partial success reported in run summary
HubSpot write fails with logged permission error; all other steps complete; run summary shows partial success, not full failure

Edge Case Test Cases

ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate campaign rows: Google Ads API returns the same campaign ID twice in one response
API response with duplicate campaign ID in payload
Deduplication logic retains one row per campaign ID; duplicate is discarded and logged
Sheet contains exactly one row per campaign ID; duplicate discard event in log
E02
Missing spend data: one campaign returns null spend field
API response with spend = null for one campaign
Row written with spend field as null or zero with a data-quality flag; no other rows affected; alert not triggered for this campaign
Null spend row present in sheet with quality flag; no anomaly alert generated for null-spend campaign
E03
Missing UTM parameters on a conversion event
Conversion event with no UTM source or medium fields
HubSpot write skipped for this event; unmatched conversion logged in run summary for manual review
HubSpot record not updated for this event; unmatched conversion appears in run summary log
E04
Google Sheets unavailable (API returns 503) at write time
Mock 503 on Sheets write endpoint
Agent retries 3 times; on continued failure, run aborts cleanly with a failure alert sent to the internal operations Slack channel
Three retries logged; internal failure alert delivered; no partial write; clean abort confirmed
E05
Zero active campaigns returned by both ad platform APIs (e.g. account paused globally)
Both APIs return empty campaign arrays
No rows written to sheet; a status note 'zero campaigns returned' written to the log column; no anomaly alerts fired
Sheet unchanged for data rows; log column updated with status note; no false alerts generated
E06
Human review timeout: Slack alert sent but no manager response within configured window (24 hours)
Anomaly alert delivered to Slack; no reaction or reply recorded within 24 hours
Escalation message sent to Marketing Director (secondary recipient); original alert flagged as unacknowledged in run log
Escalation message delivered to secondary recipient after timeout window; original alert status updated to 'escalated' in 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 designated internal test campaign in the live Google Ads and Meta Ads accounts. Do not use a campaign that is actively serving to real audiences. After the production run completes, void the test record in Google Sheets, HubSpot, and Looker Studio immediately. Confirm with the process owner that the test Slack messages have been archived or deleted from the marketing channel so they are not acted on. Only proceed to Phase 3 after all Phase 1 and Phase 2 cases have been marked as PASS in the FullSpec test record.
ID
Scenario
Input
Expected Output
Pass Criteria
T19
Full production run: daily schedule trigger fires and both ad platform APIs are called with live credentials
Production environment: live Google Ads developer token (standard access), live Meta system user token, real campaign data from the current day
Both APIs queried successfully; raw metric data for all active campaigns returned and stored in the automation platform's working memory before the sheet write
API call success responses (HTTP 200) logged for both platforms; campaign count matches the number of active campaigns confirmed by the marketing manager before the test
T20
Production Google Sheets master log updated correctly with live campaign data
Live metric data from T19 passed to the sheet write step
New rows appended to the correct date section of the production master log; all columns (campaign name, platform, spend, clicks, impressions, conversions, anomaly flag) populated
Marketing manager visually confirms new rows in the production sheet; row count matches campaign count from T19; no overwrite of prior day data
T21
Anomaly detection and Slack alert delivered to the live marketing channel
A test campaign is pre-configured with a threshold set deliberately low to guarantee an anomaly flag during the run
Slack message appears in the live marketing channel within 2 minutes of sheet write; message names the test campaign, states the breached metric, and includes the recommended action text
Slack message received and reviewed by the marketing manager in the live channel; message content matches the expected format; no duplicate messages; Looker Studio dashboard reflects updated data
T22
Process owner review and approval: marketing manager reviews all Phase 3 outputs and confirms the automation is operating correctly in production
Marketing manager reviews: production sheet rows (T20), Slack alert content (T21), HubSpot contact attribution update for the test conversion event, and Looker Studio dashboard refresh
Process owner confirms all outputs are accurate and the automation is approved for go-live. Approval is recorded by the FullSpec team in the FullSpec confirmation document, which serves as the formal acceptance record.
FullSpec confirmation document updated with process owner name, review date, and explicit approval status. No separate signoff block is required. The automation is cleared for handover to the marketing team.
After T22 is recorded, the FullSpec team will void all test records across Google Sheets, HubSpot, and Looker Studio, archive the test Slack messages, and reset the deliberately lowered anomaly threshold to its correct production value. The automation then enters live operation. Any post-launch defects should be reported to support@gofullspec.com.
Test and QA PlanPage 4 of 4

More documents for this process

Every document generated for Paid Ad Campaign Management.

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