2

Although questions similar to this one has already been asked and I can perhaps assemble the answer for myself by reading already posted materials. Still I am going ahead with the question, cause I feel it has elements of new flavor and I would like to see the views of others on how to tackle this.

I have developed several Web Applications of various scale. In some of them, I was only Developer, in another I led small teams and was part of a big team in another.

Most of these were developed using PHP. One of them used Kohana Framework, the rest were all developed using Raw PHP. The main difficulty that I faced in regards to speedy development was, whenever a small change was done to fix a bug or modify a feature, I had to refresh my web browser, go through several pages until I reached the page which included the fix.

I would like to know, what should be the development approach so that I can test out my code without having to, or at least minimize the number of refreshes required to test out changes in code. Although, the concepts maybe applicable for developments of any nature, for this question, let us stick to PHP and it's framework.

2 Answers 2

4

You're going to have to refresh the page: PHP works on page generation. But you can automate the refreshes using a variety of different methods. Check out this article for four different ways:

Quick Tip: 4 Ways to Auto-Refresh your Browser when Designing new Sites

You'll also want to get into test-driven development. It'll automate the process of testing the same things over and over. For PHP, there's SimpleTest among other frameworks for TDD.

2
  • Thanks. Looks like test-driven development is the way to go. One quick question, is SimpleTest a framework in itself, or it can fit with existing PHP frameworks like Kohana, CakePHP. Commented Nov 21, 2010 at 16:01
  • @Gunner it is a testing framework that works in concert with other frameworks. It allows you to spawn testing environments of your orignal program to run its tests. Drupal uses SimpleTest to this end with great effect.
    – user8
    Commented Nov 21, 2010 at 22:32
3

I would +1 using Test-driven development. This way you would only have to run your tests again (which is still refresh), but less click through to a particular function or a particular case because your test-case would run. Another thing to look into would be automated testing with something like Selinium or Windmill.

1
  • I have heard of using Test Driven Development to speed up development. Perhaps I should look into approaches of TDD using PHP. Commented Nov 21, 2010 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.