Lecture 3 Agility Principles
Lecture 3 Agility Principles
Yielding …
First, you se le ct the a rticle that you want from a displayed list. You
then have to tell the system how you will pay for it - this c an either
be through a subscription, thr ough a company acc ount or by c redit
ca rd.
Afte r this, you ge t a copyright form from the syste m to fill in and,
when you have submitted this, the artic le you wa nt is downloaded
onto your computer.
You then choose a printer and a copy of the artic le is printed. You
te ll the syste m if printing ha s bee n suc cessful.
Input:
Astring representing thecredit card numberand two integers representing
the month and ye ar when the ca rd e xpires
Te sts :
Che ck tha t all bytes in the string a re digits
Che ck tha t the month lies betwe en 1 a nd 12 and the
ye ar is greater than or equal to the current ye ar.
Using the first 4 digits of the cre dit card number ,
check that the ca rd issuer is valid by looking up the
ca rd issuer table . Chec k c redit car d validity by submitting the card
number a nd expiry da te information to the c ard
issue r
Output:
OK or error message indicating tha t the ca rd is invalid
Test-first development
• Writing tests before code clarifies the
requirements to be implemented.
• Tests are written as programs rather than data
so that they can be executed automatically. The
test includes a check that it has executed
correctly.
• All previous and new tests are automatically run
when new functionality is added. Thus checking
that the new functionality has not introduced
errors.
Pair programming
• In XP, programmers work in pairs, sitting together to
develop code.
• This helps develop common ownership of code and
spreads knowledge across the team.
• It serves as an informal review process as each line of
code is looked at by more than 1 person.
• It encourages refactoring as the whole team can benefit
from this.
• Measurements suggest that development productivity
with pair programming is similar to that of two people
working independently.
Problems with XP
• Customer involvement
– This is perhaps the most difficult problem. It may be difficult or
impossible to find a customer who can represent all stakeholders
and who can be taken off their normal work to become part of
the XP team. For generic products, there is no ‘customer’ - the
marketing team may not be typical of real customers.
• Architectural design
– The incremental style of development can mean that
inappropriate architectural decisions are made at an
early stage of the process.
– Problems with these may not become clear until
many features have been implemented and
refactoring the architecture is very expensive.
• Test complacency
– It is easy for a team to believe that because it has
many tests, the system is properly tested.
– Because of the automated testing approach, there is
a tendency to develop tests that are easy to automate
rather than tests that are ‘good’ tests.
Key points
• Extreme programming includes practices such as
systematic testing, continuous improvement and
customer involvement.
• Customers are involved in developing requirements
which are expressed as simple scenarios.
• The approach to testing in XP is a particular strength
where executable tests are developed before the code is
written.
• Key problems with XP include difficulties of getting
representative customers and problems of architectural
design.