. Updated Daily. Editions SDA India   SDA Indonesia
JAX Asia 2008 - Conference for Enterprise Java, SOA, Spring, Web Services, Ajax, Agile and more
BUSINESS ENTERPRISE SOLUTIONS ARCHITECTURE INFORMATION SECURITY WIRELESS & MOBILITY DATA & STORAGE DEVELOPMENT HARDWARE













News

Thursday, 22 March 2007

Automatic Testing of MVC Applications with Zend Framework

 

 

Alexander Netkachev in a new post over his blog, speaks about automatic testing of MVC applications created with Zend Framework. He says, the post contains information on how to improve your application stability by controlling changes affecting the Model-View-Controller (MVC) Zend Framework application. The benefit is that you will be able to deliver better software to your customers and reduce the time needed for testing of the software, he says.

He discusses automatic testing under the following sections:

  • Testing should be automatic: he says, the idea of automatizing the process comes into mind just after second of checking the applications and there are enough robust and powerful automatic testing solutions, also known as unit testing frameworks for this. They provide developers with tools and guidelines on how to test software automatically.
  • Program tests program: he is of the opinion that different software requires different testing. It is obvious that the price of a software error is different and what can be required for medical institutions can be just unacceptable for a small content management system. For one function or one class the better solution may be just a file with a few calls of functions and methods and just print ('OK') at the end but more complex systems require a different methods and tools.
  • MVC improves testability: he says what affects a testing process is structure or architecture of the application. Bad architecture usually can be detected by impossibility to select isolated testing areas, like user interface, data model, utility classes, and so on.
  • MVC application creating is easy with Zend Framework: he finds out that creating MVC application with Zend Framework takes less time then creating it without the framework. This is because Zend Framework has good helpers for that and you do not have a chance to do things wrong if you use Zend_Controller, Zend_Db and Zend_View classes.
  • Select and modify data to test Model: he says that model of a Zend Framework application encapsulates access to data storage and relations between data items.
  • View is simple but unsteady: he says that view is very simple by their nature. Zend Framework manual View examples contains plain PHP scripts with almost no logic in them and this is what makes wrong impression that it does not require a special attention in tests.
  • Testing View includes testing Ajax: Another aspect of View testing is Ajax (formerly known as Dynamic HTML). Application page may be perfectly rendered on the server, but opening it in browser may cause a crash or blank screen.
  • Use cases show how to test Controller: Application is created for users and developers usually understand now the application is supposed to be used. At least they recommend using it in some way.
  • Example: he gives an example which shows how to test part of the application that handles new user registrations and singing in.
 

Read the Post

 
 
print save email comment

print

save

email

comment

 
 

Search SDA Asia

Free eNewsletter

SDA Asia Magazine Free Download
 
 
 
Copyright @ 2008 SDA Asia Magazine - All Right Reserved Privacy Policy | Terms of Use