Improving Drupal development with Extreme Programming practices
Has anyone applied XP principles in Drupal development?
E.g. I wonder about such things as unit testing and whether it may be used in Drupal development, or about continous integration. I am not sure about unit testing, because Drupal environment is a very specific thing and not enough object oriented to have mock objects. As I see it, peer-reviews can be realized in Drupal development, but more at the level where you discuss with another person which of the combinations of code and module开发者_运维问答s can be used to solve some task - this is where you usually make decisions in Drupal.
Also, there could be some development practices that help teams build Drupal site collaboratively with better effectiveness and I wonder if there are any.
If anyone has developed big Drupal sites in team, I appreciate your feedback on this progress, e.g. what you did to make development and management better.
Have you looked at the Simpletest module? It's separate in D5 and D6, but in D7 it comes baked in. This is how I usually do my unit testing.
It's true that you can't do mock objects. instead, each test actually creates a brand new installation of drupal in a new database, runs whatever test you've specified, and then cleans up after itself. So, mocking the database is less of a problem.
That said, in Drupal 7 we've also got DBTNG, which is object oriented.
There are no barriers to it but a few pitfalls.
We use CI, unit tests, and peer reviews with a team of around 20 Drupal developers. Using subversion when a developer commits a job is triggered to build and test using Hudson. There is an AIM that you can use for this should you want to.
The pitfalls. One is configuration, we change this via update statements in a module created specifically for this. However this is not as reliable as we would like, and some configuration changes are very hard to express in code.
The other is that Simpletest is a little strange with it's setup so you have to create data from scratch. While this is good from a Unit testing pont of view. It makes automated testing of your final set up difficult.
However it has worked well for us and we are looking at using something like selenium for whole site testing.
We use scrum as a management framework, which seems to work quite well. It is also important with a larger project to have modules for distinct areas of functionality. Use contrib modules as much as you can.
Pair programming is certainly possible. Continuous integration? If you set up some automated builds / tests that will run on every check-in, you can go a long way towards that. Iterations, the planning game, and things of that nature can easily be incorporated. Test Driven Development, even if not from a unit-testing standpoint - write a quick UI test (using Selenium for instance) and you can do red-green-refactor.
What I'm wondering is, what about Drupal makes you think it's in any way unique? :)
精彩评论