<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Test Types on MinimumCD Practice Guide</title><link>https://beyond.minimumcd.org/docs/testing/test-types/</link><description>Recent content in Test Types on MinimumCD Practice Guide</description><generator>Hugo</generator><language>en</language><atom:link href="https://beyond.minimumcd.org/docs/testing/test-types/index.xml" rel="self" type="application/rss+xml"/><item><title>Component Tests</title><link>https://beyond.minimumcd.org/docs/testing/test-types/component/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/component/</guid><description>&lt;figure&gt;&lt;img src="https://beyond.minimumcd.org/images/testing/component-test.svg"
 alt="Component test pattern: a test actor hits the public interface of a component boundary. Inside the boundary, real internal modules (API Layer, Business Logic, Data Adapter) are wired together. Outside the boundary, a Database and External API are represented by test doubles."&gt;
&lt;/figure&gt;

&lt;h2 id="definition"&gt;Definition&lt;/h2&gt;
&lt;p&gt;A component test exercises &lt;strong&gt;one component&lt;/strong&gt; through its public interface: one backend service through its HTTP, gRPC, or GraphQL API, or one frontend component (or app shell) through its rendered DOM. The test treats that component as a &lt;a href="https://beyond.minimumcd.org/docs/reference/glossary/#black-box-testing"&gt;black box&lt;/a&gt;: inputs go in through the public interface, observable outputs come out (response, persisted state, emitted event, rendered DOM, side effect), and the test asserts only on those outputs.&lt;/p&gt;</description></item><item><title>Contract Tests</title><link>https://beyond.minimumcd.org/docs/testing/test-types/contract/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/contract/</guid><description>&lt;figure&gt;&lt;img src="https://beyond.minimumcd.org/images/testing/contract-test.svg"
 alt="Consumer-driven contract flow: consumer team runs a component test against a provider test double, generating a contract artifact. The provider team runs a verification step against the real service using the consumer contract. Both sides discover different things: consumers check for fields and types they depend on; providers check they have not broken any consumer."&gt;
&lt;/figure&gt;

&lt;h2 id="definition"&gt;Definition&lt;/h2&gt;
&lt;p&gt;A contract test (also called a &lt;strong&gt;narrow integration test&lt;/strong&gt;) is a deterministic test that
validates your code&amp;rsquo;s interaction with an external system&amp;rsquo;s interface using
&lt;a href="https://beyond.minimumcd.org/docs/testing/glossary/#test-double"&gt;test doubles&lt;/a&gt;. It verifies that the boundary
layer code - HTTP clients, database query layers, message producers - correctly handles
the expected request/response shapes, field names, types, and status codes.&lt;/p&gt;</description></item><item><title>End-to-End Tests</title><link>https://beyond.minimumcd.org/docs/testing/test-types/e2e/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/e2e/</guid><description>&lt;figure&gt;&lt;img src="https://beyond.minimumcd.org/images/testing/e2e-test.svg"
 alt="End-to-end test scope spectrum. Narrow scope: a test drives a real service that calls a real database. Full-system scope: a browser drives a real frontend, which calls a real backend, which calls a real database. All components are real at every scope - no test doubles."&gt;
&lt;/figure&gt;

&lt;h2 id="definition"&gt;Definition&lt;/h2&gt;
&lt;p&gt;An end-to-end test exercises real components working together - no
&lt;a href="https://beyond.minimumcd.org/docs/testing/glossary/#test-double"&gt;test doubles&lt;/a&gt; replace the dependencies under
test. The scope ranges from two services calling each other,
to a service talking to a real database, to a complete user journey through every
layer of the system.&lt;/p&gt;</description></item><item><title>Integration Tests</title><link>https://beyond.minimumcd.org/docs/testing/test-types/integration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/integration/</guid><description>&lt;p&gt;&amp;ldquo;Integration test&amp;rdquo; is widely used but inconsistently defined. On this site, &lt;strong&gt;integration
tests&lt;/strong&gt; are tests that involve &lt;strong&gt;real &lt;a href="https://beyond.minimumcd.org/docs/reference/glossary/#external-dependency"&gt;external dependencies&lt;/a&gt;&lt;/strong&gt; - actual databases, live
downstream services, real message brokers, or third-party APIs. They are non-deterministic
because those dependencies introduce timing, state, and availability factors outside the
test&amp;rsquo;s control.&lt;/p&gt;
&lt;p&gt;Integration tests serve a specific role in the test architecture: they &lt;strong&gt;validate that the
&lt;a href="https://beyond.minimumcd.org/docs/testing/glossary/#test-double"&gt;test doubles&lt;/a&gt; used in your
&lt;a href="https://beyond.minimumcd.org/docs/testing/test-types/contract/"&gt;contract tests&lt;/a&gt; still match reality&lt;/strong&gt;. Without
integration tests, contract test doubles can silently drift from the real behavior of the
systems they simulate - giving false confidence.&lt;/p&gt;</description></item><item><title>Static Analysis</title><link>https://beyond.minimumcd.org/docs/testing/test-types/static/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/static/</guid><description>&lt;h2 id="definition"&gt;Definition&lt;/h2&gt;
&lt;p&gt;Static analysis (also called static testing) evaluates &lt;strong&gt;non-running code&lt;/strong&gt; against rules for
known good practices. Unlike other test types that execute code and observe behavior, static
analysis inspects source code, configuration files, and &lt;a href="https://beyond.minimumcd.org/docs/reference/glossary/#dependency"&gt;dependency&lt;/a&gt; manifests to detect
problems before the code ever runs.&lt;/p&gt;
&lt;p&gt;Static analysis serves several key purposes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Catches errors&lt;/strong&gt; that would otherwise surface at runtime.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Warns of excessive complexity&lt;/strong&gt; that degrades the ability to change code safely.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identifies security vulnerabilities&lt;/strong&gt; and coding patterns that provide attack vectors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enforces coding standards&lt;/strong&gt; by removing subjective style debates from code reviews.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alerts to dependency issues&lt;/strong&gt; such as outdated packages, known CVEs, license
incompatibilities, or supply-chain compromises.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="when-to-use"&gt;When to Use&lt;/h2&gt;
&lt;p&gt;Static analysis should run &lt;strong&gt;continuously&lt;/strong&gt;, at every stage where feedback is possible:&lt;/p&gt;</description></item><item><title>Unit Tests</title><link>https://beyond.minimumcd.org/docs/testing/test-types/unit/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://beyond.minimumcd.org/docs/testing/test-types/unit/</guid><description>&lt;figure&gt;&lt;img src="https://beyond.minimumcd.org/images/testing/unit-test.svg"
 alt="Solitary unit test: test actor sends input to a Unit Under Test; all collaborators are replaced by test doubles. Sociable unit test: test actor sends input to a Unit Under Test that uses real in-process collaborators; only external I/O is replaced by a test double."&gt;
&lt;/figure&gt;

&lt;h2 id="definition"&gt;Definition&lt;/h2&gt;
&lt;p&gt;A unit test is a deterministic test that exercises a &lt;strong&gt;unit of behavior&lt;/strong&gt; (a single
meaningful action or decision your code makes) and verifies that the observable outcome is
correct. The &amp;ldquo;unit&amp;rdquo; is not a function, method, or class. It is a behavior: given these inputs,
the system produces this result. A single behavior may involve one function or several
collaborating objects. What matters is that the test treats the code as a
&lt;a href="https://beyond.minimumcd.org/docs/reference/glossary/#black-box-testing"&gt;black box&lt;/a&gt; and asserts only on what it produces,
not on how it produces it.&lt;/p&gt;</description></item></channel></rss>