How the MVCS Design Pattern enables Automated White Box Testing by Garth Rose on Dec 07, 2016

The only way to fully test your software is by writing white box tests. However, writing white box tests by hand is a slow, manual, and complex process. There is a new automated white box testing approach from GenRocket that leverages the Model View Controller Service (MVCS) design pattern and we thought you would find this interesting.

The MVCS design pattern further extends the Model View Controller (MVC) design pattern and improves upon the implementation and long-term maintenance and growth of a software application and allows for code that is in the controller and service tier to be fully white box tested.

MVC Components

In order to understand the Model View Controller Service (MVCS) framework we must have a basic understanding of the Model View Controller (MVC) Framework. The MVC framework is a proven design pattern used to implement small to large scale complex applications. There are three components to the MVC framework:

  1. Model: The model manages the data an application.  

  2. View: The view presents the user interface that allows the user to interact and communicate with the computer.

  3. Controller: The controller is the layer that sits between the View and the Model; it takes user input, and uses the application’s business logic to route, save, update, delete and retrieve data.

Why MVC needs to be extended to MVCS

MVC presents a few negative challenges. Since the business logic between the Controller and Model is not encapsulated, many errors in business logic occur. The business logic is also difficult to test and this design pattern does not enforce good coding practices between the controller and the model tiers.

In our next blog post, we’ll dive into the details and benefits of MVCS design pattern and how this can enable your team to use automated White Box testing. If you want to learn more now, take a look at our documentation of the MVCS framework.