How to practice TDD in a web application?

I am new to TDD.

What are some of the methods that you guys use when using TDD to develop webapp?

I am looking for advice for beginners. Practical examples or “military stories” will be appreciated. :)

Bonus: what software do you use for TDD (ideal for the LAMP stack).

+4
source share
5 answers

One way to get a web application is to use some design pattern, such as MVC or similar. The basic idea is to get as much code as possible from web pages and move it to classes that are more encapsulated and suitable for testing. When structuring such code, TDD for a web application is similar to TDD for any other software.

+4
source

As far as tools are concerned, there are unit testing units that execute client-side JavaScript code to validate. QUnit and JSUnit come to mind.

+1
source

Check out the Django map — it has a very powerful integrated testing environment — besides being a really cool structure!

+1
source

Although this does not apply to LAMP, you can take a look at Stephen Walther. ASP.NET MVC Programming Unleashed, which is discussed in detail in it and has some methods that you can use. You can also use Google XUnit PHP and see what pops up.

0
source

Since you are in LAMP, you can try Ruby on Rails.

0
source

All Articles