top down vs bottom up approach code example

Example 1: bottom up approach vs top down

Testing takes place from top to bottom. 
High-level modules are tested first and
then low-level modules and finally 
integrating the low-level modules to
a high level to ensure the system is
working as intended. Stubs are used as
a temporary module if a module is 
not ready for integration testing.

It is opposite of the Top-Down Approach. 
Testing takes place from bottom to up. 
Lowest level modules are tested first
and then high-level modules and finally
integrating the high-level modules to a
low level to ensure the system is 
working as intended.  Drivers are used
as a temporary module for integration testing.

Example 2: top down vs bottom up approach

Top down SOAP Web services include 
creating WSDL(Web Services Description Language) 
document to create a 
contract between the web service and
the client, with a required code as
an option. This is also known as 
Contract-first approach. The top-down
approach is difficult to implement 
because classes must be written to 
confirm the contract defined in WSDL. 
One of the benefits of this method is
that both client and server code can
be written in parallel.
Bottom up SOAP web services require 
the code to be written first and then
WSDL is generated. It is also known
as Contract-last approach. Since WSDL
is created based on the code, bottom-up
approach is easy to implement and client
codes must wait for WSDL from the server
side to start working.

Example 3: bottom up approach

It is opposite of the Top-Down Approach. 
Testing takes place from bottom to up. 
Lowest level modules are tested first
and then high-level modules and finally
integrating the high-level modules to a
low level to ensure the system is 
working as intended.  Drivers are used
as a temporary module for integration testing.

Example 4: difference between bottom up approach vs top down

Testing takes place from top to bottom. 
High-level modules are tested first and
then low-level modules and finally 
integrating the low-level modules to
a high level to ensure the system is
working as intended. Stubs are used as
a temporary module if a module is 
not ready for integration testing.

It is opposite of the Top-Down Approach. 
Testing takes place from bottom to up. 
Lowest level modules are tested first
and then high-level modules and finally
integrating the high-level modules to a
low level to ensure the system is 
working as intended.  Drivers are used
as a temporary module for integration testing.

Tags:

Misc Example