Monday, November 23, 2009

continuous integration

Add to Delicious Digg this links to this post -

Countinuous integration is the last buzz word... keep reading it everywehre.

What is continuous integration
Continuous integration is a software development process, which ensures that bugs which have been detected earlier are not coming back into the code un-noticed.

It relies on a few principles:
  • use of a version control: each time someone carries out a commit, a new build a done automatically in the background
  • automatic build: as seen above, a build can be automatically triggered.
  • automatic testing: the bug raised and fixed previously must have a matching unit test which will automatically test whether it is still fixed or not.
Continuous integration and PHP
A few tools can be useful to get started with "continuous integration".

Test Driven Development (TDD)
The idea behind TDD is to write the test before starting coding. The objective of the code should be to get the test passing.

This can be nicely applied to continuous integration: whenever a bug is raised:
1) Write the unit test for it, which currently fails
2) Write the fix.

The idea is that the tester could actually build the unit test**, so that the developer can still focus on development.

Note **:It is worth considering integration testing also, using selenium RC for instance.

Labels: , ,

Wednesday, October 03, 2007

testing new developers (PHP, OO)

Add to Delicious Digg this links to this post -

It has been a real challenge in the past to find PHP developers with solid Object Oriented programming skills. I have come up with a test, which I think is pretty good at spotting potential weaknesses:

TEST:
Brief: we need a parser which will replace a list of keywords in the following text with links:
‘welcome to my testing page. My <strong>website</strong> is about advanced Object Oriented Programming in PHP, and provides <a href="”/guidelines”" title="”guidelines”">guidelines</a> about how to become an expert in this area. I would recommend you to read “PHP 5 Objects, Patterns and Practice” before <span title="”guidelines”">browsing</span> further the guidelines section. This will give you all the basics you need to know before moving to more advanced techniques.’

Keyword 1: “my website” => replace with “<a href="”/link1.html”">my website</a>"
Keyword 2: “guidelines” => replace with “<a href="”/guidelines-home.html”">guidelines</a>"

Rules:
1) Case insensitive (‘test’ => ‘<a href="”test.html”">test</a>’) implies that ‘Test’ should be converted to ‘<a href="”test.html”">Test</a>
2) If the keyword is already linked to a page, should not be parsed and converted to a new link
3) Remove html within the <a> tag

Requirements:
1) This can be coded using PHP4 or PHP5 syntax, but using object oriented approach
2) We will take into account:
a. Well commented code (with no typo errors)
b. Proper use of errors handling
c. Code structure
d. Proper use of regular expressions
e. Good use of inheritance: the class parser should be as generic as possible, and specific rules should be implemented using extension of the main class Parser for instance.
f. Good use of design patterns
g. Set of rules is incomplete: suggestions for new rules will be appreciated (example: only parse text, not tags attributes)

Extra: Ability to configure replacements – an interface should allow user to add/delete/modify keywords and links, and store the list of keywords and related links into the database (or text file), which are then retrieved by the parser.

let me know what you think?

Labels: , , ,