---
url: https://jasperfx.github.io/alba/guide/history.md
description: >-
  How Alba grew from FubuMVC's scenario testing into a wrapper around the
  ASP.NET Core TestServer, and how AlbaHost is put together.
---

# History & Architecture

What is now Alba was originally created in the early 2010's as a mechanism to test the content negotiation features in [FubuMVC](https://fubumvc.github.io), an alternative web application framework that predates ASP.NET Core.
We needed to run the entire web handling stack including all the middleware and HTTP endpoints just as the application would be configured.
The [early *scenario* support in FubuMVC](https://jeremydmiller.com/2015/11/05/testing-http-handlers-with-no-web-server-in-sight/) was a way to run HTTP requests end to end
completely in memory and make declarative checks on expected HTTP behavior.

As FubuMVC wound down as a project, the scenario testing code was first extracted out into its own library called *Alba*, then ported to depend on an [OWIN-based](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/owin) execution pipeline.
And then again with the advent of ASP.NET Core and the deprecation of OWIN, Alba was again re-wired to use the newer HTTP abstractions from the ASP.NET Core [HttpContext](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontext) type.
At this point, Alba is a value added wrapper around the [ASP.NET Core TestServer](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests).

The *scenario* testing in Alba was inspired by the [testing support in the Scala PlayFramework](https://www.playframework.com/documentation/2.8.x/ScalaFunctionalTestingWithSpecs2).

When using Alba, you bootstrap your web application in memory through one of three models: the application's `IHostBuilder`,
a `WebApplicationBuilder`, or [WebApplicationFactory](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.testing.webapplicationfactory-1)
for an application's entry point. Each returns an awaitable `AlbaHostBuilder` that starts the application and hands back Alba's `AlbaHost`,
which will be the entry point to using Alba in all of your integration tests.

`AlbaHost` is shown in the class diagram below:

![AlbaHost Class Diagram](/ClassDiagram.drawio.png)

`AlbaHost` implements the ASP.NET Core [IHost](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.ihost) interface
for convenience and familiarity. Internally it is tracking the actual `IHost` for your application running in memory as well
as an instance of the ASP.NET Core [TestServer](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests) that will actually be used to execute HTTP requests against the application in memory.
