Upload
bosnia-agile
View
478
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Introduction to eXtreme Programming (XP) with interactive and practical examples of one of its main practices: Test Driven Development (TDD). In the first part, we will lead you through the practices of XP and make you understand why XP has been revolutionary for the software development. After that, we will provide a more in-depth view of TDD. By sharing the best practices we will give you concrete guidelines on how to apply TDD on your projects. The session is expected to be highly interactive, you are all welcome to bring your own ideas, questions and suggestions.
Citation preview
XP?
eXtreme Programming
Sejo Ćesić[email protected]
be.linkedin.com/in/sejocesic/
Enis Zeherović[email protected]
ba.linkedin.com/in/eniszeherovic
eXtreme Programming
Formulated in 1999 by Kent Beck, Ward Cunningham and Ron Jeffries
AGILE software development methodology
Developed in reaction to high ceremony methodologies (e.g. Rational Unified Process - RUP)
XP Goal
Organize people
to produce
higher-quality software
more productively
XP Activities
Coding
Testing
Listening
Designing
XP Values
Communication
Simplicity (YAGNI)
Feedback
"Optimism is an occupational hazard of programming. Feedback is the treatment.“
Courage
refactor/remove code, be persistent
Respect
XP Practices
1. Pair programming
2. Planning game
3. Test driven development
4. Whole team - customer is in the team
5. Continuous process (integration, refactoring, small releases)
6. Shared understanding (coding, collective ownership, simple design)
7. Sustainable pace
Pair programming
Pair programming
Driver & Navigator metaphor improving:
- Economics
Errors avoided, zero cost to fix them later
- Design quality
Second opinion constantly questioning yours
- Satisfaction - Great confidence in code
- Learning - Constant exchange of knowledge
- Team building - Communication improves exponentially
Resistance to XP
2 programmers cost 2 times more than 1 programmer!
Place full of people never shutting their mouth will drive you insane!
When do I get to surf the web? Or chat online?
Resistance to XP (cont.)
Mistakes of a single person cost much much more!
Once you are working with your pair, you don't hear anyone else anymore.
In fact, smart manager knows:
No noise -> something is wrong!
Planning game
Planning game
Release plan
Iteration plan
Acceptance test
Stand Up Meeting
Pair Negotiation
Unit Test
Pair Programming
Planning game
Burndown and velocity
How much work is getting done on your project?
Burndown keeps track of iteration progres
Calculate velocity on the end of iteration
=(estimated hours - remaining hours) / nr. of
days
PG - Burndown and velocity
Test driven development
… will be presented soon
Whole team
Customer is “on site” and used for:
writing user stories
release and iteration planning
complete programming tasks
functional testing
Alternative: “proxy customer”
Continuous process
Continuous integration
Design improvement, refactorings
Small releases, shippable products, demonstration per iteration
Shared understanding
Coding standard
Collective code ownership
Simple design
System metaphor
Sustainable pace
Frequent code merge
&
always executable
&
test covered high quality code
---> fresh and alert minds
40 hours week
Test driven development
Test driven development
Add a test
Run all tests and see if the new one fails
Write some code
Run tests
Refactor code
Repeat
Test driven development
Test driven development
Apply F.I.R.S.T. properties of unit tests:
Fastmany hundreds or thousands per second
Isolatesfailure reason become obvious
Repeatablerun repeatedly in any order any time
Self-validatingno manual evaluation required
Timelywritten before the code
Test driven development
One assert per test
Descriptive names of tests
Test code is important as production code (maybe more)
Recognize test code as documentation you arealways missing
The quality of a test is how good it points you on the failure in your system if it fails
TDD - practical introduction
Two parts:
Java TDD Kata in Eclipse
User interface TDD testing
TDD Kata
String Calculator:
Set of requirements
Develop one task at a time
Test only positive cases
TDD Kata – String Calculator
Requirements:1. Empty string returns zero
2. String with single digit returns that digit
3. String with 2 digits separated with a ‘,‘ retuns sum of these 2 numbers ()
4. Unknown number of digits separated by ‘,‘ must be possible
5. A new line can be used as a separator
6. Custom delimiter must be supported (//[delimiter]\n[numbers])
User interface TDD testing
New page development in TDD
Tools: Eclipse, Selenium, TestNG
Free tool: testeditor.org
Q&A
THANK YOU