Professional Documents
Culture Documents
CI and Tools
CI and Tools
Overview
Continuous Integration
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily leading to multiple integrations per day. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. Agile teams, because they are producing robust code each iteration, typically find that they are slowed down by the long diff-resolution and debugging sessions that often occur at the end of long integration cycles. Continuous Integration (CI) involves producing a clean build of the system several times per day. Agile teams typically configure CI to include automated compilation, unit test execution Code stays robust enough that customers and other stakeholders can play with the code whenever they like - It also encourages more feedback between programmers and customers, which helps the team get things right before iteration deadlines
1&1 Internet AG 2011
Page3
CI Principles
Maintain a code repository Automate the build Make the build self-testing Every commit (to baseline) should be built Test in a clone of the production environment Everyone can see the results of the latest build Automate deployment
Page4
Developers detect and fix integration problems continuously avoiding last-minute chaos at release dates
o o
Early warning of broken/incompatible code / conflicting changes Immediate unit testing of all changes
Frequent code check-in pushes developers to create modular, less complex code
Page5
Seldom do the users of the software say to me, "Wow, I really like the way you integrated the software in the last release."
o Initial setup time required
o Well-developed test-suite required to achieve automated testing advantages
Page6
Hudson / Jenkins
Building/testing software projects continuously Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that
Hudson / Jenkins
Easy to install Lots of configuration options Easy integration of plugins 600 and counting plugins, and you can write your own(s) Cascading and concurrent builds, join option Rest API for Python, XML and JSON Chuck Norris plugin!
Ant
Ant is a Java library and command-line tool and can be used to pilot any type of process which can be described in terms of targets and tasks Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Create your own tasks or download opensouce antlibs
Using the task on a single file, with the .min suffix added to the file extension:
Maven
At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices.
In fact: Maven is a build tool. In many ways it is like the well-known tool ANT, only even more powerful. (it's more like Ant on steroids. ) It is designed to take much of the hard work out of the build process
Maven mvn archetype:generate -DgroupId=blahblah DartifactId=SpringExamples -DarchetypeArtifactId=maven-archetypequickstart Optional mvn eclipse:eclipse In pom.xml:
Maven
Maven
Maven + JS ?
As soon as you stop thinking of your JavaScript code as a bastard step-child, you can apply the same practices that we have in our other worlds (e.g. Java).
This means that maven will try to grab from the configured repositories: /[groupId]/[type]s/[artifactId]-[version].[type] or in the example above: /myGroup/jss/oneOfMyScripts.js maven-war-javascript plugin The maven-war-javascript-plugin offers a war:js / war:js:copy-scripts goal. This manually looks through your dependencies, and copies any JavaScript modules to your web app. If you also need to package the webapp as war, the plugin registers itself with the war module, and whenever it is invoked, it sneaks in and does the copy. More info : http://ajaxian.com/archives/using-maven-to-modularize-javascript-development
Cobertura
Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. Cobertura was initially designed to be run from Ant. First, you had to add a task definition to the build.xml file.
Next, you need a cobertura-instrument task that adds the logging code to the already compiled class files.
Cobertura
Cobertura
Other similar tools: Emma, Clover JSCoverage is a tool that measures code coverage for JavaScript programs.
NUR ZUR INTERNEN VERWENDUNG
Sonar Sonar is an open platform to manage code quality. Sonar has a rich set of features like what you would get with different tools such as Covertura, PMD, FindBugs, Check Styles combined. It covers the 7 axes of code quality:
Sonar
One part of Sonar is a Web front-end for the metrics database, and the other part is a
Maven plugin that runs all code analyzers and pumps the collected data into that
database. Easy to install - much like Hudson / Jenkins Download Modify db connection properties (comes with Derby DB included) Run .bat / .sh mvn clean install sonar:sonar in the project root
Browse to http://localhost:9000
Sonar
What is TDD ?
Fitnesse
FitNesse is a test framework that allows testers, developers and customers to collaborate
to create test cases on a wiki. Teams can take examples of desired software behavior and
turn them into automated tests, integrated with narrative requirements documentation. FitNesse runs its own wiki web server Testing within the FitNesse system involves four components per test: The wiki page which expresses the test as a decision table. A testing engine, which interprets the wiki page. A test fixture, which is invoked by the testing engine and in turn invokes the
Fitnesse
Fitnesse
Fixture
Fitnesse
Selenium
Selenium is a portable software testing framework for Web applications. Selenium IDE - Plugin to Firefox to record and play test in firefox and also export tests in different languages. Selenium RC- Allows playing of exported test in different platform/OS Selenium Grid - Allows to control lots of selenium machines not for now
Selenium RC
Client libraries which provide the interface between each programming language and the Selenium RC Server. To create a test program, you simply write a program that runs a set of Selenium commands using a client library API. Well, there are a lot of libraries and plugins offering various functionalities and different syntax
and with some plugins, it gets transformed into code using Selenium?
Mockito
Questions
How much of these concepts and tools do you use every day?
Which do you think the gain would be if most/all of them were used?
Your questions
Thank you!