Entries tagged as software metricsRelated tags arbit ant continuous integration cruisecontrol cyclomatic complexity ipc karlsruhe kore phpundercontrol phpunit talks article php-magazin bug fix cli npath complexity php php5 phpmd php_depend pmd release announcement sebastian marek static code analysis tokenizer cbo coupling between objects quality assurance checkstyle design quality php_codesniffer class interface size cologne phpug conference hamburg phpugdo unconference css customization dashboard ezcomponents java server pages layout lint phpdoc testing tutorial usability overview pyramid software architecture software design apache software foundation consulting qafoo toby zeta components book changes company crazy dortmund elephpant ext/filter fabien potencier fun logger phpbbq phpt pirum quality static_reflection support thinkpad tools training unit test xml xpath zce zend certified engineer optimization performance elger mayflower php_codebrowser thorsten dbus derick annotations rule set git github customerTuesday, March 15. 2011A brief introduction to the Coupling Between Objects metricIn this blog post I will give you a brief introduction into the Coupling Between Objects metric, that is one of the metrics calculated by the static code analysis tool PHP_Depend. The Coupling Between Objects or CBO metric was originally defined by Chidamber & Kemerer in their IEEE paper "A Metrics Suite for Object Oriented Design" [1]. This software metric represents the number of other types a class or interface is coupled to. The CBO metric is calculated for classes and interfaces. It counts the unique number of reference types that occur through method calls, method parameters, return types, thrown exceptions and accessed fields. But there is an exception for types that are either a subtype or supertype of the given class, because these types are not included in the calculated CBO value. Excessive coupled classes prevent reuse of existing components and they are damaging for a modular, encapsulated software design. To improve the modularity of a software the inter coupling between different classes should be kept to a minimum. Beside reusability a high coupling has a second drawback, a class that is coupled to other classes is sensitive to changes in that classes and as a result it becomes more difficult to maintain and gets more error-prone. Additionally it is harder to test a heavly coupled class in isolation and it is harder to understand such a class. Therefore you should keep the number of dependencies at a minimum. ThresholdsBased on their research Sahraoui, Godin and Miceli [2] suggest a maximum CBO value of 14, because higher values have negative impacts on several quality aspects of a class, which includes the maintainability, stability and understandability. See also
Bibliography
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
11:59
| Comment (1)
| Trackbacks (0)
Defined tags for this entry: cbo, coupling between objects, php_depend, quality assurance, software metrics
Monday, February 28. 2011PHP_Depend 0.10.2 releasedWe are proud to announce release 0.10.2 of PHP_Depend. Beside two bug fixes this release implements four new software metrics:
A detailed CHANGELOG can be found on the project's download page and a complete, detailed description of the newly implemented software metrics in PHP_Depend's metric catalog.
Posted by Manuel Pichler
in php, php_depend, planet-php, projects
at
11:25
| Comments (0)
| Trackbacks (0)
Friday, February 25. 2011Brief introduction to the Class Interface Size metricThis blog post will give you a brief introduction into the Class Interface Size metric, as it is calculated by the static code analysis tool PHP_Depend. The Class Interface Size or CIS metric is measure of the public services that a class provides. This metric was orginally defined in the QMOOD model [1] by Bansiya & Davis. The orginal version of the CIS metric was defined as the number of public methods that a class provides. Each of these methods can be seen as a service where surrounding application can send messages to or receive messages from a class. CIS = public(NOM) A newer variant of the CIS metric also includes the public attributes of a class, because theses properties can also be used to transport messages or information between a class and the surrounding application. CIS = public(NOM) + public(VARS) PHP_Depend uses the second variant and counts all public methods and attributes declared in a class to calculate its Class Interface Size metric. This metric is a good indicator for the choosen software design. Several classes with a high CIS value are a sure sign that the design of the analyzed software prefers composition over inheritance to share common functionality between different components. So in most cases a high value is a good a sign, because composition increases the reusability and flexibility. But there are also situations where wrongly used composition of functionality leads to a design that is harder to understand and maintain. Thresholds
It is not easy to define good thresholds for this metric, because those values
heavy depend on the choosen design, e.g. inheritance or composition. But in
generall we can say that is best practice to limit the public interface that
can be used to alter the internal state of an object. Therefore we suggest
Bibliography
Sunday, August 22. 2010Slides of my "Understanding Software Metrics" talk online
Posted by Manuel Pichler
in php
at
10:34
| Comments (2)
| Trackbacks (0)
Defined tags for this entry: conference, cyclomatic complexity, npath complexity, quality assurance, software metrics
Wednesday, May 12. 2010Artikel zum Thema SoftwaremetrikenThis blog post is in German as the mentioned article was published in German.
In der heute erschienenen Ausgabe 4.10 des PHP Magazins ist auch ein Artikel von mir enthalten, und wie sollte es wohl anders sein *Trommelwirbel*, beschäftigt der sich mit dem Thema Softwaremetriken Über Kommentare, Anregungen und Kritik rund um den Artikel würde ich mich sehr freuen. Und sollte euch der Artikel gefallen haben, empfehle ich die Internationale PHP Conference 2010, die vom 30. Mai bis 2. Juni in Berlin stattfindet, an der ich teilnehmen und zwei Vorträge halten werden.
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, projects, staticReflection
at
09:04
| Comments (0)
| Trackbacks (0)
PHP-Magazin Artikel zum Thema SoftwaremetrikenThis blog post is in German as the mentioned article was published in German.
In der heute erschienenen Ausgabe 4.10 des PHP Magazins ist auch ein Artikel von mir enthalten, und wie sollte es wohl anders sein *Trommelwirbel*, beschäftigt der sich mit dem Thema Softwaremetriken Über Kommentare, Anregungen und Kritik rund um den Artikel würde ich mich sehr freuen. Und sollte euch der Artikel gefallen haben, empfehle ich die Internationale PHP Conference 2010, die vom 30. Mai bis 2. Juni in Berlin stattfindet, an der ich teilnehmen und zwei Vorträge halten werden.
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, projects, staticReflection
at
09:04
| Comments (0)
| Trackbacks (0)
Monday, May 10. 2010PHP_Depend 0.9.13 bugfix releaseToday we have released the bugfix version 0.9.13 of PHP_Depend, the tool
to measure several software metrics for your PHP application. This release
fixes two critical bugs. One in the tokenizer implementation, which has
modified valid code under test in such a way, that it has become invalid
PHP code. The second fix is related to PHP_Depends's test code, where a
missing
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/trunk pdepend And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
17:31
| Comments (0)
| Trackbacks (0)
Tuesday, March 2. 2010PHP_Depend-0.9.11 releasedI have just released version 0.9.11 of PHP_Depend. It contains a few bug fixes and improvements for PHP_Depend.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0/ And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
21:08
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: bug fix, php_depend, release announcement, software metrics, static code analysis
Tuesday, February 23. 2010PHP_Depend-0.9.10 releasedI have just released the bug fix version 0.9.10 of PHP_Depend. This release contains several bug fixes and improvements for PHP_Depend.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0/ And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
20:36
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: php, php5, php_depend, quality assurance, release announcement, software metrics, static code analysis
Thursday, February 4. 2010Talk about "Software Metrics" at PHPUG CologneThis friday I will give my software metrics introduction talk at the PHP User Group Cologne. The talk covers several aspects of static code analysis. Starting with classic count and complexity metrics, up to modern metrics, which are used for tracking the dependencies and coupling in a modern OO-systems.
I hope this talk will inspire some of the listerners, how software metrics can be used to improve the quality of their software projects. The talk will take place at:
Looking forward to meet you there. Tuesday, November 17. 2009Softwaremetriken verstehen und nutzenToday Kore and I gave a talk on software metrics at the International PHP Conference 2009 in Karlsruhe. You can download our german slides here. It was a really nice talk and the feedback from the audience and on twitter was really positive. So, if you liked the talk please comment on joind.in later, when our slides are online.
Posted by Manuel Pichler
in php, php_depend, phpugdo
at
14:19
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: arbit, cyclomatic complexity, ipc, karlsruhe, kore, software metrics, talks
Wednesday, September 16. 2009My Slides from the PHP Unconference Hamburg 2009
Ok, it's day three after the famous PHP-Unconference-Hamburg and I still haven't found the time to write a review So lets start with the slides (german) from my talk Softwaremetriken verstehen und nutzen. Tuesday, July 7. 2009The value of complexity metrics - Cyclomatic Complexity (1/2)Software metrics are currently on everyone's lips and a frequently discussed topic. There are many conference talks, blog posts and other presentations that talk about software metrics. But to me it seems as if this subject is a closed book for many developers, so I decided to write this little post about a special category of software metrics, the complexity metrics. Complexity metrics are a theoretical approach to measure the subjective complexity of a software fragment, where the words software fragment stand for a paraphrase for functions, methods, classes and nearly every logical unit that can be found in a software system. The most prevalent procedure to calculate complexity values is static code analysis, where an application parses the raw source code of a project, counts different statements and expressions and packs up the determined results in simple classification numbers. And with this information you already know the main concepts behind most software metrics, classification numbers and counting. As you can see there is no magic behind the scene, the only thing required is a good background knowledge to interpret those values. The Cyclomatic Complexity Number or short CCN is the oldest complexity metrics. The first time this software metric was mentioned was 1976 by Thomas J. McCabe. This metric counts the available decision paths in a software fragment to determine its complexity. Each decision path starts with one of the conditional statements from the following list, so that it is fairly easy to detect them in existing source code.
A look at this list of statements may result in the questions:
Is this list wrong, it doesn't list Each decision path gets the value 1 and the sum of all these values represents the Cyclomatic Complexity of the analyzed software fragment. Note that each function and method also counts with a value of 1 With this knowlegde we can now calculate the complexity of the following example code:
Based on the previous definition the Cyclomatic Complexity
Number of the example code example is 5. But you may have
noticed that this approach does not capture all decision paths
that exist. We haven't catched those paths that came from the
by the boolean expression Now we get a complexity value of 8 when we apply the CCN2 to the previous example, what is a growt of the software's complexity of 60%.
Due to the fact that Cyclomatic Complexity Number was
originally invented for procedural programming languages,
this definition for the Cyclomatic Complexity Number still
misses one element to measure the complexity of an object
oriented software system. With the concept of exceptions a
software gets additional decision paths for each
Now that we know what the Cyclomatic Complexity Number is, what can we do with the measured information? We can find the complexity hotspots in a system, for example the top ten artifacts with the highest complexity, but this is only important during an initial analyses phase to get the big picture of an application. For a continuous inspection this information is not so important. A continuous analyses requires thresholds that help to categories calculated values. During the time four values have emerged as good thresholds for the Cyclomatic Complexity Number of a software system.
You may ask, why should I care about the complexity of a software system, where is the value of benefit in this metric? Mostly the complex parts of an application contain business critical logic. But this complexity has negative impacts on the readability and understandability of source code. Those parts will normally become a maintainence and bug fixing nightmare, because no one knows all the constraints, side effects and what's exactly going on in that part of the software. This situation results in the well known saying "Never touch a running system" which in turn mostly ends in copy&paste programming. The situation can even become more critical when the original author leaves the development team or the company. Finally a small example how to apply the new knowledge about the Cyclomatic Complexity Number, thresholds and the negative impacts of complex software to an existing development process. The following source listing shows a complex method taken from PHP_Depend's source. This method has a Cyclomatic Complexity Number of 16 and I must admit that the original author needed some time to understand what was going on in this method.
The first thing to do is to make sure that the test suite is good enough to ensure that the required refactorings will not change the public behavior of the component or class. When this is donw and we are sure our that api breaks will be detected by the test suitewe can start to extract logic into separate methods. The following example shows the result of the refactoring:
The subjective feeling of readability heavily depends on the complexity of control structures, as we can see by a comparison of the original and the refactored version of the method example. The new version with its Cyclomatic Complexity Number of 5 is much easier to read and understand. This text is the first of two blog posts. The second article will give a short introduction into the NPath Complexity You liked this article and you are interested in this and other quality assurence related topics? - Then you should now order your copy of the Book Quality Assurance in PHP Projects. The book talks about nearly all aspect of quality assurence, with practical tips and expert knowledge contributed by certain PHP professionals.
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, planet-php, projects
at
21:20
| Comments (2)
| Trackbacks (0)
Defined tags for this entry: checkstyle, cyclomatic complexity, design quality, npath complexity, php_depend, quality assurance, software metrics
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)
(Page 1 of 2, totaling 22 entries)
» next page
|
ProjectsFurther stuffCategories |

