Header image

Symfony Finland
Random things on PHP, Symfony and web development

Improve Quality with Software Components

Software bugs are familiar to both the developers and users of software. In his book, the Science of Debugging, Matthew A. Telles offers the following definition for a bug: “Bugs are behaviours of the system that the development team (developers, testers and project managers) and customers have agreed are undesirable.”

Due to human errors and bad specifications, bugs will continue to be a part of software development projects. Despite improved tooling and the introduction of Agile methodologies.

While web application development is a relatively new branch of software engineering, many of the traditional software engineering practices apply to it:

Following proper software engineering techniques (or modifying them for web development) can have a substantial impact on overall system usability primarily because it enables developers to achieve higher quality.

Usability for the Web: Designing Web Sites that Work, 2001

Web development as an industry has grown up from something that was considered tinkering with something secondary to a crucial business function. In the last five years or so the advent of Version Control (and GitHub as a platform), Automated Testing and Packet Management have given the web development community shared tools to achieve better quality than ever before.

None of these concepts are really new as creation complex software, like Operating Systems, has required similar tools to be able to be built at all. Sure the old tools (even Subversion today) seem cumbersome to use and limited in functionality - but they all served the same goal: Help developers work in teams to achieve a common goal.

All of the above is just tooling, but it also takes other things to achieve better quality. For a long time web developers in general were subject to the NIH (Not Invented Here) syndrome.

Web developers - all grown up

Web developers have gone through the typical evolution cycle. We first tended to build everything from scratch in our programming language of choice. Then we moved forward to adding structure and common methods via Web Application Frameworks, but we still spent a lot of time working on similar problems.

Today it is quite commonplace for Node.js and PHP developers to first look at NPM or Packagist if there is a software component that would help us do a particular task in our software. Perl developers had CPAN (the Comprehensive Perl Archive Network) since the nineties, so this concept is not exactly new either.

It's great that mainstream web developers have learned to put their ego aside to achieve higher productivity and better quality. Components shared with a whole community of users and use scenarios are bound to be more robust over time.

Software Components in PHP

In the realm of this blog, Symfony and other PHP components, with strong decoupling (independency of the core application, such as a CMS, of any individual component) are a great thing. PHP has matured to something that allows us to build complex software with a flexible architecture to evolve during the application lifetime cycle.

So instead of PHP developers separately solving problems of traversing filesystems or SQL abstractions, we can now share and take these into use easily. Please note that this is a shared responsibility that is underlined in a tweet from Lukas Kahwe Smith, on the state of contributions to popular Symfony Bundles FOSUserBundle and FOSRestBundle:

One of the best examples of reuse of common components like templating, HTTP communications, configuration file processing, and more are Content Management Systems. There's still likely room for improvement here, but read how three different CMS products (Bolt, Drupal and eZ Platform) have taken Symfony Components into use.

This all obviously focuses on the server side application development, which pales in comparison to the improvements, like web components, that have taken the front end developer community by storm.

For perspective and examples of popular components, the top ten packages on Packagist.org at the time of writing are:

  1. monolog/monolog
    Sends your logs to files, sockets, inboxes, databases and various web services
  2. psr/log
    Common interface for logging libraries
  3. symfony/event-dispatcher
    Symfony EventDispatcher Component
  4. phpunit/php-code-coverage
    Library that provides collection, processing, and rendering functionality for PHP code coverage information.
  5. symfony/yaml
    Symfony Yaml Component
  6. symfony/console
    Symfony Console Component
  7. phpunit/phpunit
    The PHP Unit Testing framework.
  8. phpunit/phpunit-mock-objects
    Mock Object library for PHPUnit
  9. phpunit/php-text-template
    Simple template engine.
  10. phpunit/php-token-stream
    Wrapper around PHP's tokenizer extension.

Written by Jani Tarvainen on Saturday July 18, 2015
Permalink - Tags: webdev, php, symfony

Leave a comment

comments powered by Disqus

« Baseline Performance in PHP, Symfony and Doctrine ORM - Using Blackfire for debugging production environments »