java development ecosystem
TRANSCRIPT
Java Development EcoSystem
Andrey Khaisin, CiklumJava User Group, June 2011
www.ciklum.net 2
Who am I?
More than 5 years in:
Testing, automated testing
Project quality analyzing
UI, persistence, business logic development
Development for non Ukrainian Banks
And always 20% of all activities are in development ecosystem
www.ciklum.net 3
What is it all about?..
“I can remember when the air was clean …” George Burns, comedian
After some development
www.ciklum.net 4
Problems
Easily configurable build
No JAR hell
Keep it stable
One click deploy
Look to the future
Part 1. Ecosystem components
Jenkins
Maven
Nexus
Code Analyzing Tools
VCS
Sonar
www.ciklum.net 5
www.ciklum.net 6
Development tools
Tool What for
Jenkins (Hudson)
continuous integration server
Maven project build tool. Configuration management tool.
Nexus project libraries repository
Sonar project metrics analyzing tool
VCS any version control system
Code analyzing tools
PMD, Cobertura, FindBugs, Checkstyle and etc.
www.ciklum.net 7
Jenkins (Hudson)
Start build process after source code change or after certain period of time
Distribute build process across a set of build servers
Build result statistic Notification about build results Executing post-build processes (e.g. deploying to
testing server)
Alternatives: Apache Continuum, JetBrains TeamCity, Atlassian Bamboo, CruiseControl, Team Foundation Server, … thousands of them
www.ciklum.net 8
Source version control system
Trigger build process on build server on source
code change
Store all states of application code base
Know who and when made that change which
crash the build
www.ciklum.net 9
Maven
Convention over configuration
Standard project building life circle
Dependency management
Configuration and environment profiles
IDE independent project
Alternatives: Ant + Ivy IDE custom build and dependencies management
www.ciklum.net 10
Nexus
Keep all project dependencies in one place Cache all dependencies from different remote
repositories Manage rules for main source of certain artifact Control security side – no untrusted dependencies
must be used for project build Maven central works under Nexus
Alternatives: Artifactory Apache Archiva
www.ciklum.net 11
Code analyzing tools
Cobertura – test coverage
PMD – static code analyzing
FindBugs – static code analyzing
Checkstyle – check code style rules
www.ciklum.net 12
Sonar
Collecting project analyzing results
Track project metrics changes for a period of time
Visualizing project metrics
Flexible configurable dashboards for users with
different project roles
www.ciklum.net 13
Sonar - project metrics UI
Summarize Analyze Visualize
Sonarize you project!
www.ciklum.net 14
Part 2. Project metrics
Each metric is an answer to:
How many tests?
How big your code?
What is code test coverage?
How nice style of your code?
www.ciklum.net 15
LOC and Test Coverage
week 1 week 2 week 3 week 4 week 5 week 60
50
100
150
kLOC
0
50
100
Coverage
020406080
100
Bugs
www.ciklum.net 16
Radar - Sonar
Open bugs
New bugs rate
LOC
Coverage
Warnings
Performance
0
50
100
Metrics
The rounder shape the better metrics