agiledevelopment

  • Agile Product Ownership in a Nutshell

    This is basically a 1 day product ownership course compressed into 15 minute animated presentation. There's obviously more to product ownership than this, so see this is a high level summary.

    This gives a really great overview of Agile using simple-to-understand language! I like like this video a lot. Enjoy

    Download the complete drawing here:
    https://dl.dropbox.com/u/1018963/Arti...
    Downloadable version of the video here:
    https://dl.dropbox.com/u/1018963/Vide.

  • Agile Testing Poster

    Agile testing is a software testing practice that follows the principles of agile software development. Agile testing is built upon the philosophy that testers need to adapt to rapid deployment cycles and changes in testing patterns. Providing and getting feedback early, fast and regularly is one of the testers main task.

    AgileTestingPoster

    From http://bbv.ch/images/bbv/pdf/downloads/poster/bbv12_poster_agile_testing_1.0_web.pdf

    You can order a print version at http://www.bbv.ch/de/posterbestellung.html

    Find more at http://bbv.ch/de/unternehmen/publikationen.html

  • Atlassian just acquired GreenHopper

    greenhoppertaskboard

    Atlassian just acquired GreenHopper, a popular JIRA plugin with over 800 customers.

    GreenHopper is a JIRA plug-in that adds a broad collection of agile project management capabilities to JIRA, and extends JIRA as a powerful platform for agile development teams. GreenHopper simplifies the planning and organization of tasks, workflows and reporting for agile teams.

    It introduce in JIRA

    • Card management:  Visualise issues, tasks and user stories as graphical "cards", color-coded and dynamically editable.

    • Planning Board: Quickly create, assemble, sort and prioritize project tasks with drag-and-drop simplicity.

    • Task Board: Track progress through simple, graphical views of remaining tasks across projects and teams.

    • Chart Board: Customizable dashboard, dynamic burn down and burn up charts.

    Learn all about GreenHopper at www.atlassian.com/greenhopper. Unfortunately it is not a free extension… ($700 to $1150 to add to JIRA)

  • Avoid infamous change - restart - wait - check development lifecycle!

    Stop waiting for build & deploy make code changes. Write code and refresh your browser!

    Use DCEVM and add java fields, methods, classes and use them without restarting your application server, it's a modification of the HotSpot VM that allows unlimited class redefinition at run-time. You can add/remove fields and methods and change the super types of a class at run-time. The features of DCEVM are likely to be integrated in a future update of Java 8 as part of JEP 159.

    View code changes instantly and increases team velocity!

              DCEVM                  JVM Hot Swap         
    Changes to method bodies  yes yes
    Adding/removing Methods  yes  no
    Adding/removing constructors  yes  no
    Adding/removing fields  yes  no
    Adding/removing classes  yes  no
    Adding/removing annotations  yes  no
    Changing static field value  yes  no
    Adding/removing enum values  yes  no
    Modifying interfaces  yes  no
    Replacing superclass  yes  no
    Adding/removing implemented interfaces  no  no
    Initializes new instance fields  yes  no

     

  • Better readability of source code

    I just activated the mambots Geshi (standard in Mambo 4.5.2 ) on my Homepage, now all code in my pages (between <pre> and </pre> ) will be automaticaly highlighted and colored. More than 38 languages are now supported on my homepage!

    actionscript - ada - apache - asm - asp - bash - c - c_mac - caddcl - cadlisp - cpp - csharp - css - delphi - html4strict - java - javascript - lisp - lua - mpasm - nsis - objc - oobas - oracle8 - pascal - perl - php-brief - php - python - qbasic - smarty - sql - vb - vbnet - visualfoxpro - xml

    I will post later post an update for Mambo 4.5.2, instead of Geshi 1.0.4 You will soon be able to use Geshi 1.0.7 and an extended Mambot for Your personal use.

    Enjoy ;-)

    private long startStatistics() {
    		long before = System.currentTimeMillis();
    		if (logger.isDebugEnabled()) {
    			logger.debug("Start conversion " );
    		}
    		return before;
    	}
    
    
  • Checkstyle

    Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard.
    It automates the process of checking Java code to spare humans of this boring (but important) task. This
    makes it ideal for projects that want to enforce a coding standard. Checkstyle is highly configurable and can
    be made to support almost any coding standard. An example configuration file is supplied supporting the
    Sun Code Conventions. As well, other sample configuration files are supplied for other well known conventions.

    From http://checkstyle.sourceforge.net/

    Some facts about checkstyle:

    Languages

     
    Java 71%
     
    XML 26%
     
    Other  
      XSL Transformation 2%
      CSS 1%
      HTML <1%
      Emacs Lisp <1%
      MetaFont <1%

    Project Cost

    This calculator estimates how much it would cost to hire a team to write this project from scratch.
    Include
    Codebase 68,028 LOC
    Effort (est.) 16 Person Years
    Avg. Salary $/year
    $897,876
  • Code generation from XSD with JAXB and Maven

    apache_maven

    What you will learn in this small post

    • How to create JAXB proxies at build time using maven-jaxb2-plugin in a continuous build environment (TeamCity / Bamboo)
    • How to generate from an XSD file (XML-Schema-Definitions) Java code.

    Requirements

    • We will use JAXB2 (see JSR 222 and JAXB 2.x).
    • We use Maven 2.2.1, the latest available version

    Settings things up

    The only difficulties is to add to your Maven proxy (Archiva, artifactory) the Maven repository of Sun. The example below use an inline repositories definition in pom.xml. So it work out of the box.

    <repositories>
        <repository>
          <id>maven2-repository.dev.java.net</id>
          <name>Java.net Maven 2 Repository</name>
          <url>http://download.java.net/maven/2</url>
        </repository>
      </repositories>

    and the special Sun Maven plugin repository

      <pluginRepositories>
        <pluginRepository>
          <id>maven2-repository.dev.java.net</id>
          <url>http://download.java.net/maven/2</url>
        </pluginRepository>
      </pluginRepositories>

    Here is how your pom should look like

    <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.waltercedric.maven.examples</groupId>
      <artifactId>jaxb</artifactId>
      <version>0.1.0-SNAPSHOT</version>
      <packaging>jar</packaging>
      <name>jaxb</name>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.7.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
          <version>2.1.12</version>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.7</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <repositories>
        <repository>
          <id>maven2-repository.dev.java.net</id>
          <name>Java.net Maven 2 Repository</name>
          <url>http://download.java.net/maven/2</url>
        </repository>
      </repositories>  
    <pluginRepositories> <pluginRepository> <id>maven2-repository.dev.java.net</id> <name>Java.net Maven 2 Repository</name> <url>http://download.java.net/maven/2</url> </pluginRepository> </pluginRepositories>
    </
    project>

    All you have to do now is to place your XSD shema in src/main/resources and run mvn package

    The JAXB proxies will be created in target\generated-sources\xjc\generated so you can use them in src/main/java and src/test/java

  • Continuous build server for Joomla!

    continuous.server.toolbox.for.php Starting from now on, in order to

    • Increase quality of my components and other (JoomlaComment :-))
    • Reduce time between releases,
    • Avoid subtle or recurrent issues

    I will set up a continuous integration  build server at 

    http://continuousbuildserver.waltercedric.com

    Continuous integration describes a set of software engineering practices that speed up the delivery of software by decreasing integration times.

    • Maintain a code repository, the code will stay at JoomlaCode.org subversion
    • Automate the build, with Maven for PHP/Ant and either teamcity or phpundercontrol.org
    • Make my build self-testing with PHP Unit and Selenium IDE
    • Everyone commits every day,
    • Every commit (to mainline) will be built with the help of triggers,
    • The build will be fast,
    • Test are done in production environment, by deploying code to  old and new version of Joomla! 1.0 and 1.5 "not web accessible" (for obvious security reasons),
    • It will be easy to get the latest deliverables by visiting http://continuousbuildserver.waltercedric.com
    • Everyone will see the results of the latest build by visiting http://continuousbuildserver.waltercedric.com
    • Deliverables will be automatically deployed.

    In short (for all non developer), this program will

    • Monitor any changes of code
    • Trigger a build,
    • Deploy the build to different versions of Joomla! 1.5 (5 versions should be enough)
    • Run a set of tests against these Joomla! versions and
    • Make the result available to all of you.

    Soon as there is enough test cases, it will be safe to download any new release from there.

  • Deploy to Tomcat 6 using Maven

    apache_maven

     cargo-banner-left
    A ready to use example on how you can deploy your web application to a Tomcat 6 container using Maven Cargo. Cargo is a thin wrapper that allows you to manipulate Java EE containers in a standard way. 

    Cargo provides the following Tools and APIs:

    • A Java API to start/stop/configure Java Containers and deploy modules into them.
    • A Java API to parse/create/merge Java EE Modules
    • Ant tasks, Maven 1, Maven 2 plugins.
    • Intellij IDEA and Netbeans plugins are in the sandbox.

    First you have to decide if your tomcat server run locally or remotely as this influence the way you’ll configure your pom.xml

    Below is an example of a standard architecture

    |---MyApplication
    |           |- ear       (ear)
    |           |- service (jar)
    |           |- client    (jar)
    |           |- web      (war)
    |           |- integration (jar)

    The most interesting Maven module, which will be the subject of this article, and the next one is describing how to automate the deployment of a war to Tomcat and later on running integration tests using Selenium.

    'Integration testing'  is the activity of software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before system testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing. [WikiPedia]

    Deploying to Tomcat running locally

    Locally mean running on your development machine, at localhost 8080 or on any other port. Maven has the concept of a 'phase' which can be thought of a collection of goals. Hence here we are specifying that during the
    ’pre-integration-test’ phase first deploy the web app to the container specific folder and then start the container. Both 'deployer-deploy' and 'start' are cargo specific goals. The code below is already ready for integration testing!

    <!—Example of Configuration –>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <wait>true</wait>
                    <container>
                        <containerId>tomcat6x</containerId>
                        <type>installed</type>
                        <home>${catalina.home}</home>
                    </container>
                    <configuration>
                        <type>existing</type> 
                        <home>${catalina.home}</home>
                    <properties>
                            <cargo.tomcat.manager.url>https://yourhost/manager</cargo.tomcat.manager.url>
                            <cargo.remote.username>ManagerAdminLogin</cargo.remote.username>
                            <cargo.remote.password>ManagerAdminPassword</cargo.remote.password>
                        </properties>
                    </configuration>
                    <deployer>
                        <type>installed</type>
                        <deployables>
                            <deployable>
                                <groupId>com.waltercedric</groupId>
                                <artifactId>myapplication-web</artifactId>
                                <type>war</type>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
                <executions>
                    <execution>
                        <id>start-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deployer-deploy</goal>
                            <!--  Only local containers can be started 
                            <goal>start</goal>
                            -->
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-container</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                            <!--  Only local containers can be started 
                            <goal>stop</goal>
                            -->
                        </goals>
                    </execution>
                    <execution>
                        <id>verify-deploy</id>
                        <phase>install</phase>
                        <goals>
                            <goal>deployer-deploy</goal>
                        </goals>
                    </execution> 
                    <execution>
                        <id>clean-undeploy</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                            <!--  Only local containers can be started 
                            <goal>stop</goal>
                            -->
                        </goals>
                    </execution> 
    
                </executions>
            </plugin>
        </plugins>
    </build>

    Deploying to Tomcat running remotely

    The code slightly change:

    • You can NOT start and stop Tomcat running remotely, only deploy and un deploy your web application
    • ‘installed’ is replaced by ‘remote’
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <wait>true</wait>
                    <container>
                        <containerId>tomcat6x</containerId>
                        <type>remote</type>
                    </container>
                    <configuration>
                        <type>remote</type> 
                        <properties>
                            <cargo.tomcat.manager.url>https://yourhost/manager</cargo.tomcat.manager.url>
                            <cargo.remote.username>ManagerAdminLogin</cargo.remote.username>
                            <cargo.remote.password>ManagerAdminPassword</cargo.remote.password>
                        </properties>
                    </configuration>
                    <deployer>
                        <type>installed</type>
                        <deployables>
                            <deployable>
                                <groupId>com.waltercedric</groupId>
                                <artifactId>myapplication-web</artifactId>
                                <type>war</type>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
                <executions>
                    <execution>
                        <id>start-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deployer-deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-container</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify-deploy</id>
                        <phase>install</phase>
                        <goals>
                            <goal>deployer-deploy</goal>
                        </goals>
                    </execution> 
                    <execution>
                        <id>clean-undeploy</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>deployer-undeploy</goal>
                        </goals>
                    </execution> 
                </executions>
            </plugin>
        </plugins>
    </build>

    If you don’t want to let cargo deploy your web application artefact under the default name myapplication-web-0.0.1.SNAPSHOT.war, you can add the following to the deployable section of cargo

    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <configuration>
            <deployer>
                <deployables>
                    <deployable>
                        <properties>
                            <context>mywebapp</context>
                        </properties>
                    </deployable>
                </deployables>
            </deployer>
        </configuration>
    </plugin>

    So you’ll be able to access your web application with http://localhost/mywebapp instead of http://localhost/myapplication-web-0.0.1.SNAPSHOT

    From now on, any phase higher than ’pre-integration-test’ will trigger the deployment to your web application to any tomcat, jboss or weblogic container. As a reminder, here are the major phase of Maven, You can put many of them just separate by a space in run as - goals

    • validate - validate the project is correct and all necessary information is available
    • generate-sources - generate any source code for inclusion in compilation
    • process-sources - process the source code, for example to filter any values
    • generate-resources - generate resources for inclusion in the package
    • process-resources - copy and process the resources into the destination directory, ready for packaging
    • compile - compile the source code of the project
    • process-classes - post-process the generated files from compilation, for example to do byte code enhancement on Java classes
    • generate-test-sources - generate any test source code for inclusion in compilation
    • process-test-sources - process the test source code, for example to filter any values
    • generate-test-resources - create resources for testing
    • process-test-resources - copy and process the resources into the test destination directory
    • test-compile - compile the test source code into the test destination directory
    • test - run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed
    • prepare-package - perform any operations necessary to prepare a package before the actual packaging.
    • package - take the compiled code and package it in its distributable format, such as a JAR
    • pre-integration-test - perform actions required before integration tests are executed. This may involve things such as setting up the required environment
    • integration-test - process and deploy the package if necessary into an environment where integration tests can be run
    • post-integration-test - perform actions required after integration tests have been executed. This may including cleaning up the environment
    • verify - run any checks to verify the package is valid and meets quality criteria
    • install - install the package into the local repository, for use as a dependency in other projects locally
    • deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects

    I recommend you also to use:

    • Maven profiles (triggered by environment, Linux, Windows, DEV, TEST, PROD)
    • Key value pair for sensitive data (login, password)
    • Key value pair for contextual data (URL’s of management console)

    All of these data can be saved in your Maven settings.xml or given by system variables at build time.

  • Enjoy Fighting regressions with git bisect

    As Git Bisect is not clear a lot of people, here is a nice PDF to look at Enjoy Fighting regressions with git bisect, LinuxCon EU 2013.pdf

    it is about "Linux" combinational explosion... Bug software have the following properties (not desired):

    • has many different "configurations"
    • may fail under one configuration but not another

    N configurations, T tests and C new commits means that a release needs:

    C * N * T tests performed

    where N and T, at least, are growing with the size of the software.

    Git Bisect help find a first bad commit and use a binary search algorithm for efficiency if possible.

  • Getting started with test-driven development

    In this article, an excerpt from Test-Driven Development: A J2EE Example (Apress, 2004), author Thomas Hammell helps you select the right tools for getting started with test-driven development (TDD)
    ...
    Following the Keep It Simple, Stupid (KISS) and You Aren't Gonna Need It (YAGNI) rules of extreme programming (XP), each tool listed in the following sections fits into the TDD process...
    more Here
  • git-branch-renamer-maven-plugin

    When working with many feature/release/bugix/hotfix branches, it is a bad idea to start changing the pom version as this will create merge conflicts using pull request. this plugin allow you to keep in ALL branches the same pom version for all your projects, for example MASTER-SNAPSHOT the version will be derived from branch name automagically :-)

    You may want to read more first these 2 short articles

    git-branch-renamer-maven-plugin allow you to keep in ALL branches the same pom version for all your projects: for example MASTER-SNAPSHOT and never change it again.

    the project version will be derived from branch name automatically when running in your continuous integration server.

    branch name feature/xxxx

    • <version>xxxx-SNAPSHOT</version> (default)
    • <version>xxxx</version> (release = true)
    • <version>0-xxxx-SNAPSHOT</version> (forceNumericalVersion = true)
    • <version>feature-xxxx-SNAPSHOT</version> (filterOutBranchQualifier = false)

    The project is hosted at Github https://github.com/cedricwalter/git-branch-renamer-maven-plugin 

  • GitHub project joomla-packager allow rapid application development of Joomla extensions

    joomlaloveRAD

    Rapid application development (RAD) is a software development methodology that uses minimal planning in favor of rapid prototyping. Something that was really slowing me a lot and making any builds or changes in my extensions a real pain to maintain was the packaging of code spread in the joomla tree. I did create numerous custom Phing builds to automate and reduce these pains (Phing is heavily derived from Apache ANT) and  2 months ago  Joomla-packager was born!

    My Joomla-packager is a generic Phing build script to build any Joomla 3rd extension, being a set of components, modules, plugins and or libraries, packages in a simple way.

    Audience

    Developers of 3rd party extensions for Joomla

    Convention over configuration…

    • A single script to rule all your need of Joomla packaging: multi modules/ multi plugins/multi components/multi library is supported,
    • If you respect Joomla conventions, this packager will be able to create a build of any of your extensions or set of extensions,
    • just configure one file (like for example in buildCedThumbnails.xml), mainly listing what your extension is made of and run with minimal efforts,
    • Packaging Joomla extensions will always look look the same = repeatability = convention over configuration

    Usage

    1. Download https://raw.github.com/cedricwalter/joomla-packager/master/joomla-packager.xml locally
    2. Download a copy of buildCedThumbnails.xml You only need to rename and touch this file, it is self documented.
    3. Download a copy of pkg_cedthumbnails.xml You only need to update this file if you alter the structure. (later Joomla-packager will create this file on the fly)
    4. Run the main target build of buildCedThumbnails.xml

    How it is working?

    This script implement ALL standard Joomla conventions to perform the packaging, and offer reusable Phing targets to package any number of extensions. Here is what is implemented:

    Modules

    • 1. Code is located in /modules/mod_${xxxxx} and self contained
    • 2. Languages files are optional but if they exist are located at /language/xx-yy/mod_${xxxxx}.ini /language/xx-yy/mod_${xxxxx}.sys.ini
    • 3. Media files (css,js,images) are optional but if they exist are located at /media/mod_${xxxxx}
    • 4. name of zip files as follow:
      • mod_{yourextension1}.zip

    Plugins

    • 1. Code is located in /plugins/${type}/${xxxxx} and self contained
    • 2. Languages files are optional but if they exist are located at /plugins/${type}/${xxxxx}/language/ or anywhere else in directory at step 1.
    • 3. Media files (css,js,images) are optional but if they exist are located at /media/plg_${type}_${xxxxx}
    • 4. name of zip files as follow:
      • plg_${type}_{yourextension}.zip

    Components

    • 1. Code is located in /administrator/components/${xxxxx} and /components/${xxxxx} and is self contained
    • 2. Languages files are optional but if they exist are located at /administrator/language/xx-yy/${xxxxx}.ini and /language/xx-yy/${xxxxx}.ini and
    • 3. Media files (css,js,images) are optional but if they exist are located at /media/${xxxxx}

    Packages

    • 1. one zip file which contains 1 to n other zip file + a manifest file named pkg_{yourextension}.xml
    • 2. manifest file named pkg_{yourextension}.xml has to be written manually for now and place beside your build{yourextension}.xml
    • 4. name of zip files as follow:
      • com_{yourextension}.zip

    You can browse numerous examples (for Joomla 2.5/3.0/3.1 at the project page (GitHub)

  • Kent Beck

    Kent Beck "I'm not a great programmer; I'm just a good programmer with great habits." 
  • List conflicting dependencies in the Maven reactor

    apache_maven

    The Maven Dependency Plugin among other things include a dependency:analyze-duplicate

    The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.

    This Apache Maven plugin is really feature rich and provide a lot of interesting goals:

  • List of interesting Maven 2 repositories

    apache_maven

    I compiled here a list of the major Apache Maven repositories (read an intro to repositories) for You, You can contact me, or post a comment if you would like to add a missing one to the list.

    And of course mine at http://maven.waltercedric.com

  • Maven and Selenium for integration testing

     apache_maven

    'Integration testing' (sometimes called Integration and Testing, abbreviated I&T) is the activityof software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before system testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing. [WikiPedia]

     

    I will put Selenium to that JOB. Selenium will allow me to run a set of unit test against a running instance of my application and get a feedback on the quality before delivering the software to a testing team.

    Making any Maven module Selenium enable is really easy, all you have to do is to add to the dependencies section the following

    <dependency>
        <groupId>org.openqa.selenium.client-drivers</groupId>
        <artifactId>selenium-java-client-driver</artifactId>
        <version>0.9.2</version>
        <scope>test</scope>
    </dependency>

    Now you should be able to cut and paste any test cases developed with Selenium IDE into /src/test/java/

    Selenium IDE is a Firefox add-on that records clicks, typing, and other actions to make a test, which you can play back in the browser or export to may different languages: Ruby, Python, Java, PHP, Perl, .Net, JavaScript to name a few. [Learn more]

    The java code is in no way different than regular JUNIT test cases, except that it does not use the latest JUNIT 4.x annotations. You’ll be able to run tests like before (right click Run As Junit)

    package com.waltercedric.maven;
    
    import com.thoughtworks.selenium.SeleneseTestCase; 
    
    public class TestHello extends SeleneseTestCase {
    
      public void setUp() throws Exception {
        setUp(http://localhost/helloworld, "*iexplore");
      }
    
      public void testNew() throws Exception {
        selenium.open("/helloworld/index.xhtml");
        selenium.waitForPageToLoad("30000");
    verifyTrue(selenium.isTextPresent("Are you an existing Customer")); } }

    Some explanations are needed:

    •  
      •  
    • http://localhost/helloworld is the URL of my tomcat container where my web applications will be deployed (port 80)
    • I choose internet explorer as browser as it is nearly always available on any windows pc, Firefox is not far away, use “*firefox” and  firefox.exe has to be in the environment PATH.
    • The Code above assume that a selenium RC server is running at localhost on port 4444, I will show you how to start one later in this post.

    Some remarks about the code above

    You will have to somehow make your own Selenium framework out of the generated code, for obvious reasons,

    • You’ll have soon to support many browser "*iexplore", "*firefox", "*opera" and as such use environment variables or configuration files. I recommend you in that case to use Selenium Grid instead of Selenium RC.
    • You can not let the URL and port of the container fix coded http://localhost/helloworld, this URL may change if you target different runtime. 
    • You may want to reuse some part of the generated code multiple times, in different unit test, (like login/logout stuff), java inheritance, interface, and patterns may arrive sooner or later, even if this is unit test code.

    Selenium test cases or integration tests are meant to be run in phase “integration-test” against a running instance of your application. That is why don’t forget to deploy your application with Maven cargo or run it inside Jetty in Maven phase “pre-integration-test”

    How to use Surefire to run JUnit test in phase “test” and integration tests in phase “integration-test”

    The response is by carefully configuring Surefire and naming your Java packages. The pom.xml below show this trick

    In phase test, test cases with a word integration or selenium are omitted, while in phase “integration-test” they are run.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.2</version>
        <configuration>
            <argLine> -Xmx512m -DuseSystemClassLoader=true</argLine>
            <skip>false</skip>
            <testFailureIgnore>true</testFailureIgnore>
            <excludes>
                <exclude>**/integration/*</exclude>
                <exclude>**/selenium/*</exclude>
            </excludes>
        </configuration>
        <executions>
            <execution>
                <id>integration-tests</id>
                <phase>integration-test</phase>
                <goals>
                    <goal>test</goal>
                </goals>
                <configuration>
                    <skip>false</skip>
                    <excludes>
                        <exclude>none</exclude>
                    </excludes>
                    <includes>
                        <include>**/integration/*</include>
                        <include>**/selenium/*</include>
                    </includes>
                </configuration>
            </execution>
        </executions>
    </plugin>

    Now it is time to start a selenium server locally or remotely so we can start our newly defined test cases.

    Selenium Remote control

    Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.

     

    You can either start a selenium RC server

    • Outside Eclipse, like any java process,
    • Inside Eclipse with a java launcher,
    • Inside Eclipse with Maven and a java launcher.
    • Inside any Maven Phase thank to a plugin XXXXXXXXXXXXX

    I recommend you to install Selenium RC in a dedicated VM (VMWare, Virtual desktop, XEN) and to make it team or enterprise wide. I would always recommend to put Linux at work for such a task, unfortunately Internet Explorer is not running at all on Mac nor Linux.. I recommend you this way to run a shared Selenium server in your infrastructure that can be later access by many continuous build agents.

    Selenium RC is a Java process requiring only 2 jar to properly start, Download and unpack to c:\selenium-server-1.0-beta-2

     

     

     

    Create following in a batch file start.bat, normally all you have to do is to change the first 3 lines

    set JAVA_HOME=c:\jdk1.6
    set FIREFOX_HOME=C:\tools\Firefox3
    set SELENIUM_RC_HOME=c:/selenium-server-1.0-beta-2
    
    set PATH=%PATH%;%FIREFOX_HOME%
    set CLASSPATH=%CLASSPATH%;%SELENIUM_RC_HOME%/selenium-server.jar;%SELENIUM_RC_HOME%/selenium-server-coreless.jar 
    %JAVA_HOME%/bin/java -jar %SELENIUM_RC_HOME%/selenium-server.jar

    If everything run properly, you should see an ugly DOS windows like the one below

     starting.selenium.rc.outside.eclipse

    Pointing the browser to http://localhost:4444 will return an error 403, which is no sign of malfunction, currently Selenium RC has no web GUI.

    seleniumRCtestInBrowser

     

    Start Selenium RC server inside Eclipse

    If you decide to run selenium RC inside Eclipse, you’ll be mainly benefit from:

    • Project sharing and versioning in CVS/SVN,
    • Command line parameters that will start Selenium RC can also be shared,

    Selenium Server in a Maven project/module

    Create a new Maven Project named “SeleniumServer” and copy into its pom.xml the following

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.waltercedric.maven</groupId>
        <artifactId>SeleniumServer</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium.server</groupId>
                <artifactId>selenium-server-coreless</artifactId>
                <version>1.0-beta-2</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium.core</groupId>
                <artifactId>selenium-core</artifactId>
                <version>1.0-beta-2</version>
            </dependency>
        </dependencies>
    </project>

    Create a Java launcher and use org.openqa.selenium.server.SeleniumServer as main class. If you start the launcher, you will see the following in eclipse console

    seleniumRC.started.in.eclipse

     

    Selenium RC is now waiting on port 4444 for Selenium Test case orders.

    You can now run your test case in eclipse like any other test case using Eclipse build in Junit runner.

  • Maven dependencies graph plugin in TeamCity and Eclipse

    apache_maven

    How to add dependencies graph to multi module projects. With this Maven plugin, you’ll be able to visualize Maven modules interdependencies and dependencies in any scope (compile, text, provided, system, runtime)

    depgraph:depgraph Can be used to draw a dependency graph from the project, the mojo is executed in. It traverses all dependencies and creates a graph using Graphviz. It draws a dependency graph just for your project. For a simple POM with no sub modules, it draws a graph of all dependencies (including transitive ones) below it. For a POM with sub modules, goes into each leaf POM and generates a separate graph for it.

     

    Here is an example of output on the plugin itself

    depgraph

     

    Install in all TeamCity Agent Graphwiz

    Graphviz is an open source graph visualization software. It has several main graph layout programs. See the gallery for some sample layouts. It also has web and interactive graphical interfaces, and auxiliary tools, libraries, and language bindings.

    Chance is that you are using Linux, so install is very easy and just a few click away for OpenSuse

    # zypper in graphwiz   

    or for Debian

    # apt-get install graphwiz

    In windows use the binary installer and put the graphwiz/bin in your PATH environment variable!

    Configure your POM

    Ideally put this in your parent pom inside the <build> </build> tag

    <plugin>
            <groupId>ch.elca.el4j.maven.plugins</groupId>
            <artifactId>maven-depgraph-plugin</artifactId>
            <version>1.7</version>
    </plugin>

    More configuration settings can be found HERE, now add either a new plugin repository location in your pom.xml (see below) or better in your artifactory proxy

      <pluginRepository>
        <id>elca-services</id>
        <url>http://el4.elca-services.ch/el4j/maven2repository</url>
        <releases>
         <enabled>true</enabled>
        </releases>
      </pluginRepository>

     

    Configure Teamcity build

    Add in the Maven runner of every TeamCity Build

    addDependenciesGraphGoalsInBuild

     

    Maven goals

    • depgraph:depgraph  Can be used to draw a dependency graph from the project, the mojo is executed in. It traverses all dependencies and creates a graph using Graphviz. It draws a dependency graph just for your project. For a simple POM with no submodules, it draws a graph of all dependencies (including transitive ones) below it. For a POM with submodules, goes into each leaf POM and generates a separate graph for it.
    • depgraph:fullgraph  Can be used to draw a dependency graph from the project, the mojo is executed in. It traverses all dependencies and creates a graph using Graphviz. It draws a graph for all the modules as they are interconnected. Same as depgraph for a simple POM, but for a POM with submodules, generates a combined dependency graph incorporating all modules.

    You may also want to let developer look at modules dependencies graph in TeamCity, so you may want to add to artifact path **/site/images/*.png => dependenciesGraph

    Artifacts are files produced by a build. After finishing a build, TeamCity searches for artifacts in the build's checkout directory according to the specified artifact patterns. Matching files are then uploaded to the server, where they become available for download. More ..

    artifactPath

     

    Configure Eclipse

    Install Graphviz and don’t forget to have it in PATH.

    You can share an eclipse Maven launcher in your parent project, right click on your pom.xml and select run as Maven configuration, specify either depgraph:fullgraph  or depgraph:depgraph   as goals

  • Module-based development with Spring and Maven 2

    apache_maven

    The last year, I was at Jazoon 08, and I forget to tell you how good some of their presentation about Maven were

    Module-based development with Spring and Maven 2

    Modularity belongs to the basic architectural best practices. Splitting your application in separate modules can reduce undesired coupling as well as lead to high cohesion, reduce complexity, simplify team development, and decrease execution size by using only the required modules. This talks presents how we combine existing technologies (Spring and Maven 2) to get a seamless module support for the development, test and runtime of Java applications. Maven is concerned with build time aspects, Spring is concerned with run time aspects and there are some shared aspects that concern both. A developer can thus define in his module what the module shall do during development, test and runtime. This leads to better separation of concerns as each module can focus on its aspects and is less bothered by aspects of other modules. We argue that to realize the full potential, only combining plain Maven 2 and Spring is not sufficient and discuss what to add. The module support is implemented and freely available in the open source EL4J project (http://EL4J.sf.net). Read More Here

  • Principles behind the Agile Manifesto

    PrinciplesBehindTheAgileManifesto

    We follow these principles:

    Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

    Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage.

    Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.

    Business people and developers must work together daily throughout the project.

    Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.

    The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.

    Working software is the primary measure of progress.

    Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.

    Continuous attention to technical excellence and good design enhances agility.

    Simplicity--the art of maximizing the amount of work not done--is essential.

    The best architectures, requirements, and designs emerge from self-organizing teams.

    At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

     

    PrinciplesBehindTheAgileManifestoFunny

  • QUALITY DRIVEN DEVELOPMENT POSTER

    AgileRequirementEngineeringPoster

    From http://bbv.ch/images/bbv/pdf/downloads/poster/bbv11_poster_agile_re.pdf

    You can order a print version at http://www.bbv.ch/de/posterbestellung.html

    Find more at http://bbv.ch/de/unternehmen/publikationen.html

  • Sara Bareilles Stageit (Full Concert)

    51 minutes of pure joy! Thanks you Sara Bareilles!!! Listening to this on my Grado Sr-325 headphones is pure magic!

    On 9/10/12, Sara Bareilles played an online concert hosted by Stageit.com in order to raise money for an organization called Playing For Change http://playingforchange.org . Link to the organization with be posted below. All song rights and credits goes to Sara Bareilles and her respective label.

    • Playing for Change @ 4:34
    • Bright Lights and Cityscapes @ 9:45
    • Love Song @ 16:55
    • Only Shadows @ 24:40
    • Sittin' on the Dock of the Bay @ 31:56
    • King of Anything @ 37:35
    • Gravity @ 45:29