The measurement is a small program (Java applet) that runs on your
computer. For the download measurement it asks the Numion server to
generate random and uncompressible data. While receiving the data it
measures the speed and when it has enough information
it stops, minimizing the time and the amount of data used.
The upload measurement does the same, but this time the Java applet
on your computer generates the random data and the Numion server does
the measuring.
Example

At time=zero the measurement on your computer sends a request
for data to the Numion server. The request travels through the internet
and the server replies by sending a stream of data back at maximum speed.
The graph is a timeline from left to right in seconds. The yellow
line shows the total number of bytes received and goes up whenever a block
of data is received.
There are two reasons why the yellow line forms a staircase.
First, networks use blocking to optimize performance. Data is not received
bit by bit, but in large blocks, hence the staircase.
Second, the clock in your computer will "tick" every now and then, for
example every 10 milliseconds, depending on operating system and
Java implementation. Networks nowadays are so fast that lot's of data
can be received during a single clocktick, again showing a staircase.
The white line in the graph shows your speed. The steeper the line, the
higher your speed.
The mathematical formula for a straight line is "Y = A + B * X", where
A and B are constants. The formula can be rewritten as
"Y = B * (X + A/B)", or in our case:
BitsReceived = Speed * (Time - Latency)
The program calculates your speed from the tops of the staircase
with closest-fit linear regression
for all possible intervals with a minimum intervalsize of 7 consecutive
steps, and determines the interval with the highest R-square.
The measurement will last for at least 10 steps, stops after 30 steps,
or after 10 seconds, or when 10 megabyte has been sent,
or when 7 consecutive steps are found with a
very regular pattern (R-square better than 99.5%).