Thursday, June 10. 2010phpUnderControl 0.6.0beta2 releasedToday I have released the second beta version of phpUnderControl. Beside several minor tweaks and bug fixes, this release contains one additional feature I was asked for during the IPC in Berlin. This feature allows you to specify a maximum number of log entries that will be shown in the generated metric charts. This can be very useful once you have a project with a great amount of builds and the chart rendering gets slower and slower.
This feature adds a new option
mapi@arwen ~ $ phpuc --force-update --max-number 42 \
/opt/cruisecontrol/logs/phpUnderControl \
/opt/cruisecontrol/logs/phpUnderControl
You can get the latest release of phpUnderControl through its pear channel: mapi@arwen ~ $ pear upgrade --alldeps phpuc/phpUnderControl-0.6.0beta2 Starting to download phpUnderControl-0.6.0beta2.tgz (546,314 bytes) ................................................................... .............................done: 546,314 bytes or you can get the latest development version on github.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
12:25
| Comments (3)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, release announcement
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)
Thursday, April 29. 2010Goodbye CologneAs many of you may already have noticed, there will be a big change in my career as a professional software engineer and architect this summer. Together with Kore and Toby I am in the process of founding a company. The focus of this company will be on services all around the whole quality life cycle in PHP projects. Under the hood of our company we will also offer support, trainings and consulting for several quality assurance tools, like pdepend, phpmd and phpUnderControl. For you, this opens a great opportunity. You can use the tools and the documentation, as well as participate in the community, as usual. But from now on you can also purchase professional support, if you get stuck or need general assitance. And when you miss a feature or need an individual extension for one of these tools, don't hesitate to contact us. I am really excited what cool things will happen in the next couple of years and I am looking forward to cowork with professionals like Toby and Kore. To finalize the little marketing for the company and its services
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, planet-php
at
13:20
| Comments (3)
| Trackbacks (0)
Defined tags for this entry: changes, company, consulting, php, phpmd, phpundercontrol, php_depend, quality, support, training
Sunday, January 31. 2010phpUnderControl 0.5.1 releasedToday I have released phpUnderControl version 0.5.1. It's a bug fix release that closes several issues open since a long time. First of all I would like to thank Sebastian Marek who was the main contributor to this releases, so a big thankyou to you.
Beside the new release some more things have changed. From now on the phpUnderControl development is hosted on github. This means that from now on the latest version of phpUnderControl can be obtained with the following command:
mapi@arwen ~ $ git clone \
git://github.com/manuelpichler/phpUnderControl.git
Additionally we have moved the phpUnderControl's PEAR Channel Server from pear.phpunit.de to its own server pear.phpundercontrol.org. At this point I would like to thank Sebastian for providing phpUnderControl's infrastructure under the PHPUnit umbrella for the last three years. mapi@arwen ~ $ pear uninstall phpunit/phpUnderControl mapi@arwen ~ $ pear channel-discover pear.phpundercontrol.org mapi@arwen ~ $ pear install --alldeps phpuc/phpUnderControl-beta Starting to download phpUnderControl-0.5.1.tgz (539,717 bytes) ..........................................done: 539,717 bytes install ok: channel://pear.phpundercontrol.org/phpUnderControl-0.5.1
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
21:16
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: ant, bug fix, continuous integration, phpundercontrol, release announcement, sebastian marek
Sunday, December 6. 2009phpUnderControl 0.5.0 releasedAfter quite some time of silence around phpUnderControl I have bundled the 0.5.0 release today. Beside minor changes, bugfixes and enhancements this release contains one new major feature, the PHP_CodeBrowser. The PHP_CodeBrowser is a separate application that collects various XML log files with different project metrics/violations and presents them in a browseable source view with syntax highligting. This tool is a contribution by the Mayflower GmbH, where it was developed and now shared with the Open Source Community. At this point I would like to thank Mayflower as a whole and in particular at Elger and Thorsten, which were responsible for all technical aspects of this contribution. To use the PHP_CodeBrowser you must add an additional execute publisher to your CruiseControl config.xml file that generates the PHP_CodeBrowser html report and an additional artifacts publisher to move the generated PHP_CodeBrowser report into the projects artifacts directory.
<?xml version="1.0" encoding="UTF-8" ?>
<cruisecontrol>
<!-- ... -->
<project name="PHP_Depend" buildafterfailed="false">
<!-- ... -->
<publishers>
<!-- ... -->
<execute command="phpcb
--log projects/${project.name}/build/logs
--source projects/${project.name}/source/PHP
--output projects/${project.name}/build/php-code-browser"/>
<artifactspublisher
dir="projects/${project.name}/build/php-code-browser"
dest="artifacts/${project.name}"
subdirectory="php-code-browser"/>
<!-- ... -->
</publishers>
</project>
</cruisecontrol>
But why do we use a CruiseControl publishers instead of a regular ant (Your build tool here) target? The answer is really simple. The PHP_CodeBrowser must be the very last artifact generated for a project, which means it must also run after PHPUnit, to collect the test result logs. But in most setups PHPUnit is configured with
If you create a new project with phpUnderControl's
mapi@arwen ~ $ phpuc project \
--project-name PHP_Depend \
--source-dir PHP \
--test-case PHP_Depend_AllTests \
--test-dir tests \
--test-file PHP/Depend/AllTests.php \
--version-control svn \
--version-control-url http://svn.pdepend.org/branches/0.9.0 \
/opt/cruisecontrol/cruisecontrol-bin-2.8.2
To get the latest version of phpUnderControl, you can use the PEAR-Channel-Server: mapi@arwen ~ $ pear channel-discover pear.phpunit.de mapi@arwen ~ $ pear install phpunit/phpUnderControl-beta or you can check it out from the subversion repository: mapi@arwen ~ $ svn co svn://phpunit.de/phpunit/phpUnderControl/trunk
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
15:16
| Comments (25)
| Trackbacks (0)
Defined tags for this entry: elger, mayflower, phpundercontrol, php_codebrowser, release announcement, thorsten
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
Wednesday, February 25. 2009phpUnderControl tutorialJust now I found in Felix's blog this excellent phpUnderControl tutorial that comes with useful tips and helping scripts. Because I think it is a really good source to get started with phpUnderControl I will link it here. Sunday, November 30. 2008phpUnderControl 0.4.7 released
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
13:31
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, release announcement
Sunday, November 23. 2008phpUnderControl 0.4.6 released
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
21:14
| Comments (2)
| Trackbacks (0)
Saturday, September 20. 2008Documentation error for "merge-phpunit"
There was a documentation error in the previously presented ant build file for the new
Beside this documentation error, there was a bug in version 0.4.3 related to the same topic, which is fixed now. So please make sure you have the latest version (at least 0.4.4) installed.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
10:51
| Comments (0)
| Trackbacks (0)
Wednesday, September 10. 2008phpUnderControl 0.4.4 bugfix releaseI recently released a bugfix version of phpUnderControl. Beside some minor view errors like the odd/even rows problem, the 0.4.4 release of phpUnderControl fixes a bug in the new merged phpunit logs feature, which doesn't cause CruiseControl to fail for such builds.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
21:10
| Comment (1)
| Trackback (1)
Defined tags for this entry: continuous integration, cruisecontrol, php5, phpundercontrol, phpunit, release announcement
Sunday, September 7. 2008phpUnderControl 0.4.3 releasedI currently released a new version of phpUnderControl. Beside some minor fixes this release comes with a new feature to aggregate test results of multiple PHPUnit runs.
Use the new cli command
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
19:11
| Comment (1)
| Trackback (1)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, phpunit, release announcement
Wednesday, August 20. 2008Things go onEven if there is not much noise around phpUnderControl and PHP_Depend at the moment, the development of both projects still goes on. Due to the fact that there are some personal movements in these days I have modified my priorities and everything evolves slower, but I plan to spend more time on these projects, at least from the last quarter of this year. To put your minds on rest, the next release of phpUnderControl is nearly finished, so stay tuned. Greetings Manuel
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, projects
at
21:26
| Comment (1)
| Trackbacks (0)
Sunday, July 27. 2008Everything looks fine, but it failsYesterday kore asked me about a strange behavior of phpUnderControl. The last arbit build done by phpUnderControl has failed, but when we looked over the different result pages everything looks fine. Strange! What has happened? After an analysis session of the 6MB XML log file I detected the following self explaining entry. The PHPUnit tests for arbit had completely failed. <?xml version="1.0" encoding="UTF-8"?> <cruisecontrol> ... <build error=".../arbit/build.xml:20: exec returned: 255" time="12 minutes 56 seconds"> ... <target name="phpunit" time="1 second"> <task location=".../arbit/build.xml:20: " name="exec" time="1 second"> <message priority="debug"><![CDATA[Current OS is Linux]]></message> <message priority="debug"><![CDATA[Executing 'phpunit' with arguments: '--log-xml' 'build/logs/phpunit.xml' '--log-pmd' 'build/logs/phpunit.pmd.xml' '--log-metrics' 'build/logs/phpunit.metrics.xml' '--coverage-xml' 'build/logs/phpunit.coverage.xml' '--coverage-html' 'build/coverage' 'arbitTestSuite' 'source/tests/suite.php' The ' characters around the executable and arguments are not part of the command.]]></message> <message priority="info"><![CDATA[Fatal error: main(): Failed opening required 'modules_tracker_suite.php' (include_path='.../arbit/source/src/:.../arbit/source/src/libraries/:.:.../php-5.3-cvs/lib/php') in .../arbit/source/tests/suite.php on line 0]]></message> <message priority="info"><![CDATA[Call Stack:]]></message> <message priority="info"><![CDATA[0.0005 318436 1. {main}() .../php-5.3-cvs/bin/phpunit:0]]></message> <message priority="info"><![CDATA[0.2345 542264 2. require('.../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php') .../php-5.3-cvs/bin/phpunit:44]]></message> <message priority="info"><![CDATA[1.0595 5278380 3. PHPUnit_TextUI_Command::main() .../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php:528]]></message> <message priority="info"><![CDATA[1.0616 5294940 4. PHPUnit_Runner_BaseTestRunner->getTest() .../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php:90]]></message> <message priority="info"><![CDATA[1.0617 5295224 5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() .../php-5.3-cvs/lib/php/PHPUnit/Runner/BaseTestRunner.php:200]]></message> <message priority="info"><![CDATA[1.0617 5295508 6. PHPUnit_Runner_StandardTestSuiteLoader->load() .../php-5.3-cvs/lib/php/PHPUnit/Runner/BaseTestRunner.php:269]]></message> <message priority="info"><![CDATA[1.0828 5295792 7. PHPUnit_Util_Fileloader::checkAndLoad() .../php-5.3-cvs/lib/php/PHPUnit/Runner/StandardTestSuiteLoader.php:97]]></message> <message priority="info"><![CDATA[1.1736 5296168 8. PHPUnit_Util_Fileloader::load() .../php-5.3-cvs/lib/php/PHPUnit/Util/Fileloader.php:105]]></message> <message priority="info"><![CDATA[1.1746 5328364 9. include_once('.../arbit/source/tests/suite.php') .../php-5.3-cvs/lib/php/PHPUnit/Util/Fileloader.php:120]]></message> </task> </target> </build> ... </cruisecontrol> Ok, the test run failed, but why did phpUnderControl say: All Tests passed?
The answer is really simple. Due to the fact that phpunit died, it didn't generate any log file and previous log files still reside in
At this moment I realized that I have never mentioned a clean-target for the ant
You should add an additional target to your ant <?xml version="1.0" encoding="UTF-8"?> <project name="phpundercontrol.org" default="build" basedir="."> ... <target name="clean"> <!-- Remove old log files --> <delete> <fileset dir="${basedir}/build/logs" includes="**.*" /> </delete> <!-- Remove old api documentation --> <delete> <fileset dir="${basedir}/build/api" includes="**.*" /> </delete> <!-- Remove old coverage report --> <delete> <fileset dir="${basedir}/build/coverage" includes="**.*" /> </delete> </target> <target name="build" depends="clean,checkout,php-documentor,php-codesniffer,phpunit" /> ... </project> That's it. Now you will get the expected(not really) result: No Tests Run - This project doesn't have any tests.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
15:14
| Comments (0)
| Trackback (1)
Defined tags for this entry: ant, arbit, continuous integration, cruisecontrol, phpundercontrol, phpunit
(Page 1 of 2, totaling 26 entries)
» next page
|
ProjectsFurther stuffCategories |


