just java2008 - java meets agile
DESCRIPTION
A survival guide to adopt Agile inside Java teams. Check an introduction to Agile Methodologies, Agile Practices and Tools that can help your team to improve testing techniques.TRANSCRIPT
Java Meets Agile – A survival guideJava Meets Agile – A survival guide to adopt Agile inside Java teams
Daniel Wildt Software Developer / Agile Coach
Giovani SalvadorSoftware Developer / ArchitectSoftware Developer / Agile Coach
[email protected] http://weblogs.java.net/blog/dwildt/
Software Developer / [email protected]
http://weblogs.java.net/blog/giovanisalvador
AgendaAgenda
• Agile IntroAgile Intro• What is Agile?• Agile Manifesto• What is Scrum
• Agile PracticesR f• References
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile2
Agile Intro
What is Agile? Some thoughtsWhat is Agile? Some thoughts...
• A set of MethodologiesA set of Methodologies• A set of principles and values• A new way of thinking about Software
Development and delivery of business value• Pure Discipline
C i ti d f db k• Communication and feedback• +Trust
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile4
Communication may be like this soCommunication may be like this so...
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile5
... look for better ways to findcustomer needs! Adapt!
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile6
Agile ManifestoAgile Manifesto
• Agile Methodologies are based on disciplinesAgile Methodologies are based on disciplines and practices that focus on principles like these (from Agile Manifesto principles):• Satisfy the customer as highest priority, through early and continuous
delivery of valuable software.• Business people and developers working together daily throughout the
projectproject• Measure the progress of a project based on working software, its
primary measure• Self organizing teams, motivated individuals, communication and
simplicity as strong values• Technical excellence is wanted to enhance agility.• Continuous improvement, to tune and adjust teams to become more
effective.
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile7
effective.
Agile ManifestoAgile Manifesto
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile8
So It’s easy Join the team andSo... It s easy. Join the team and...
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile9
work as a team! Teamwork! Trust!... work as a team! Teamwork! Trust!
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile10
Give power to the team! AndGive power to the team! And...
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile11
find ways to improve! Be creative!... find ways to improve! Be creative!
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile12
A way to develop using Agile = SCRUMA way to develop using Agile = SCRUMProduction Delivery
The Scrum Process:
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile13
Business Analysis Planning
Agile Practices
Agile PracticesAgile Practices
• Remember: What is to be Agile?Remember: What is to be Agile?• Focus on business priorities
• You need to add value at each iteration• Open Communication
• You need to receive feedback constantly• You provide feedback constantlyYou provide feedback constantly
• Find problems early in the process• Why do we need to test?
D i i ti t li i t bi it• Drive communication to eliminate ambiguity • Create knowledge• Build Quality in• Every test is a new opportunity for learning and discuss
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile15
• Every test is a new opportunity for learning and discuss business needs and knowledge
Agile PracticesAgile Practices
• From Architecture Perspectivep• Avoid creating generic architectures
• They can solve some of your problems but what about complexity? p y
• Take care with Big Design Up Front.• Don’t make your project a laboratory for new
technologiestechnologies.• Remember you don’t walk on the water.• Get your hands dirty. Prove your architecture with a
P f f C (P C)Proof of Concept (PoC)
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile16
Agile PracticesAgile Practices
• From Architecture Perspectivep• Adherence to standards.
• From both inside the company or the industry• Spend some time with scripts to build yourSpend some time with scripts to build your
environment and automate repetitive work• Some tools help you to deal with that.
• Eg. WebLogic Scripting Toolsg eb og c Sc pt g oo s
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile17
Agile PracticesAgile Practices
• From Architecture PerspectiveFrom Architecture Perspective• Use an Enterprise Service Bus.
System A System CSystem B
System X System ZSystem Y
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile18
Agile PracticesAgile Practices
• From Architecture PerspectiveFrom Architecture Perspective• Use an Enterprise Service Bus.
System A System CSystem B
Enterprise Service Bus
System X System ZSystem Y
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile19
Agile PracticesAgile Practices
• From Developer PerspectiveFrom Developer Perspective• Start coding the most complex tasks from the
highest priority user story.• Unit test to implement the concept of “done”.• Code the business logic or the persistence
fi t? Whi h t d fi t?first? Which one to code first?
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile20
Agile PracticesAgile Practices
• From Developer PerspectiveFrom Developer Perspective• Discussions:
• Peer review: Manual x Automated?• Pair programming x Peer Review?• Use the most appropriate technique for your team
• Estimates? Who, How and Why?Estimates? Who, How and Why?• Focus: Create Knowledge• Who? The whole team!
How? WideBand Delphi / Planning Poker• How? WideBand Delphi / Planning Poker• Why? Remember the focus
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile21
Agile PracticesAgile Practices
• From Developer PerspectiveFrom Developer Perspective• Create tasks in user stories to search for new
technologies• Give the team the bandwidth to try new
technologies. • Use Spike Solutions practice from XP, for instance.p p ,
• But don’t forget the goal of the task/user story.• Estimate the task properly.
• Business Logic in POJOs Don’t place logic in• Business Logic in POJOs. Don t place logic in EJBs or container-dependent objects.
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile22
Agile PracticesAgile Practices
• From Developer Perspectivep p• First make it work, then refactor it
• “Refactoring is a disciplined technique for restructuring an existing body of code altering itsrestructuring an existing body of code, altering its internal structure without changing its external behaviour” – Martin Fowler
• “It it stinks change it”• It it stinks, change it• Refactor when you add a function• Refactor when you fix a bug
R f t d d i• Refactor as you do code review• When to refactor?
• Right after first green bar
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile23
g g
Prove your code with Unit TestsProve your code with Unit Tests
• As you also prove your design with code• Source grow together with source• Refactor without fear. You own the code!
JUnit
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile24
Write effective documentation – Prove acceptance tests
• Easy integration forEasy integration for Business - FIT
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile25
Integrate and isolate with mock objects
• You don’t have it?Mock!Mock!
public class ExampleTest {@Beforepublic void setup() {public void setup() {
mock = createMock(Collaborator.class);classUnderTest = new ClassUnderTest();classUnderTest.addListener(mock);
}}@Testpublic void addDocument() {
mock.documentAdded("New Document");replay(mock);replay(mock);classUnderTest.addDocument("New Document",
new byte[0]);verify(mock);
}
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile26
}}
Drive acceptance criterias with testsDrive acceptance criterias with tests
• Functional TestFunctional TestSelenium IDE
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile27
Ensure your capacity and performanceEnsure your capacity and performance
• Stress TestingStress Testing• JMeter
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile28
Understand your code. Find gaps and improve!
• Netbeans ProfilerNetbeans Profiler
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile29
Are you testing what you need?Are you testing what you need?
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile30
Continuous Integration: integrated / working code 100% of time
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile31
Review your code properly!Review your code properly!
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile32
Find your way on testing. Why? To improve communication withimprove communication withcustomers and team!
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile33
http://www.ambysoft.com/essays/floot.html
ReferencesReferences
• Beck, Kent; Andres, Cynthia. ExtremeBeck, Kent; Andres, Cynthia. Extreme Programming explained: embrace change. 2ª edition.
• Pressman, Roger S. Software Engineering.• Agile Manifesto
http://www agilemanifesto orghttp://www.agilemanifesto.org• Semler, Ricardo. Você está louco.
http://en.wikipedia.org/wiki/Ricardo_Semlerp p g _
• Kniberg, Henrik. Scrum and XP from the trenches.
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile34
http://www.infoq.com/minibooks/scrum-xp-from-the-trenches
ReferencesReferences
• Tinkha, Andy; Kaner, Cem. ExploringTinkha, Andy; Kaner, Cem. Exploring Exploratory Testing. http://www.testingeducation.org/a/explore.pdfS tt A bl b t FLOOT• Scott Ambler essay about FLOOT. http://www.ambysoft.com/essays/floot.html
• Ciclomatic Complexity. p yhttp://www.sei.cmu.edu/str/descriptions/cyclomatic_body.html
• Mark Richards podcast about FDD and Agile ArchitectureArchitecturehttp://agiletoolkit.libsyn.com/index.php?post_id=89891
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile35
LinksLinks
• JUnit – Unit TestingJUnit Unit Testing• http://www.junit.org
• JMeter – Stress Testing• http://jakarta apache org/jmeter/• http://jakarta.apache.org/jmeter/
• Emma – Code Coverage• http://emma.sf.net
• Selenium –Functional testing• http://www.openqa.org/selenium/
• PMD – Code AuditPMD Code Audit• http://pmd.sf.net
• NetBeans Profiler• http://profiler netbeans org/
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile36
• http://profiler.netbeans.org/
LinksLinks
• CheckStyle –Code Audity• http://checkstyle.sf.net
• Easy Mock• http://www.easymock.org/p y g
• FIT• http://fit.c2.com/
• Cruise ControlCruise Control• http://confluence.public.thoughtworks.org/display/CC
• DDSteps• http://www.ddsteps.org/p p g
• Refactoring - Martin Fowler• http://www.refactoring.com/catalog/index.html
JUSTJAVA 2008 – Daniel Wildt & Giovani Salvador – Java Meets Agile37
Questions?
Daniel Wildt Software Developer / Agile Coach
Giovani SalvadorSoftware Developer / ArchitectSoftware Developer / Agile Coach
[email protected] http://weblogs.java.net/blog/dwildt/
Software Developer / [email protected]
http://weblogs.java.net/blog/giovanisalvador