Monday, August 17, 2009

Methodology and Framework for Web Applications

Unit Testing Framework.
The main benefit of structured, modular programming in any language is that the MVC components are strictly self contained and that they can be cleanly taken from any of their mother project and worked for other projects on its own.

Designing the Interface of Your class.
It is said that the most important part of Your object hierarchy is the interface and the less important is its implementation.ForExample: Let us assume that You are designing a yser class; For designing a user class You would first think about is a username, first name, last name, and encrypted password properties. Any of the security of these users to which they belong, and know details of their last login. Figuring out the users last login can be designed and programmed in many ways. Its on You to choose the correct and simpler way for Your web application. Approaching these terms the unit-testing friendly workflow is a simple method.

Creating a Test Suite for Your class.
The function of a test suite is to provide a simple black-box solution for testing Your class. When invoked, it hooks directly into the important functionality of Your class, performs a series of tests and then states whether those tests were succesful. It is truely an applicaton.

Each test method follows the same basic PHP pattern for web applications:

1. Decide upon some input parameters for the test class method.
2. Determine what the result expected to be returned from the test class method is based on those input parameters.
3. Call that method, with those input parameters, and trap the result.
4. Assert the result to be equal to what was determined to be the expected result.

Writing the implementation of Your class.
The test suite helps you write even altering the interface of Your class. A test suite is made for rooting out logic errors rather than compilation errors. If Your class talks to a database, it should also check any database SQL queries before you walk away from the implementation. Because PHP isnt closely linked into the database server, rooting out malformed SQL syntax may be easier to do now than after you discover that Your test suite fails on one or more methods.

For example: $sql = "SELECT group_id FROM user_group WHERE user_id = $user_id";
Substitue the $user_id for a sensible value and check that the query works in the Postgre SQL (or other) console. If it does, You're in business.

The Second run.
Now its time to fire up the test suite black-box once more. And now the test results should come positive. But if they dint turn positive, this time to retrace Your steps. This is where traditional debugging methods may come in handy.

After the test suite runs with oop's positive result, You can be confident that Your class is ready for the production environment, ansd You can accordingly integrate it into the mother application.

Regression Testing.
As the Test suite is diferent kind of web aplications, even the vast majority of code you'll ever work on will, at some stage, need to evolve. You may have to method to make it provide exactly the same functionality as it did before but with a big performance increase. The only way to do this is to completely rewrite the method, keeping the interface the same but with an optimized inner algorithm. In this kind of example, Your testing suite is immensely useful. Simply run it before and after Your new algoritm has been developed and check that You get the same results both times.

Using unit test framework for this kind of testing, is known as regression testing.

Demonstrable Quality Assurance.
A professional software development environment can often contain a complex hierarchy of individuals involved on any given project, from the project manager right through to the lead architect, the software engineers, the designers, and others.

In this kind of enironment, thousands of lines of codes can be churned out at every single dayy, It is, Simply impossible for the projects lead architect to test every single component his or her developers produce.

With this kind of structured testing methodology, the managemnt buzzword of empowerment becomes an achievable reality. That is to say, engineers can be safely trusted to test their own code, because this methodology encourages a thoroughness that is often absent in other, more haphazard component can easily standardise quality assurance across all component production and have far greater confidence in his or her teams output as a result.

The formal nature of this process is likely to be viewed favourably with a keen interest in the progress of a project, such as project and account managers.



Related Links :
Internet Media Solutions l Superhostindo l Jababeka Business l Ayo Kencan l Kesaksian Kristen l Lirik Lagu Rohani Kristen

No comments: