1.

What do you understand about stubs and drivers? Differentiate between them.

Answer»
  • Stub: Stubs are created by software developers to be used in place of modules if the respective modules have not been constructed, are missing in the development stage, or are currently unavailable during Top-down testing. A stub is a module that mimics the functionality of an unavailable module. Stubs are used when lower-level modules are required but are currently unavailable. For instance, suppose you have three different modules: Login, Home, and User. Assume that the login module is ready for testing, but the two minor modules Home and User, which are invoked by the login module, are not. At this point, a piece of fake code is written to replicate the Home and User functions. The stubs are the dummy parts of the code.
  • Driver: Drivers are similar to stubs in that they SERVE the same goal, but they are more complicated and are utilised in Bottom-up integration testing. Drivers are also used to operate in the absence of essential modules when some modules are absent and unavailable at the time of testing a specific module due to unforeseen circumstances. When high-level modules are missing, drivers are utilised. They can also be used when lower-level modules are missing.
    • Let's use the same example as before. Assume that the User and Home modules are ready to test this time, but the Login module is not. Because the Login module returns data to Home and User, a dummy piece of code is developed to emulate the Login.

The following table lists the DIFFERENCES between Stub and Driver:

StubDriver
In Top-Down Integration Testing, stubs are employed.In Bottom-Up Integration Testing, drivers are used.
Stubs are analogous to software modules that are in the development stage.Drivers are ACCUSTOMED to invoking the component that must be tested.
Stubs are primarily utilised when low-level modules are unavailable.Drivers are mostly used to replace high-level modules, they can also be used to replace low-level modules in specific cases.
They are also referred to as “called programs”.They are also referred to as “calling programs”.
To test the features and functionality of the modules, stubs are used.If the CORE module of the software is not developed for testing, the drivers are used.
If upper-level module testing is completed but lower-level module development is ongoing, the stubs are taken into consideration.If lower-level module testing is completed while upper-level module development is underway, the drivers are taken into consideration.
Stubs are used to test the main module when lower-level modules are unavailable or in a partially completed state. When higher-level modules are absent or in a partially built state and we wish to test the lower(sub)-module, we use drivers.
Conclusion

A rigorous quality assurance strategy yields a software product that is both high-quality and error-free. However, quality assurance entails a lot more. Quality assurance is vital for many parts of the BUSINESS, including client interactions and the company's reputation in the market, in addition to finding flaws and places for improvement in a product.

Useful Resources:

Software Testing

Automation Testing



Discussion

No Comment Found