DUOK - Audit

DUOK has a number of legacy web based applications which service requests with PHP scripts. Since these typically contain a mixture of different types of logic (presentation, business, database, etc) as the years have passed and the applications have evolved it has become increasingly expensive to maintain them or to add new features. Our objective for this collaboration was to review current development practices and the proposed future application architecture to identify any areas that could be improved and then give whatever "hands on" support was needed.

The way that we organised the two week consultation was to split it into three parts. From our Valencia office, the week prior to the on-site work, two days were spent on getting up to speed with the applications, the proposed future architecture and the technologies involved. We also spent some time expanding on the preliminary plan (included below) using the answers to a brief questionnaire that we often use with first time clients and along with information gleaned from some other conversations that we had.

This was followed by five days of working with the team from DUOK on-site in San Sebastian. Using the preliminary plan as a guide, and depending on the subject that we wanted to cover, we worked in a single group, smaller groups or pairs in order to more effectively disseminate information. At the end of the week we had put aside a series of tasks for the three days of follow up that we did from the office in Valencia, using Skype and Dropbox to communicate, whenever it was necessary.

Revision / Definition of the companies development methodology

  • Combination of scripts (Powershell, launchy, bash) and other tools (Phing, Rake, Capistrano) to facilitate development and deployment processes
  • The configuration and correct use of SVN (trunk, branches, tags, svn:externals, svn:keywords)
  • How to work in a team with a version control system and how to avoid and resolve problems
  • How to get the most out of the integration between a project management tool (in this case, Redmine) and SVN
  • Construction and use of a continuous integration server (Cruise Control and PhpUnderControl)
  • Configuration of continuous integration for developers
  • Automatic generation of documentation, test reports, coverage reports and other metrics
  • Testing - prerequisites for unit, integration and functional tests (functional tests go through the dispatcher / filters)
  • Introduction to performance testing

Definition of a standard architecture for PHP applications

  • Definition of environments and their requirements (desarrollo, test, staging, producción)
  • Best practices for programmers (general), configuration and use of Eclipse
  • Best practices for object oriented programming with PHP
  • How to enable a change in mentality and get the most out of Test Driven Development
  • Use of design patterns (focused on those that are currently used by Symfony but some others will be outlined)
  • How to use a facade to hide the interaction with an external service and make the code more robust and independent
  • The use of caches at different levels
  • i18n - how best to implement multi-language functionality in applications (application data and presentation elements)
  • Set up, management and use of external configuration files
  • Treatment of errors within an application (Exceptions)
  • Logging

Definition of an architecture for the web / presentation layer

  • Define standards of use for HTML, CSS y javascript to assure quality, performance and browser independence
  • Javascript - libraries, architecture and testing
  • Javascript standards for developers
  • How to configure and use Selenium to test with different browsers
  • HTML y CSS standards for developers
  • Implications for developers and designers of HTML 5 and CSS 3

Database Design - optimised for "frameworks"

  • Use of scripts to create and manage any type of DB
  • How to configure and use a DB, taking into account things like:
    • Configuration of users and permissions
    • Selection of storage engines
    • Naming conventions
    • Consistent length and type of similar fields
    • Encoding
    • Selection of primary keys, foreign keys and indexes
    • Identification and definition of the sets of data necessary for each environment
  • How to profile the performance of SQLs and indexes to avoid or solve problems