Entries tagged as quality assuranceRelated tags annotations customization phpmd release announcement rule set static code analysis cbo coupling between objects php_depend software metrics checkstyle continuous integration cruisecontrol cyclomatic complexity design quality npath complexity php phpunit php_codesniffer pmd class interface size cli bug fix phpundercontrol usability conference hamburg phpugdo unconference ant arbit css dashboard ezcomponents java server pages layout lint php5 phpdoc sebastian marek testing tutorial torii portal ipc karlsruhe kore talks overview pyramid software architecture software design ext/filter phpt unit test apache software foundation book consulting qafoo toby zeta components logger optimization performance changes company crazy dortmund elephpant fabien potencier fun phpbbq phpug pirum quality static_reflection support thinkpad tools training xml xpath zce zend certified engineer git github sylvester 2007 elger mayflower php_codebrowser thorsten dbus derick tokenizer article cologne php-magazin customerWednesday, December 31. 2008PHP_Depend-0.9.1 releasedJust now I released PHP_Depend 0.9.1, the major feature in this new version is an implementation of the NPath Complexity metric, beside that feature the main focus for this release was on performance improvements of the current implementation.
An additional test concept was introduced with the 0.9.* branch of PHP_Depend. Nightly builds test PHP_Depend against a series of open source projects to detect deadlocks like endless loop or similar issues. This procedure is also used to test each release candidate of PHP_Depend. The tested project are:
You can get the latest PHP_Depend version through its PEAR channel pear.xplib.de or as a subversion checkout of the 0.9.1 tag.
mapi@arwen ~ $ svn co http://svn.pdepend.org/tags/0.9.1
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
10:31
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: npath complexity, php5, php_depend, quality assurance, release announcement
Monday, December 15. 2008PHP_Depend-0.9.0 releasedToday I released version 0.9.0 of PHP_Depend. Beside bugfixes this release contains new features like a PHPUnit compatible xml-log.
mapi@arwen ~ $ pear channel-discover pear.xplib.de mapi@arwen ~ $ pear install xplib/php_depend
or as a subversion checkout of the 0.9.0 branch or tag. mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0 mapi@arwen ~ $ svn co http://svn.pdepend.org/tags/0.9.0 Feel free to report issues, bugs or just leave a comment here.
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
15:04
| Comment (1)
| Trackbacks (0)
Defined tags for this entry: php5, php_depend, quality assurance, release announcement, software metrics
Sunday, July 27. 2008PHP_Depend-0.8.0 releasedToday I released the stable 0.8.0 version of PHP_Depend.
The previous list was taken from the PHP_Depend issue tracker. Feel free to report issues, bugs or just leave a comment here.
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
16:02
| Comments (6)
| Trackbacks (0)
Monday, July 21. 2008New PHP_Depend release 0.8.0beta4This should be the final beta release for PHP_Depend 0.8.0. Beside some minor bugfixes, it contains a last API change for the log sub component. This change removes constraints to the ctor signature of a logger implementation, which is now part of a separate interface. The following list shows all changes in this version. A detailed description of all issues can be found in the PHP_Depend issue tracker!
As always you can use PHP_Depend's pear channel or its svn repository, to check out this new version. And feel free to discuss and follow the PHP_Depend development on its dedicated mailing list.
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, projects
at
20:47
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: design quality, php, php_depend, quality assurance, release announcement, software metrics
Wednesday, June 25. 2008Using the Overview PyramidThe Overview Pyramid is used to visualize a complete software system in a really compact manner. Therefor it collects a set of metrics from the categories Inheritance, Coupling and Size & Complexity, and puts them into relation. The following figure shows the base structure of the Overview Pyramid[ML06]. Metrics used by the Overview PyramidThe following three lists contain all the metrics, which the Overview Pyramid uses. Size and ComplexityThe category Size & Complexity contributes the greatest and mostly used set of software metrics.
CouplingThis group of metrics informs about the coupling between different program parts in the analyzed application.
InheritanceBoth metrics in this group deal with the use of Inheritance and give a general overview of the use of Inheritance within the analyzed system.
Structure of the Overview PyramidNow that we know all metrics used for the Overview Pyramid, it is time to replace the placeholders with the measured informations. The figure below shows the filled Overview Pyramid. In a second step, the previously independent metrics are set into relation. Therefor we calculate the average values of individual value pairs, these computed values provide us with new informations about the distributions within the application. The following example figure of the Overview Pyramid contains a computed value for the measured LOC and NOM metric which shows us, that in the average each operation has 25 lines of code. This value can be described as very high, especially when you consider that most systems contain a variety of simple operation, like Getter and Setter, in addition to the main application logic. To take reasonable conclusions from the computed values one important part is still missing, an adequate set of reference values. Without reference values, that say what values are low, average or high, it is not possible to classify these results. The current version of PHP_Depend supports a single set of reference values, this set was taken from [ML96]. Reference values
With these reference values PHP_Depend can classify the computed results. PHP_Depend uses this information for the generation of colored backgrounds, so that the color already supports the categorization. The benefit of the Overview PyramidOf course, the final question is, which advantages offers the Overview Pyramid? The Overview Pyramid provides a simple and size indipendent way to get a first impression of a software system, and this without an expensive source code analysis. Thus the Overview Pyramid is an effective tool for a first cost estimate for an unknown system. With the help of this tool and know-how, an experienced developer will quickly get a first impression and will know what can be expected from the analyzed application. And this knowledge could be a good help during the planning phase of a new project. Bibliography
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
18:36
| Comments (8)
| Trackbacks (0)
Defined tags for this entry: overview pyramid, php_depend, quality assurance, software design, software metrics
Sunday, June 22. 2008Follow the development process of PHP_DependIf you like commit mails as I do, you can subscribe to the commit mailing list. Simply send an email to commits-join@pdepend.org or register thru the online interface. If you have any PHP_Depend related questions, tips or suggestions, subscribe to the PHP_Depend user mailing list by mail users-join@pdepend.org or use the online interface. Enjoy PHP_Depend! Manuel
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
22:48
| Comments (0)
| Trackback (1)
Wednesday, June 18. 2008PHP_Depend-0.8.0beta1 releasedThis new release of PHP_Depend took some time to be finished. This is because the initial idea of a simple adaption of JDepend evolved (supported thru this blog-post by Sebastian), and so PHP_Depend has become a complete software metric application. Many new features and enhancements have found their way into this version. One of the key features is the pluggable architecture for custom Loggers and Metric-Analyzers. This opens the possibility to hook own Logger- and Analyzer-implementations into the execution chain of PHP_Depend. Beside these architectural changes this PHP_Depend version is shipped with a large set of implemented software metrics. ClassLevel (Class)
CodeRank (Class, Package)An adaption of google's PageRank algorithm for classes and packages.
Coupling (Project)
Cyclomatic Complexity (Project, Method, Function)
Dependency (Package)For details see the following entry.
Hierarchy (Project)
Inheritance (Project)
NodeCount (Project, Package, Class, Interface)
NodeLOC (Project, Package, Class, Interface, Method, Function)
Due to the fact that PHP is a loosely typed programming language, PHP_Depend can only approximate some values. But the measured results can be improved with a good and complete source code documentation, because PHP_Depend takes advantage of different doc comment annotations ( Beside all these metrics, PHP_Depend also provides a new chart type, the "Overview Pyramid". The Overview Pyramid can be a handy tool to analyze legacy code. If you have read the book Object-Oriented Metrics in Practice you should know howto interpret the Overview Pyramid, all others have to wait for a detailed description. ![]() PHP_Depend Overview Pyramid for PHP_Depend This new version can be installed with the PEAR-Installer. Just discover the pear.xplib.de channel and install the latest PHP_Depend release. After PHP_Depend has been installed successfully, the new command line tool pdepend should exist.
mapi@arwen ~ $ pear channel-discover pear.xplib.de
mapi@arwen ~ $ pear install xplib/PHP_Depend-beta
mapi@arwen ~ $ pdepend --help
PHP_Depend 0.8.0beta1 by Manuel Pichler
Usage: pdepend [options] [logger] <dir[,dir[,...]]>
--jdepend-chart=<file> Generates a diagram of the analyzed packages.
--jdepend-xml=<file> Generates the package dependency log.
--overview-pyramid=<file> Generates a chart with an Overview Pyramid for the
analyzed project.
--summary-xml=<file> Generates a xml log with all metrics.
--coderank-mode=<*[,...]> Used CodeRank strategies. Comma separated list of
'inheritance'(default), 'property' and 'method'.
--suffix=<ext[,...]> List of valid PHP file extensions.
--ignore=<dir[,...]> List of exclude directories.
--exclude=<pkg[,...]> List of exclude packages.
--without-annotations Do not parse doc comment annotations.
--help Print this help text.
--version Print the current PHP_Depend version.
There is also a Subversion repository at http://svn.pdepend.org/, where the latest development version can be found. Please test this beta release and file bug-reports and feature-requests in the PHP_Depend bug tracker.
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
16:39
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: php, php_depend, quality assurance, release announcement, software architecture, software metrics
Sunday, March 30. 2008phpUnderControl 0.4.0 releasedA few minutes ago I have released the latest phpUnderControl 0.4.0 version. In addition to many minor fixes and improvements this version comes with three utility commands, that should simplify some common tasks. 1) Project deleteThe project delete command provides a simple way to delete a complete project with all its contents, including logs, artifacts and sources, from your CruiseControl installation. [mapi@arwen~]$ phpuc delete --project-name connectfour /opt/cruisecontrol 2) Project cleanI do not really like this feature, because I really dislike the idea to delete old builds and artifacts, but I must admit that I have mounted a 100 GB partition as artifacts directory. Due to the fact that this feature was requested by many phpUnderControl users, it is implemented in phpUnderControl 0.4.0. This command allows you to delete old logs and artifacts except a configurable number of the latests builds. The following command will remove all build results for the php-under-control except the last 20 builds. [mapi@arwen~]$ phpuc clean --project-name php-under-control \
--keep-builds 20 /opt/cruisecontrol
3) Project createThe project create command provides a cli wizard to set up a new CruiseControl project. The following command will create a new project for the PHPUnit BankAccount sample, checkout the latest svn version, create the required directories and finally prepare the ant build.xml and the CruiseControl config.xml. If you don't like XML or you have multiple projects, that share a common source/project layout, this command could be useful for you. [mapi@arwen~]$ phpuc project --version-control svn \
--version-control-url svn://svn.phpunit.de/.. \
--project-name BankAccount2 \
--source-dir . \
--test-case BankAccountTest \
--test-dir . \
--test-file BankAccountTest.php \
--schedule-interval 20 \
/opt/cruisecontrol
But I would always recommend to use the example build.xml and config.xml to set up a new project. Both files are completely documented and contain links to the original CruiseControl configuration reference. I will do my best to complete the missing documentation for the CruiseControl config.xml file and the new cli commands. Any help is welcome.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
14:37
| Comments (12)
| Trackbacks (0)
Friday, March 14. 2008PHP Unconference 2008Sadly, I could not attend last year's PHP Unconference. As I have heard from all attendees, it was a really great event. But this year I will participate and I am looking forward to the upcoming PHP Unconference in Hamburg where I will meet many geeks the first time. Together with Sebastian, I have proposed a talk about the state of the art of quality assurance in PHP. Due to the nature of an unconference nothing is fixed until the unconference is running, but I assume we have a good chances with our talk, because quality assurance seems to be one of the hottest topics at the moment.
It seems that this year a larger/complete delegation of usergroupies from Dortmund will attend. As tobias said earlier, Stay tuned for the Ruhrpott invasion, Hamburg!
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
20:51
| Comments (0)
| Trackback (1)
Tuesday, February 12. 2008phpUnderControl 0.3.6Except minor enhancements and bugfixes the latest phpUnderControl version comes with two new features.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
11:19
| Comments (6)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, phpunit, quality assurance, software metrics, testing
Wednesday, February 6. 2008How reusable, extensible and maintainable is your software?To provide a flexible and extendable software, it is a good OO practice to reduce the dependencies between implementing classes. This could be achieved by developing against abstractions which means both, abstract classes and interfaces. By using abstractions instead of real implementation in the application you provide some sort of contract, that could be used by others to hook into the application with their own classes that fulfill the contract. Except the extensibility of an application a good abstraction reduces the risk of breaks in multiple subsystems when something was changed in a single package. But how to get rid of all these dependencies, doing this by hand will become an impossible job, at least for larger projects. At this point a tool should be used to assist the development process. PHP_Depend is an adaption of the established Java development tool JDepend. This tool shows you the quality of your design in the terms of extensibility, reusability and maintainability. All these facts are influenced by the inter-package dependencies and the package abstraction that PHP_Depend visualizes in form of an abstract/instability chart and as a detailed XML report of all detected dependencies. PHP_Depend calculates the following metrics by counting classes, interfaces and dependencies.
With these values we can create a chart that visualizes the relationship between the instability (I) on the y-axis and the abstraction (A) on the x-axis. Because in a project not each package can achieve the optimal values of A = 1, I = 0 or A = 0, I = 1, we draw a diagonal between the two corners. This line is called the Main sequence and represents an average between abstraction (A) and instability (I). This means that packages near this line have a good mix between abstraction and instability. You can call these packages balanced. Because it is desirable for packages to be close to the Main sequence we have a fifth metric, the package distance (D) from this ideal.
If you are interested in this subject and PHP_Depend you can check out the latest version, including the unit tests, from the subversion repository or simply install the PHP_Depend PEAR package. But be aware this software is at a very early stage. mapi@arwen $ pear channel-discover pear.xplib.de mapi@arwen $ pear install xplib/PHP_Depend-alpha Now you can run PHP_Depend with the following command. pdepend <source-dir> [<output-dir>]
If you are interested in the code coverage follow this link I will close this post with a cite of Robert Martin:
The following sources were used for this post.
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, planet-php, projects
at
17:52
| Comments (9)
| Trackback (1)
Defined tags for this entry: design quality, php, quality assurance, software architecture, software design, software metrics
Sunday, February 3. 2008New phpUnderControl release 0.3.5Yesterday I have released the latest phpUnderControl 0.3.5 version. In addition to many minor improvements this version brings two new features. A new index page, inspired by the dashboard of the continuous integration tool hudson phpUnderControl dashboard and a custom PhpDocumentor template which has its roots in the eZ Components api documentation. new phpdoc template.
Except these changes phpUnderControl comes with a lot of minor visual changes, mostly done by kore. Anymore I would like to thank tobias for his work on saturday evening, to get the phpunit.de pear channel to work
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
19:41
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, css, dashboard, phpdoc, phpundercontrol, quality assurance
Saturday, January 19. 2008phpUnderControl 0.3.x releasedYesterday I released version 0.3.(0|1|2) of phpUnderControl. Except bugfixes and enhancements the major change in this new version of phpUnderControl is an ezcGraph replacement of the original cewolf metrics view. For the excellent appearance of the generated graphics I would like to thank kore, who supported me actively with his deep knowledge of the ezcGraph component. Beside the better appearance, the new graph implementation has another advantage, it performs much better than the original cewolf implementation, because cewolf generates graphics in real time, while the new ezcGraph solution generates static graphics during the build process. To integrate the graph generator into your build process, you must alter the <publishers /> elements in the config.xml file. Simply add a CruiseControl execute-publisher that calls the phpUnderControl cli tool with the graph command, as shown in the following example. <cruisecontrol> <project name="php-under-control" buildafterfailed="false"> ... <publishers> ... <execute command="/path/to/phpuc(.php|.bat) graph logs/${project.name}"/> </publishers> </project> </cruisecontrol> The phpUnderControl graph command expects at least the project log directory as argument, it is the directory where CruiseControl stores the merged xml log files. In this default mode phpUnderControl will generate the metric charts for each build into logs/<project-name>/<build-timestamp>/graph directories. If you use a different CruiseControl setup where artifacts are not stored in the logs/ directory you can call the graph command with a second argument that specifies the output directory, for example:
[mapi@arwen /opt/cruisecontrol]$ phpuc graph logs/phpUnderControl \
artifacts/phpUnderControl
Finally I say thanks to Sebastian, because he integrates a new css file for the coverage reports into PHPUnit, that produces a harmonious overall picture between phpUnderControl and the coverage-report. This stylesheet is yet another contribution by kore. All phpUnderControl versions are available thru the phpunit.de pear channel, just type: [mapi@arwen ~]$ pear channel-discover pear.phpunit.de [mapi@arwen ~]$ pear install --alldeps phpunit/phpUnderControl-beta
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
19:45
| Comments (11)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, css, ezcomponents, php, phpundercontrol, phpunit, quality assurance, testing
Saturday, October 27. 2007More QA with CruiseControl and PHP_CodeSnifferI am using CruiseControl for some time now, to run all Unit Tests for a project continuous after each commit. Since Sebastian Bergmann started the development of PHPUnit 3.2 he added support for software metrics and PMD to PHPUnit, that give you further informations about the quality of your source code. These two features are really well integrated into CruiseControl, the only thing you need to do is to comment out the following lines in the main.jsp file. <%-- <cruisecontrol:tab name="pmd" label="PMD"> <%@ include file="pmd.jsp" %> </cruisecontrol:tab> --%> The next thing that is important for each project is the coding standard of a project, a company or at least a single person. Java has a nice tool called Checkstyle that checks all your code against a defined set of rules. I knew this tool really well from my diploma thesis, because I used Checkstyle to check the complete code against the Sun coding standards. Checkstyle is also really good integrated into CruiseControl, so that it checks on each build that your code meets the coding standards.
So what can a PHP developer do, to achieve the same support? This question is answered fast! There is a nice PEAR package that does nearly the same job as Checkstyle. The name of this package is PHP_CodeSniffer. This PEAR package provides a variety of pre defined coding standards like PEAR, ZEND etc., a small cli script <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" indent="yes" /> <xsl:template match="/"> <checkstyle> <xsl:apply-templates select="phpcs/*" /> </checkstyle> </xsl:template> <xsl:template match="file"> <file> <xsl:attribute name="name"> <xsl:value-of select="@name" /> </xsl:attribute> <xsl:for-each select="child::*"> <xsl:call-template name="entry" /> </xsl:for-each> </file> </xsl:template> <xsl:template name="entry"> <error> <xsl:attribute name="line"> <xsl:value-of select="@line" /> </xsl:attribute> <xsl:attribute name="severity"> <xsl:value-of select="local-name()" /> </xsl:attribute> <xsl:attribute name="message"> <xsl:value-of select="text()" /> </xsl:attribute> </error> </xsl:template> </xsl:stylesheet>
You have to add the following lines to your ant <?xml version="1.0" encoding="UTF-8"?> <project name="mapi-xplib-de" default="build" basedir="."> ... <target name="checkstyle"> <exec executable="phpcs" output="${basedir}/build/logs/codesniffer.pcs" dir="${basedir}/source"> <arg line="--report=xml --standard=MapiSource --ignore=src/autoload src/" /> </exec> <exec executable="xsltproc" output="${basedir}/build/logs/checkstyle.xml" dir="${basedir}/build/logs"> <arg line="${checkstyle.xslt} ${basedir}/build/logs/codesniffer.pcs" /> </exec> </target> <target name="build" depends="checkout,checkstyle,test" /> ... </project>
PLEASE NOTE I know that ant supports xsl transformation without external exec commands but it doesn't work with my current gcj installation.
Posted by Manuel Pichler
in php, phpugdo
at
19:03
| Comment (1)
| Trackback (1)
Defined tags for this entry: checkstyle, continuous integration, cruisecontrol, php, php_codesniffer, quality assurance
« previous page
(Page 2 of 2, totaling 29 entries)
|
ProjectsFurther stuffCategories |


