130 likes | 325 Views
Maven & Bamboo. CONTINUOUS INTEGRATION. QA in a large organization. In a large organization that manages over 100 applications and over 20 developers, implementing QA can be quite a challenge. In such an organization, how can you: - make sure your test result documentation is up to date?
E N D
Maven & Bamboo CONTINUOUS INTEGRATION
QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing QA can be quite a challenge. In such an organization, how can you: - make sure your test result documentation is up to date? - know which build successfully ran JUnit tests? - keep on top of all code changes? - guarantee the ability of rebuilding all your apps? - reduce the cost of testing? - alleviate the burden of testing and make it useful? - facilitate the use of a common code base? What's a particle tool to address these concerns? Maven & Bamboo
Maven What is Maven? - Java build tool based on ANT Advantages of using Maven - Facilitates build process - Provides a uniform build system - Simplifies dependency management - breaks down the build lifecycle into phases - plugins can be injected in any phase - provides guidelines for development best practices Disadvantages - Small learning curve
Facilitates build process Easy to install: - unzip package to directory - set JAVA_HOME - set MAVEN_HOME You've updated a common component. The command "mvn deploy" will - download dependencies - compile your code - runs tests against IUT - package compiled code with production resources into a distributable format, such as a JAR - run integration tests - install package into local repository - deploy package into remote repository, ready for others to use
Provides a uniform build system - Build process is external to IDEs - Guarantees that everyone can build it - What about IDE debug mode? - IDE plugins exists for many platforms to allow this - Build configuration is specified in pom.xml file - version information - classpath settings - dependencies - plugin data
Simplifies dependency management - All dependencies are specified in the pom - Artefact repositories - Local - Remote - No more JAR hunting on the web - No more unknown versions of JARs in prod releases - Versions of common JARs can be specified in parent pom <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.5</version> </dependency>
Build Lifecycles - Made up of Phases. Some of the common ones are: * validate - validate the project is correct and all necessary information is available * compile - compile the source code of the project * test - test the compiled source code using a suitable unit testing framework. * package - take the compiled code and package it in its distributable format, such as a JAR. * integration-test - process and deploy the package if necessary into an environment where integration tests can be run * 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. - There are ways to circumvent * mvn intall -DskipTests=true
Guidelines for development best practices - Standard Directory Structure - Separation of tests from code - Parent pom - Re-usable code templates: Creating Archetypes
Surefire Reports mvn surefire-report:report • JUnit reports plugin
Bamboo • Continuous Integration Server • Automates compilation and testing • Integrates with CVS repository • See build history for every product versions • Combined with Clover • See how much of your build is actually being tested • Compare statement, method and conditional branch coverage • Compare total lines-of-code to just non-comment lines-of-code • Track number of files, methods, classes and packages in each build
Sources • http://maven.apache.org/ • http://maven.apache.org/plugins/maven-surefire-report-plugin/ • http://www.atlassian.com/software/bamboo/