Hi Junaid, as the name suggests, Modular frameworks divides the test scripts into small modules where modules are small scripts written to perform certain tasks. Modules interact with each other in a hierarchical fashion to form a big script which aims at doing a certain test run. Modular framework is like creation of small, independent scripts that represents modules, sections and functions of the application under test.
Testers use Modular testing framework to divide an application into multiple modules and create test scripts individually. These individual test scripts can be combined to make larger test scripts by using a master script to achieve the required scenarios. This master script is used to invoke the individual modules to run end to end test scenarios. In this framework, testers write function libraries to use it whenever required.