Smoke, regression and functional tests: what each checks, how they overlap with unit, integration and E2E tests, and where they run in a CI/CD release pipeline.
These names describe a test's purpose, not its size. A smoke test is a handful of fast checks that a freshly deployed build is alive: /health returns healthy, a user can sign in, one key API call works. It runs straight after every deployment and decides whether traffic moves to the new version. A regression test guards behaviour that already worked; in practice your whole automated suite is the regression suite, and every bug fix adds a test that fails without the fix. A functional test checks a feature against its requirement from the outside, black-box. The trade-off: smoke tests are shallow but fast enough to gate every deploy; full functional and regression runs are thorough but too slow to run everywhere.
"I think of these as purposes rather than levels. A smoke test asks 'is this build alive and wired up?'. It's a small, fast set of checks run right after deployment: the health endpoint reports healthy including the database, a user can authenticate, and one or two key endpoints return the right shape. If it fails, we don't swap the App Service slot or we roll back. It should take under a minute.
A regression test is any test that protects behaviour that used to work. The whole automated suite, unit and integration, is the regression suite, and it runs on every pull request. The discipline that matters is: when we fix a bug, we first write a test that reproduces it and fails, then fix the code. That test stays forever. A functional test checks a feature against its requirement from the user's side, black-box: 'a member ordering $150 is charged $135'. It can be an API test with
WebApplicationFactoryor a Playwright test against a deployed environment.The mistake I see is treating these as separate suites that someone runs manually before a release. A manual 'regression phase' of two weeks is a sign the automated tests don't cover enough. I'd want the regression suite automated and gating every merge, smoke tests automated after every deploy, and functional tests on the critical journeys running as a release gate."
| Name | Question it answers | Usual level | When it runs |
|---|---|---|---|
| Smoke | Is the deployed build alive? | E2E-lite, HTTP checks | After every deployment, before or right after traffic |
| Regression | Did we break something that worked? | Any (mostly unit and integration) | Every PR and merge |
| Functional | Does the feature meet the requirement? | Integration or E2E, black-box | PR (API-level) and release gate (UI-level) |
| Sanity | Does this one change basically work? | Narrow manual or automated check | After a hotfix |
PR opened
-> build, unit tests, integration tests (regression + functional at API level)
merge to main
-> build once, publish image
-> deploy to staging slot
-> smoke tests against staging slot
-> functional/E2E tests (Playwright) (release gate)
-> swap slot to production
-> smoke tests against production
-> auto rollback (swap back) if smoke fails
/health/ready returns 200 and reports SQL Server, Redis and Service Bus as healthy.A team swapped App Service slots with no checks. A missing Key Vault access policy made every request fail for 12 minutes after a swap. Adding a 30-second smoke step against the staging slot (health endpoint with a Key Vault check plus one authenticated GET) stopped the next two broken swaps before any customer saw them.
Checks whether the candidate understands test purposes and how they map onto a real pipeline.
Green flags
Red flags
Test names come from two axes:
scope (how much is real)
unit ---- integration ---- end-to-end
purpose
regression x x x
functional x x
smoke x
So "a regression test" might be a unit test, and "a functional test" might be an API integration test. Interviewers want you to know both axes.
The name comes from hardware: switch it on and see if it smokes. A smoke test should be:
In ASP.NET Core, health checks (AddHealthChecks().AddSqlServer(...)) make the server side easy; the smoke test is often a few HTTP calls in a pipeline step or a tiny xUnit project pointed at a base URL.
A regression is a bug in behaviour that used to work. Automated regression protection comes from:
Functional tests are black-box: they know inputs and expected outputs, not internals. In .NET they are often written against the HTTP API with WebApplicationFactory, or against the UI with Playwright for .NET. Writing them from acceptance criteria (Given/When/Then) keeps them tied to requirements.
Exploratory testing by a human finds things scripts don't think of. It should look for new problems, not re-run the same checklist every release.
AddHealthChecks() with a SQL Server check to an API and hit /health./health and /version.A small smoke test project, run after deployment with the target URL in an environment variable:
namespace Shop.SmokeTests;
using System.Net;
using System.Net.Http.Json;
using Xunit;
public sealed class SmokeTests : IDisposable
{
// The pipeline sets SMOKE_BASE_URL to the staging slot or production URL.
private readonly HttpClient _client = new()
{
BaseAddress = new Uri(Environment.GetEnvironmentVariable("SMOKE_BASE_URL")
?? throw new InvalidOperationException("SMOKE_BASE_URL not set")),
Timeout = TimeSpan.FromSeconds(10)
};
private sealed record VersionInfo(string Commit);
[Fact]
public async Task Ready_endpoint_reports_healthy()
{
var response = await _client.GetAsync("/health/ready", TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
[Fact]
public async Task Deployed_build_is_the_expected_commit()
{
var expected = Environment.GetEnvironmentVariable("EXPECTED_COMMIT");
Assert.False(string.IsNullOrEmpty(expected));
var info = await _client.GetFromJsonAsync<VersionInfo>("/version", TestContext.Current.CancellationToken);
Assert.Equal(expected, info!.Commit);
}
public void Dispose() => _client.Dispose();
}
# GitHub Actions step after deploying to the staging slot
- name: Smoke test staging slot
run: dotnet test tests/Shop.SmokeTests -c Release
env:
SMOKE_BASE_URL: https://shop-api-staging.azurewebsites.net
EXPECTED_COMMIT: ${{ github.sha }}
/version endpoint and assert the commit.These terms describe why a test exists, so don't build separate teams or suites around them. What matters is where each check runs and what it gates. Smoke tests earn their keep as the automated gate on slot swaps and canary promotion; the regression suite earns its keep by being trusted enough that a red build stops a merge.
That trust has to be maintained. Each test must be isolated (its own data, no reliance on order or shared state), and the suite's health should be measured like a product: PR feedback time (aim for under 10 minutes), flaky-test rate from CI retry reports, and how many defects escape to staging or production. A flaky test that is retried silently or ignored teaches the team to ignore red builds, which is the end of regression protection. Quarantine it within a day, fix it within the sprint.
| Check | When it fits | Cost | When not to |
|---|---|---|---|
| Smoke after deploy | Every environment, every deploy | Seconds | As a substitute for real tests |
| Automated regression on PR | Always | Minutes of CI | Never skip; fix flaky tests instead |
| UI functional tests (Playwright for .NET) | Critical journeys | High maintenance | Edge cases better covered at API level |
Rolling replaces instances in batches: no extra capacity, but old and new versions serve traffic together and rolling back means another rollout. Blue-green runs a full second environment and switches all traffic at once; rollback is switching back. Canary sends a small share of traffic (say 5%) to the new version, compares error rate and latency, then widens or aborts. App Service deployment slots are blue-green in a box: deploy to staging, warm it up, swap, and swap back to roll back.
The catch is the same for all of them: for a while two versions run against one database, so schema changes must be expand/contract and backward compatible. The trade-off is cost and complexity (blue-green and canary) against blast radius and rollback speed.
dotnet test builds the test projects and runs them through the test platform, using the adapter the project references (xUnit, NUnit or MSTest). I use --filter to pick tests, for example --filter "Category=Unit&FullyQualifiedName~Orders". I use --logger trx so CI can show the results, and --collect "XPlat Code Coverage" with Coverlet for coverage, which I turn into a report. When tests hang or crash, --blame-hang-timeout and --blame-crash capture dumps. The command exits non-zero on failure, so the pipeline fails. In .NET 10 the SDK can also run in Microsoft.Testing.Platform mode, which you opt into in global.json.
Last updated 23 Nov 2026.