Software Testing: Theory and Practice (Part 7) - Fundamentals and Strategies for Integration & E2E Testing

Key Takeaways Integration tests can uncover integration bugs caused by specification mismatches between components that unit tests cannot detect. Their downsides are long execution times, flaky results, and high maintenance costs. To keep maintenance costs low, minimize the number of integration-test cases and compose them from high-value test scenarios. Combine them with “autopilot”–style tests that require no explicit scenarios. Characteristics of Integration & E2E Testing Integration testing targets a group of components combined together. Unlike unit tests—where all dependencies are replaced with test doubles—integration tests run the real components. Because some of those components may have long processing times, test runs tend to be slow. If the components communicate over a network, disconnections or latency can also make results unstable. E2E (end-to-end) testing exercises the entire system with all components integrated. Since more components are involved, execution takes even longer, and E2E tests inherit the same flakiness issues. Despite these drawbacks, integration and E2E tests remain indispensable because they can detect integration bugs earlier than system-level manual testing. An integration bug is a defect arising from a mismatch between the specifications of two or more components. Example: Component A outputs a string, while Component B expects an integer. Each component individually satisfies its own specification, so their unit tests pass. But when they are wired together in a dynamically-typed language, a run-time type error can occur. Other examples include misunderstandings of a dependency’s API or unintended states/transitions when concurrently running components interact. Integration—and especially E2E—targets almost invariably hold state. As you combine more components, the state space explodes, so any practical test can explore only a tiny fraction of all possible states. Here are two keys to successful integration/E2E testing: Cover the tiny fraction you can test with high-value scenarios. Use scenario-free tests to coarsely cover the vast remainder of the state space. We start with choosing high-value scenarios. Column: Formal Specification Descriptions Because integration bugs stem from spec mismatches, they could be caught during specification writing—if specifications are written in a machine-checkable form. Such techniques are known as formal specification descriptions. A concise explanation is beyond this article’s scope. Choosing High-Value Scenarios In this article, a test scenario consists of a sequence of events fed into the integrated system, and an oracle that judges the final state. An event is anything that triggers a change of internal state—method calls, network messages, UI actions, and so on. Events also represent interaction: one event can simultaneously change several components (e.g., a request alters both client and server state). In short, a scenario executes events in a prescribed order/timing and then inspects the resulting state. If an exception or crash occurs during the sequence, the test fails. Below is a sample E2E scenario for a login screen: describe("Login screen", () => { context("When a valid user name and password are entered and the Login button is pressed", () => { it("navigates to the Welcome screen", async () => { // Event: open the login page await driver.get("https://example.com/login"); // Event: type “kuniwak” into the user name field await driver.findElement(By.id("input.username")).sendKeys("kuniwak"); // Event: type “p4$SW0rD” into the password field await driver.findElement(By.id("input.password")).sendKeys("p4$SW0rD"); // Event: click the Login button await driver.findElement(By.id("button.login")).click(); // Assert navigation to a page whose is “Welcome” await driver.wait(until.titleIs("Welcome"), 1000); }); }); }); The value of a scenario is how much its success reduces failure risk. Higher-risk-reduction ⇒ higher value. High-value scenarios fall into two patterns: High-frequency: executed often in production (typical happy paths). High severity on failure: even if rare, a defect would be catastrophic. High-frequency examples The login path of a service that every user must pass through is high-value because of sheer usage volume. Analyzing user behavior—e.g., with Google Analytics—helps identify such paths. Because user behavior evolves, repeat this analysis periodically. High-severity examples Payment failure flows rarely occur, but if they do—charging without delivering goods or vice versa—the impact is huge. Thus payment scenarios are likewise high-value. To identify high-severity cases, interview people who best understand how the system creates value—domain experts—and enumerate what could go wrong. For an e-commerce site, two expert-provided scenarios might be:

Apr 27, 2025 - 04:10
 0
Software Testing: Theory and Practice (Part 7) - Fundamentals and Strategies for Integration & E2E Testing

Key Takeaways

  • Integration tests can uncover integration bugs caused by specification mismatches between components that unit tests cannot detect. Their downsides are long execution times, flaky results, and high maintenance costs.
  • To keep maintenance costs low, minimize the number of integration-test cases and compose them from high-value test scenarios.
  • Combine them with “autopilot”–style tests that require no explicit scenarios.

Characteristics of Integration & E2E Testing

Integration testing targets a group of components combined together.
Unlike unit tests—where all dependencies are replaced with test doubles—integration tests run the real components.
Because some of those components may have long processing times, test runs tend to be slow.
If the components communicate over a network, disconnections or latency can also make results unstable.

E2E (end-to-end) testing exercises the entire system with all components integrated.
Since more components are involved, execution takes even longer, and E2E tests inherit the same flakiness issues.

Despite these drawbacks, integration and E2E tests remain indispensable because they can detect integration bugs earlier than system-level manual testing.
An integration bug is a defect arising from a mismatch between the specifications of two or more components.

Example: Component A outputs a string, while Component B expects an integer.
Each component individually satisfies its own specification, so their unit tests pass.
But when they are wired together in a dynamically-typed language, a run-time type error can occur.
Other examples include misunderstandings of a dependency’s API or unintended states/transitions when concurrently running components interact.

Integration—and especially E2E—targets almost invariably hold state.
As you combine more components, the state space explodes, so any practical test can explore only a tiny fraction of all possible states.

Here are two keys to successful integration/E2E testing:

  1. Cover the tiny fraction you can test with high-value scenarios.
  2. Use scenario-free tests to coarsely cover the vast remainder of the state space.

We start with choosing high-value scenarios.

Column: Formal Specification Descriptions

Because integration bugs stem from spec mismatches, they could be caught during specification writing—if specifications are written in a machine-checkable form.
Such techniques are known as formal specification descriptions.
A concise explanation is beyond this article’s scope.

Choosing High-Value Scenarios

In this article, a test scenario consists of

  • a sequence of events fed into the integrated system, and
  • an oracle that judges the final state.

An event is anything that triggers a change of internal state—method calls, network messages, UI actions, and so on.
Events also represent interaction: one event can simultaneously change several components (e.g., a request alters both client and server state).

In short, a scenario executes events in a prescribed order/timing and then inspects the resulting state.
If an exception or crash occurs during the sequence, the test fails.

Below is a sample E2E scenario for a login screen:

describe("Login screen", () => {
  context("When a valid user name and password are entered and the Login button is pressed", () => {
    it("navigates to the Welcome screen", async () => {
      // Event: open the login page
      await driver.get("https://example.com/login");

      // Event: type “kuniwak” into the user name field
      await driver.findElement(By.id("input.username")).sendKeys("kuniwak");

      // Event: type “p4$SW0rD” into the password field
      await driver.findElement(By.id("input.password")).sendKeys("p4$SW0rD");

      // Event: click the Login button
      await driver.findElement(By.id("button.login")).click();

      // Assert navigation to a page whose  is “Welcome”</span>
      <span class="k">await</span> <span class="nx">driver</span><span class="p">.</span><span class="nf">wait</span><span class="p">(</span><span class="nx">until</span><span class="p">.</span><span class="nf">titleIs</span><span class="p">(</span><span class="dl">"</span><span class="s2">Welcome</span><span class="dl">"</span><span class="p">),</span> <span class="mi">1000</span><span class="p">);</span>
    <span class="p">});</span>
  <span class="p">});</span>
<span class="p">});</span>
</code></pre>

</div>



<p>The <strong>value</strong> of a scenario is how much its success reduces failure risk.<br>
Higher-risk-reduction ⇒ higher value.

<p>High-value scenarios fall into two patterns:

<ol>
<li>
<strong>High-frequency</strong>: executed often in production (typical <em>happy paths</em>).</li>
<li>
<strong>High severity on failure</strong>: even if rare, a defect would be catastrophic.</li>
</ol>

<p><em>High-frequency</em> examples<br>
The login path of a service that every user must pass through is high-value because of sheer usage volume.<br>
Analyzing user behavior—e.g., with Google Analytics—helps identify such paths.<br>
Because user behavior evolves, repeat this analysis periodically.

<p><em>High-severity</em> examples<br>
Payment failure flows rarely occur, but if they do—charging without delivering goods or vice versa—the impact is huge.<br>
Thus payment scenarios are likewise high-value.

<p>To identify high-severity cases, interview people who best understand how the system creates value—<strong>domain experts</strong>—and enumerate what could go wrong.<br>
For an e-commerce site, two expert-provided scenarios might be:

<ul>
<li>
<strong>User flow</strong>: discover the site → find an item → add to cart → fill in details → pay → receive purchase.</li>
<li>
<strong>Service flow</strong>: procure popular items → store them → promote → ship according to user payments.</li>
</ul>

<p>If the site fails at any step of either flow and no recovery is possible, the store ceases to function.<br>
Both flows therefore deserve E2E protection.

<p>Conversely, auxiliary features around high-value flows—e.g., wish-list management or viewing order history—<em>might</em> be left untested if their failure is tolerable or operationally recoverable.<br>
But if a wish-list differentiates you from competitors, or customer-service costs are huge, these become high-value too.<br>
The assessment is case-by-case; interview as many domain experts as possible for a broad view.

<p>If experts are unavailable, risk-analysis techniques such as <strong>STAMP/STPA</strong> can help.

<p>Selecting such scenarios lets you cut failure risk with few tests.<br>
But scenario-based tests are costly to maintain, so limit them to high-value paths and complement the rest with scenario-free tests.

<h1>
  
  
  Combining Scenario-Free Tests
</h1>

<p><strong>Scenario-free tests</strong> include <strong>model checking</strong> and <strong>property-based testing (PBT)</strong>—especially <strong>fuzzing</strong>.<br>
We outlined them in Part 4 (Jan 2025 issue) and detailed PBT in Part 5 (Feb 2025 issue).

<ul>
<li>
<strong>Model checking</strong> exhaustively explores a system’s state space to verify properties.</li>
<li>
<strong>Property-based testing</strong> auto-generates inputs while humans supply properties relating inputs and outputs.
When the only property is “no exception/crash,” the practice is called <em>fuzzing</em>.</li>
</ul>

<p>Their advantage: even without concrete scenarios, they can <em>roughly</em> test vast areas that high-value scenarios never visit.<br>
Example: a crawler that follows every link on a site and asserts no 5xx status or client-side error.<br>
It checks that reachable pages at least don’t error out—though it can’t verify you landed on the <em>intended</em> page, so it is “coarser” than scenario-based E2E tests.

<p>A common pain point is wasting time revisiting already-seen states.<br>
Consider a linear sequence of N screens with <em>Next</em> and <em>Back</em> buttons (only one button at each end).<br>
A random tester that presses available buttons uniformly needs an expected 

<span class="katex-element">
  <span class="katex"><span class="katex-mathml">(N−1)2(N-1)^2</span><span class="katex-html"><span class="base"><span class="strut"></span><span class="mopen">(</span><span class="mord mathnormal">N</span><span class="mspace"></span><span class="mbin">−</span><span class="mspace"></span></span><span class="base"><span class="strut"></span><span class="mord">1</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist"><span><span class="pstrut"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>
</span>
 presses to reach the far end.

<p>For 
<span class="katex-element">
  <span class="katex"><span class="katex-mathml">N=10N = 10</span><span class="katex-html"><span class="base"><span class="strut"></span><span class="mord mathnormal">N</span><span class="mspace"></span><span class="mrel">=</span><span class="mspace"></span></span><span class="base"><span class="strut"></span><span class="mord">10</span></span></span></span>
</span>
, that is 81 presses.<br>
If the tester <em>never</em> revisits a state, the expectation drops to 
<span class="katex-element">
  <span class="katex"><span class="katex-mathml">N−1=9N − 1 = 9</span><span class="katex-html"><span class="base"><span class="strut"></span><span class="mord mathnormal">N</span><span class="mspace"></span><span class="mbin">−</span><span class="mspace"></span></span><span class="base"><span class="strut"></span><span class="mord">1</span><span class="mspace"></span><span class="mrel">=</span><span class="mspace"></span></span><span class="base"><span class="strut"></span><span class="mord">9</span></span></span></span>
</span>
 — an 81 vs 9 difference.

<p>Thus, a key to efficient scenario-free testing is <em>state deduplication</em>: avoid revisiting.<br>
For the link crawler, treat each URL as a state ID; record visited URLs and skip repeats.<br>
If no natural ID exists, you must add a mechanism to recognize and remember states.                        </div>
                                            <div class="d-flex flex-row-reverse mt-4">
                            <a href="https://dev.to/kuniwak/software-testing-theory-and-practice-part-7-fundamentals-and-strategies-for-integration-e2e-24ef" class="btn btn-md btn-custom" target="_blank" rel="nofollow">
                                Read More                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="m-l-5" viewBox="0 0 16 16">
                                    <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
                                </svg>
                            </a>
                        </div>
                                        <div class="d-flex flex-row post-tags align-items-center mt-5">
                        <h2 class="title">Tags:</h2>
                        <ul class="d-flex flex-row">
                                                    </ul>
                    </div>
                    <div class="post-next-prev mt-5">
                        <div class="row">
                            <div class="col-sm-6 col-xs-12 left">
                                                                    <div class="head-title text-end">
                                        <a href="https://techdailyfeed.com/optimizing-headless-browser-traffic-cost-reduction-strategies-with-puppeteer-for-efficient-data-scraping">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
                                                <path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z"/>
                                            </svg>
                                            Previous Article                                        </a>
                                    </div>
                                    <h3 class="title text-end">
                                        <a href="https://techdailyfeed.com/optimizing-headless-browser-traffic-cost-reduction-strategies-with-puppeteer-for-efficient-data-scraping">Optimizing Headless Browser Traffic: Cost Reduction Strategies with Puppeteer fo...</a>
                                    </h3>
                                                            </div>
                            <div class="col-sm-6 col-xs-12 right">
                                                                    <div class="head-title text-start">
                                        <a href="https://techdailyfeed.com/software-testing-theory-and-practice-part-6-fundamentals-of-design-for-testability">
                                            Next Article                                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
                                                <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
                                            </svg>
                                        </a>
                                    </div>
                                    <h3 class="title text-start">
                                        <a href="https://techdailyfeed.com/software-testing-theory-and-practice-part-6-fundamentals-of-design-for-testability">Software Testing: Theory and Practice (Part 6) - Fundamentals of Design for Test...</a>
                                    </h3>
                                                            </div>
                        </div>
                    </div>
                                        <section class="section section-related-posts mt-5">
                        <div class="row">
                            <div class="col-12">
                                <div class="section-title">
                                    <div class="d-flex justify-content-between align-items-center">
                                        <h3 class="title">Related Posts</h3>
                                    </div>
                                </div>
                                <div class="section-content">
                                    <div class="row">
                                                                                            <div class="col-sm-12 col-md-6 col-lg-4">
                                                        <div class="post-item">
                                                                                                                            <div class="image ratio">
                                                                    <a href="https://techdailyfeed.com/aws-solutions-architect-syllabus-saa-c03-exam-domains-topics-study-guide-2025-update">
                                                                        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAEYAQMAAAD1c2RPAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAACVJREFUaN7twQEBAAAAgqD+r26IwAAAAAAAAAAAAAAAAAAAACDoP3AAASZRMyIAAAAASUVORK5CYII=" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8688weza7gjvb0ksa1u.png" alt="AWS Solutions Architect Syllabus (SAA-C03): Exam Domains, Topics & Study Guide (2025 Update)" class="img-fluid lazyload" width="269" height="160"/>
                                                                                                                                            </a>
                                                                </div>
                                                                                                                        <h3 class="title fsize-16"><a href="https://techdailyfeed.com/aws-solutions-architect-syllabus-saa-c03-exam-domains-topics-study-guide-2025-update">AWS Solutions Architect Syllabus (SAA-C03): Exam Domain...</a></h3>
                                                            <p class="small-post-meta">    <span>Apr 24, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
                                                        </div>
                                                    </div>
                                                                                                    <div class="col-sm-12 col-md-6 col-lg-4">
                                                        <div class="post-item">
                                                                                                                            <div class="image ratio">
                                                                    <a href="https://techdailyfeed.com/ajax-to-turbostream">
                                                                        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAEYAQMAAAD1c2RPAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAACVJREFUaN7twQEBAAAAgqD+r26IwAAAAAAAAAAAAAAAAAAAACDoP3AAASZRMyIAAAAASUVORK5CYII=" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb00xm1twdb2rm4e6vjn9.png" alt="ajax to turbostream" class="img-fluid lazyload" width="269" height="160"/>
                                                                                                                                            </a>
                                                                </div>
                                                                                                                        <h3 class="title fsize-16"><a href="https://techdailyfeed.com/ajax-to-turbostream">ajax to turbostream</a></h3>
                                                            <p class="small-post-meta">    <span>Apr 21, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
                                                        </div>
                                                    </div>
                                                                                                    <div class="col-sm-12 col-md-6 col-lg-4">
                                                        <div class="post-item">
                                                                                                                            <div class="image ratio">
                                                                    <a href="https://techdailyfeed.com/mcp-in-the-enterprise-real-world-adoption-at-block">
                                                                        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAEYAQMAAAD1c2RPAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAACVJREFUaN7twQEBAAAAgqD+r26IwAAAAAAAAAAAAAAAAAAAACDoP3AAASZRMyIAAAAASUVORK5CYII=" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fblock.github.io%2Fgoose%2Fassets%2Fimages%2Fmcp-for-enterprise-social-bb8a18872fedc0046ef72bb413dea851.png" alt="MCP in the Enterprise: Real World Adoption at Block" class="img-fluid lazyload" width="269" height="160"/>
                                                                                                                                            </a>
                                                                </div>
                                                                                                                        <h3 class="title fsize-16"><a href="https://techdailyfeed.com/mcp-in-the-enterprise-real-world-adoption-at-block">MCP in the Enterprise: Real World Adoption at Block</a></h3>
                                                            <p class="small-post-meta">    <span>Apr 22, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
                                                        </div>
                                                    </div>
                                                                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                                            <section class="section section-comments mt-5">
                            <div class="row">
                                <div class="col-12">
                                    <div class="nav nav-tabs" id="navTabsComment" role="tablist">
                                                                                    <button class="nav-link active" data-bs-toggle="tab" data-bs-target="#navComments" type="button" role="tab">Comments</button>
                                                                            </div>
                                    <div class="tab-content" id="navTabsComment">
                                                                                    <div class="tab-pane fade show active" id="navComments" role="tabpanel" aria-labelledby="nav-home-tab">
                                                    <form id="add_comment">
        <input type="hidden" name="parent_id" value="0">
        <input type="hidden" name="post_id" value="135159">
        <div class="form-row">
            <div class="row">
                <div class="form-group col-md-6">
                    <label>Name</label>
                    <input type="text" name="name" class="form-control form-input" maxlength="40" placeholder="Name">
                </div>
                <div class="form-group col-md-6">
                    <label>Email</label>
                    <input type="email" name="email" class="form-control form-input" maxlength="100" placeholder="Email">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label>Comment</label>
            <textarea name="comment" class="form-control form-input form-textarea" maxlength="4999" placeholder="Leave your comment..."></textarea>
        </div>
        <div class="form-group">
            <script src="https://www.google.com/recaptcha/api.js?hl=en"></script><div class="g-recaptcha" data-sitekey="6LduZ7IqAAAAAKfe7AeVbVcTGz_oE2naGefqcRuL" data-theme="dark"></div>        </div>
        <button type="submit" class="btn btn-md btn-custom">Post Comment</button>
    </form>
<div id="message-comment-result" class="message-comment-result"></div>
                                                <div id="comment-result">
                                                    <input type="hidden" value="5" id="post_comment_limit">
<div class="row">
    <div class="col-sm-12">
        <div class="comments">
                        <ul class="comment-list">
                            </ul>
        </div>
    </div>
    </div>                                                </div>
                                            </div>
                                                                            </div>
                                </div>
                            </div>
                        </section>
                                    </div>
            </div>
            <div class="col-md-12 col-lg-4">
                <div class="col-sidebar sticky-lg-top">
    <div class="row">
        <div class="col-12">
                    <div class="sidebar-widget">
            <div class="widget-head"><h4 class="title">Popular Posts</h4></div>
            <div class="widget-body">
                <div class="row">
                                                <div class="col-12">
                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/cyberpunk-developer-says-its-building-on-top-of-the-ps4-version-with-switch-2">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://i0.wp.com/mynintendonews.com/wp-content/uploads/2025/04/cyberpunk_2077.jpg?fit=3840%2C2160&ssl=1" alt="Cyberpunk developer says its building on top of the PS4 version with Switch 2" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/cyberpunk-developer-says-its-building-on-top-of-the-ps4-version-with-switch-2">Cyberpunk developer says its building on top of th...</a></h3>
        <p class="small-post-meta">    <span>Apr 27, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                            </div>
                                                    <div class="col-12">
                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/video-nintendo-shares-more-footage-of-zelda-wind-waker-for-switch-online">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://images.nintendolife.com/3a87753436553/large.jpg?#" alt="Video: Nintendo Shares More Footage Of Zelda: Wind Waker For Switch Online" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/video-nintendo-shares-more-footage-of-zelda-wind-waker-for-switch-online">Video: Nintendo Shares More Footage Of Zelda: Wind...</a></h3>
        <p class="small-post-meta">    <span>Apr 27, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                            </div>
                                                    <div class="col-12">
                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/a-practical-guide-to-the-cp-copy-command-in-linux">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsp2yf15zl0iezy5lhyk.jpg" alt="A Practical Guide to the cp (Copy) Command in Linux" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/a-practical-guide-to-the-cp-copy-command-in-linux">A Practical Guide to the cp (Copy) Command in Linux</a></h3>
        <p class="small-post-meta">    <span>Apr 27, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                            </div>
                                                    <div class="col-12">
                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/master-nextjs-in-60-days-the-ultimate-day-by-day-roadmap-with-ebook-guide">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1ovkki0mpmar6jfrwm1.png" alt="Master Next.js in 60 Days: The Ultimate Day-by-Day Roadmap (With Ebook Guide)" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/master-nextjs-in-60-days-the-ultimate-day-by-day-roadmap-with-ebook-guide">Master Next.js in 60 Days: The Ultimate Day-by-Day...</a></h3>
        <p class="small-post-meta">    <span>Apr 27, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                            </div>
                                                    <div class="col-12">
                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/flutterda-card-kullanimi-sik-ve-basit-bir-baslangic">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xfu2mmts9qhinlosalw.png" alt="Flutter’da Card Kullanımı: Şık ve Basit Bir Başlangıç" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/flutterda-card-kullanimi-sik-ve-basit-bir-baslangic">Flutter’da Card Kullanımı: Şık ve Basit Bir Başlangıç</a></h3>
        <p class="small-post-meta">    <span>Apr 27, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                            </div>
                                        </div>
            </div>
        </div>
            </div>
    </div>
</div>            </div>
        </div>
    </div>
</section>
    <style>
        .post-text img {
            display: none !important;
        }

        .post-content .post-summary {
            display: none;
        }
    </style>
<script type="application/ld+json">[{
"@context": "http://schema.org",
"@type": "Organization",
"url": "https://techdailyfeed.com",
"logo": {"@type": "ImageObject","width": 190,"height": 60,"url": "https://techdailyfeed.com/assets/img/logo.svg"},"sameAs": []
},
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "url": "https://techdailyfeed.com",
    "potentialAction": {
        "@type": "SearchAction",
        "target": "https://techdailyfeed.com/search?q={search_term_string}",
        "query-input": "required name=search_term_string"
    }
}]
</script>
<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://techdailyfeed.com/software-testing-theory-and-practice-part-7-fundamentals-and-strategies-for-integration-e2e-testing"
    },
    "headline": "Software Testing: Theory and Practice (Part 7) - Fundamentals and Strategies for Integration & E2E Testing",
    "name": "Software Testing: Theory and Practice (Part 7) - Fundamentals and Strategies for Integration & E2E Testing",
    "articleSection": "Dev.to",
    "image": {
        "@type": "ImageObject",
        "url": "https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhr49ycmrhdk0gd0oenuu.JPG",
        "width": 750,
        "height": 500
    },
    "datePublished": "2025-04-27T04:10:05+0100",
    "dateModified": "2025-04-27T04:10:05+0100",
    "inLanguage": "en",
    "keywords": "Software, Testing:, Theory, and, Practice, Part, Fundamentals, and, Strategies, for, Integration, E2E, Testing",
    "author": {
        "@type": "Person",
        "name": "tedwalid"
    },
    "publisher": {
    "@type": "Organization",
    "name": "TechDailyFeed",
    "logo": {
        "@type": "ImageObject",
        "width": 190,
        "height": 60,
        "url": "https://techdailyfeed.com/assets/img/logo.svg"
    }
    },
    "description": "
  
  
  Key Takeaways




Integration tests can uncover integration bugs caused by specification mismatches between components that unit tests cannot detect.
Their downsides are long execution times, flaky results, and high maintenance costs.
To keep maintenance costs low, minimize the number of integration-test cases and compose them from high-value test scenarios.
Combine them with “autopilot”–style tests that require no explicit scenarios.



  
  
  Characteristics of Integration & E2E Testing


Integration testing targets a group of components combined together.
Unlike unit tests—where all dependencies are replaced with test doubles—integration tests run the real components.
Because some of those components may have long processing times, test runs tend to be slow.
If the components communicate over a network, disconnections or latency can also make results unstable.

E2E (end-to-end) testing exercises the entire system with all components integrated.
Since more components are involved, execution takes even longer, and E2E tests inherit the same flakiness issues.

Despite these drawbacks, integration and E2E tests remain indispensable because they can detect integration bugs earlier than system-level manual testing.
An integration bug is a defect arising from a mismatch between the specifications of two or more components.

Example: Component A outputs a string, while Component B expects an integer.
Each component individually satisfies its own specification, so their unit tests pass.
But when they are wired together in a dynamically-typed language, a run-time type error can occur.
Other examples include misunderstandings of a dependency’s API or unintended states/transitions when concurrently running components interact.

Integration—and especially E2E—targets almost invariably hold state.
As you combine more components, the state space explodes, so any practical test can explore only a tiny fraction of all possible states.

Here are two keys to successful integration/E2E testing:


Cover the tiny fraction you can test with high-value scenarios.
Use scenario-free tests to coarsely cover the vast remainder of the state space.


We start with choosing high-value scenarios.

  
  
  Column: Formal Specification Descriptions


Because integration bugs stem from spec mismatches, they could be caught during specification writing—if specifications are written in a machine-checkable form.
Such techniques are known as formal specification descriptions.
A concise explanation is beyond this article’s scope.

  
  
  Choosing High-Value Scenarios


In this article, a test scenario consists of


a sequence of events fed into the integrated system, and
an oracle that judges the final state.


An event is anything that triggers a change of internal state—method calls, network messages, UI actions, and so on.
Events also represent interaction: one event can simultaneously change several components (e.g., a request alters both client and server state).

In short, a scenario executes events in a prescribed order/timing and then inspects the resulting state.
If an exception or crash occurs during the sequence, the test fails.

Below is a sample E2E scenario for a login screen:



describe("Login screen", () => {
  context("When a valid user name and password are entered and the Login button is pressed", () => {
    it("navigates to the Welcome screen", async () => {
      // Event: open the login page
      await driver.get("https://example.com/login");

      // Event: type “kuniwak” into the user name field
      await driver.findElement(By.id("input.username")).sendKeys("kuniwak");

      // Event: type “p4$SW0rD” into the password field
      await driver.findElement(By.id("input.password")).sendKeys("p4$SW0rD");

      // Event: click the Login button
      await driver.findElement(By.id("button.login")).click();

      // Assert navigation to a page whose  is “Welcome”
      await driver.wait(until.titleIs("Welcome"), 1000);
    });
  });
});






The value of a scenario is how much its success reduces failure risk.
Higher-risk-reduction ⇒ higher value.

High-value scenarios fall into two patterns:



High-frequency: executed often in production (typical happy paths).

High severity on failure: even if rare, a defect would be catastrophic.


High-frequency examples
The login path of a service that every user must pass through is high-value because of sheer usage volume.
Analyzing user behavior—e.g., with Google Analytics—helps identify such paths.
Because user behavior evolves, repeat this analysis periodically.

High-severity examples
Payment failure flows rarely occur, but if they do—charging without delivering goods or vice versa—the impact is huge.
Thus payment scenarios are likewise high-value.

To identify high-severity cases, interview people who best understand how the system creates value—domain experts—and enumerate what could go wrong.
For an e-commerce site, two expert-provided scenarios might be:


"
}
</script>
    <footer id="footer">
        <div class="footer-inner">
            <div class="container-xl">
                <div class="row justify-content-between">
                    <div class="col-sm-12 col-md-6 col-lg-4 footer-widget footer-widget-about">
                        <div class="footer-logo">
                            <img src="https://techdailyfeed.com/assets/img/logo-footer.svg" alt="logo" class="logo" width="240" height="90">
                        </div>
                        <div class="footer-about">
                            TechDailyFeed.com is your one-stop news aggregator, delivering the latest tech happenings from around the web. We curate top stories in technology, AI, programming, gaming, entrepreneurship, blockchain, and more, ensuring you stay informed with minimal effort. Our mission is to simplify your tech news consumption, providing relevant insights in a clean and user-friendly format.                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6 col-lg-4 footer-widget">
                        <h4 class="widget-title">Most Viewed Posts</h4>
                        <div class="footer-posts">
                                                                <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/inside-easylab-ai-the-company-that-no-longer-writes-its-own-code">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://media2.dev.to/dynamic/image/width%3D1000,height%3D500,fit%3Dcover,gravity%3Dauto,format%3Dauto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrv9t99o7v7zfl2k6r34.jpeg" alt="Inside Easylab AI: The Company That No Longer Writes Its Own Code" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/inside-easylab-ai-the-company-that-no-longer-writes-its-own-code">Inside Easylab AI: The Company That No Longer Writ...</a></h3>
        <p class="small-post-meta">    <span>Apr 18, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                                                                    <div class="tbl-container post-item-small">
            <div class="tbl-cell left">
                            <div class="image">
                    <a href="https://techdailyfeed.com/4-agentic-ai-design-patterns-real-world-examples">
                        <img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="https://research.aimultiple.com/wp-content/uploads/2025/04/agentic-wokrflows.png" alt="4 Agentic AI Design Patterns & Real-World Examples" class="img-fluid lazyload" width="130" height="91"/>
                                            </a>
                </div>
                    </div>
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/4-agentic-ai-design-patterns-real-world-examples">4 Agentic AI Design Patterns & Real-World Examples</a></h3>
        <p class="small-post-meta">    <span>Apr 18, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                                                                    <div class="tbl-container post-item-small post-item-no-image">
        <div class="tbl-cell right">
        <h3 class="title"><a href="https://techdailyfeed.com/weekly-review-25-april-2025">Weekly Review 25 April 2025</a></h3>
        <p class="small-post-meta">    <span>Apr 19, 2025</span>
    <span><i class="icon-comment"></i> 0</span>
</p>
    </div>
</div>                                                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6 col-lg-4 footer-widget">
                                                    <h4 class="widget-title">Newsletter</h4>
                            <div class="newsletter">
                                <p class="description">Join our subscribers list to get the latest news, updates and special offers directly in your inbox</p>
                                <form id="form_newsletter_footer" class="form-newsletter">
                                    <div class="newsletter-inputs">
                                        <input type="email" name="email" class="form-control form-input newsletter-input" maxlength="199" placeholder="Email">
                                        <button type="submit" name="submit" value="form" class="btn btn-custom newsletter-button">Subscribe</button>
                                    </div>
                                    <input type="text" name="url">
                                    <div id="form_newsletter_response"></div>
                                </form>
                            </div>
                                                <div class="footer-social-links">
                            <ul>
                                                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer-copyright">
            <div class="container-xl">
                <div class="row align-items-center">
                    <div class="col-sm-12 col-md-6">
                        <div class="copyright text-start">
                            © 2025 TechDailyFeed.com - All rights reserved.                        </div>
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div class="nav-footer text-end">
                            <ul>
                                                                            <li><a href="https://techdailyfeed.com/terms-conditions">Terms & Conditions </a></li>
                                                                                    <li><a href="https://techdailyfeed.com/privacy-policy">Privacy Policy </a></li>
                                                                                    <li><a href="https://techdailyfeed.com/publish-with-us">Publish with us </a></li>
                                                                                    <li><a href="https://techdailyfeed.com/download-app">Get the App Now </a></li>
                                                                                    <li><a href="https://techdailyfeed.com/delete-your-account">Delete Your Account </a></li>
                                                                                    <li><a href="https://techdailyfeed.com/cookies-policy">Cookies Policy </a></li>
                                                                    </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <a href="#" class="scrollup"><i class="icon-arrow-up"></i></a>
    <div class="cookies-warning">
        <button type="button" aria-label="close" class="close" onclick="closeCookiesWarning();">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-x" viewBox="0 0 16 16">
                <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
            </svg>
        </button>
        <div class="text">
            <p>This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies.</p>        </div>
        <button type="button" class="btn btn-md btn-block btn-custom" aria-label="close" onclick="closeCookiesWarning();">Accept Cookies</button>
    </div>
    <script src="https://techdailyfeed.com/assets/themes/magazine/js/jquery-3.6.1.min.js "></script>
    <script src="https://techdailyfeed.com/assets/vendor/bootstrap/js/bootstrap.bundle.min.js "></script>
    <script src="https://techdailyfeed.com/assets/themes/magazine/js/plugins-2.3.js "></script>
    <script src="https://techdailyfeed.com/assets/themes/magazine/js/script-2.3.min.js "></script>
    <script>$("form[method='post']").append("<input type='hidden' name='sys_lang_id' value='1'>");</script>
    <script>if ('serviceWorker' in navigator) {window.addEventListener('load', function () {navigator.serviceWorker.register('https://techdailyfeed.com/pwa-sw.js').then(function (registration) {}, function (err) {console.log('ServiceWorker registration failed: ', err);}).catch(function (err) {console.log(err);});});} else {console.log('service worker is not supported');}</script>
<!-- Matomo -->
<script>
  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//analytics.djaz.one/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '20']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->    </body>
    </html>