d6a4ed97a0a38eac77cdfe2b9a363bd7.ppt
- Количество слайдов: 45
Vorlesung "Software-Engineering" Prof. Ralf Möller, TUHH, Arbeitsbereich STS z Vorige Vorlesung y. Modellbasiertes Software-Engineering y. Model-Driven Architecture y. Software-Engineering-Werkzeuge: Ant z Heute y. Probleme klassischer Vorgehensmodelle y. Extreme Programming (XP) y. Feature-Driven-Development y. Generalisierung: Agile Software-Entwicklungsmethoden 1
Probleme klassischer Vorgehensmodelle (1) z. Entwicklersicht y. Bürokratie (Dokumentation wichtiger als Ergebnis) y. Starres Rollenschema y. Blick auf das Ganze fehlt x. Fließbandsicht x. Motivation fehlt y. Kundenkontakt fehlt xkeine Nachfragemöglichkeit x. Fehlentwicklung durch Unkenntnis der Anwendung z. Kundensicht (später) 2
e. Xtreme Programming: Ein Vorschlag zur Lösung der Probleme klassicher Vorgehensmodelle Präsentationen von D. Dranidis September 2000 CITY College 3
What is XP? z Who is behind XP? y Kent Beck, Ward Cunningham, Ron Jeffries z How old is XP? y almost 4 years old z Short definition y lightweight process model for OO software development z What’s in the name? y code is in the centre of the process y practices are applied extremely z What is new in XP? y none of the ideas or practices in XP are new y the combination of practices and their extreme application is new 4
Practices z XP is based on the extreme application of 12 practices (guidelines or rules) that support each other: y. Planning game y. Frequent releases y. System metaphor y. Simple design y. Tests y. Refactoring y. Pair programming y. Collective code ownership y. Continuous Integration y. Forty-hour week y. On-site customer y. Coding standards 5
6
Planning Game z Pieces: user stories z Players: customer & developer z Moves: y User story writing x requirements are written by the customer on small index cards x user stories are written in business language x and describe things that the system needs to do x each user story is assigned a business value x Example (payroll system): • An employee making $10 an hour works four hours of overtime on Friday and two on Sunday. She should receive $60 for the Friday and $40 for the Sunday x for a few months projects there may be 50 -100 user stories 7
Planning Game (2) z Moves: y Story estimation x each user story is assigned a cost by the developer x cost is measured on ideal weeks (1 -3 weeks) x a story is split by the customer if it takes longer than 3 weeks to implement y Commitment x customer and developer decide which user stories constitute the next release y Value and Risk first x developer orders the user stories of the next release so that • more valuable or riskier stories are moved earlier in the schedule • a fully working (sketchy) system is completed (in a couple of weeks) 8
Frequent Releases / Tasks z The development process is highly iterative z A release cycle is usually up to 3 months z A release cycle consists of iterations up to 3 weeks z In each iteration the selected user stories are implemented z Each user story is split in programming tasks of 1 -3 days z small and frequent releases provide frequent feedback from the customer 9
System Metaphor z Synonym for system-architecture ? z The system metaphor provides a broad view of the project’s goal z It defines the overall theme to which developers and clients can relate z Common concept of what the system is like z The system is built around one (or more) system metaphor(s) from which classes, methods, variables and basic responsibilities are derived z ''Chrysler is a manufacturing company; we make cars. Using a manufacturing metaphor to define the project was an important first step in getting the team (and management) on a level playing field. The concepts of lines, parts, bins, jobs, and stations are metaphors understood throughout the company. The team had the benefit of a very rich domain model developed by members of the team in the project's first iteration. It gave the members of the project an edge in understanding an extremely complex domain. '' 10
Simple Design z Do the simplest thing that could possibly work y create the best (simple) design you can z You aren’t going to need it y do not spend time implementing potential future functionality (requirements will change) z Put in what you need when you need it z Simple design ensures that there is less y to communicate y to test y to refactor 11
Tests z Tests play the most important and central role in XP z Tests are written before the code is developed y forces concentration on the interface y accelerates development y safety net for coding and refactoring z All tests are automated (test suites, testing framework) z If user stories are considered as the requirements then Tests can be considered as the specification of the system z 2 kinds of test: y Acceptance tests (functional tests) x clients provide test cases for their stories x developers transform these in automatic tests y Unit tests x developers write tests for their classes (before implementing the classes) x All unit tests must run 100% successfully all the time 12
Refactoring z Change it even if it is not broken! z Process of improving code while preserving its function z The aim of refactoring is to y make the design simpler y make the code more understandable y improve the tolerance of code to change z The code should not need any comments y There is no documentation in XP y The code and the user stories are the only documents z Useful names should be used (system metaphor) z Refactoring is continuous design z Remove duplicate code z Tests guarantee that refactoring didn’t break anything that worked! 13
Pair programming z Two programmers sit together in front of a workstation y one enters code y one reviews the code and thinks z “Pair programming is a dialog between two people trying to simultaneously program and understand how to program better”, Kent Beck z Second most important practice after tests z Pairs change continuously (few times in a day) y every programmer knows all the aspects of the system y a programmer can be easily replaced in the middle of the project z Costs 10 -15% more than stand-alone programming z Code is simpler (fewer LOC) with less defects (15%) z Ensures continuous code inspection (SE) 14
Collective code ownership z The code does not belong to any programmer but to the team z Any programmer can (actually should) change any of the code at any time in order to y make it simpler y make it better z Encourages the entire team to work more closely together z Everybody tries to produce a high-quality system y code gets cleaner y system gets better all the time y everybody is familiar with most of the system 15
Continuous integration z Daily integration at least z The whole system is built (integrated) every couple of hours z XP feedback cycle: ydevelop unit test ycode yintegrate yrun all units tests (100%) yrelease z A working tested system is always available 16
40 hour week z “Overtime is defined as time in the office when you don’t want to be there” Ron Jeffries z Programmers should not work more than one week of overtime z If more is needed then something is wrong with the schedule z Keep people happy and balanced z Rested programmers are more likely to refactor effectively, think of valuable tests and handle the strong team interaction 17
On-site customer z User stories are not detailed, so there always questions to ask the customer z The customer must always be available yto resolve ambiguities yset priorities yprovide test cases z Customer is considered part of the team 18
Coding standards z Coding standards make pair progamming and collective code ownership easier z Common name choosing scheme z Common code formatting 19
Listen-Test-Code-Design z Traditional Software Lifecycle: y. Listen - Design - Code - Test z XP lifecycle y. Listen - Test - Code - Design z Listen to customers while gathering requirements z Develop test cases (functional tests and unit tests) z Code the objects z Design (refactor) as more objects are added to the system 20
Requirements z small teams (up to 10 -15 programmers) z common workplace and working hours z all tests must be automated and executed in short time z on-site customer z developer and client must commit 100% to XP practices 21
XP is successful because. . . z XP can handle changing customer requirements, even late in the life cycle z XP stresses customer satisfaction; it delivers ywhat the customer needs ywhen the customer needs it z XP emphasises team work z XP is fun z However, most of XP focuses developer view 22
Probleme klassischer Vorgehensmodelle (2) z. Kundensicht y. Kontraktbasiertheit / mangelnde Flexibilität y. Aufwendige Einarbeitung in komplexes Produkt, das sehr spät zur Verfügung steht y. Dokumentationsleichen 23
Feature-Driven Development z How about delivering frequent, tangible, working results? z Deliver results that are “useful in the eyes of the client” z Use a feature as the smallest divisible task z Attack very small block of client-valued functionality z Group blocks into business-related sets z Focus on delivering results every two weeks z Track and report progress by feature progress 24
Defining features using FDD z A feature is a client-valued function that can be implemented in two weeks z Start with an informal list gathered from: y. Conversations with domain members y. Current documentation z Build a detailed list after developing the overall model 25
Defining features using FDD (cont. ) Building an informal feature list helps to: z Bring domain members together to talk z Increase developer’s understanding of the domain z Fosters creativity and innovation z Encourages exploring several questions: y. What could be done? y. What might be done? y. What could make a real difference? z Leads to the discovery of features that add significant business value 26
Roles within FDD (cont. ) Chief Programmer z FDD requires someone to lead the FDD processes z Should lead by example and mentor others z Should be significantly more productive than other team members z Adding programmers usually slows projects down, but adding an in-parallel chief programmer can accelerate a project 27
Roles within FDD (cont. ) Class Owner z Responsible for design and implementation of a class z Developers gain a sense of “pride of ownership” z Provides local consistency to a class z The norm is one class to one class owner 28
Roles within FDD (cont. ) Feature team z Features are assigned to a chief programmer z The CP identifies class owners z Together the CP and class owners form a temporary feature team z Interactions are primarily between the CP and the class owners z This ensures on-going mentoring and promotes uniformity of design and implementation 29
The five FDD processes Pg. 190, Java Modeling in Color with UML z Develop an overall model z Build a detailed, prioritized features list z Plan by feature z Design by featuren (DBF) z Build by feature (BBF) 30
The five FDD processes (cont. ) Why use a process? z Lightweight process can help a team deliver results z With larger projects, repeatable success is achievable z New staff require shorter ramp-up time z Focus on high-payoff results What to avoid in a process z Process for process’ sake or “process pride” z Process over-specification 31
The five FDD processes (cont. ) Develop an overall model z Domain members and developers work together with chief architect z Domain members present a high-level walkthrough z Everyone works to develop a skeletal model z Small pieces are presented by domain members in more details z Sub-teams create a more detailed model which is merged into the skeletal model producing an overall model 32
The five FDD processes (cont. ) Build a detailed, prioritized features list z The development team identifies features z Features are grouped hierarchically z A priority is assigned to each feature z Each feature is weighted by importance z Smaller teams can tackle specialized feature areas z Domain member participation is welcome but not required 33
The five FDD processes (cont. ) Play by feature z Using the features list project manager, development manager, and chief programmers establish milestones z These milestones mark each design by feature and build by feature iterations 34
The five FDD processes (cont. ) Design by feature z Chief programmer takes a feature iteration back to his group, now a feature team z S/he identifies classes and assigns class owners z The feature team works out a detailed sequence diagram z Class owners prototype classes z Team conducts a design inspection 35
The five FDD processes (cont. ) Build by feature z Using the design by feature artifacts, each class owner implements their class methods z Class owner implements class-level testing z Feature team inspects the code z After classes pass inspection the code is check into the version control system z When all classes are checked in the chief programmer promotes the code to the build process 36
Comparing FDD to XP (cont. ) Metaphor and model z User stories are replaced by domain walkthroughs z Tasks are replaced by features z Development of an overall domain object model z Reduces the amount of refactoring required z Gives more time to adding new features (from the features list) 37
Comparing FDD to XP (cont. ) Collective Ownership or Class Ownership z Collective ownership usually degrades into “nonownership” z Any classes needing updates are members of the feature team z Overly complex code won’t pass a code inspection z Associated class owners work with other class owners which helps spread knowledge of the system 38
Comparing FDD to XP (cont. ) Inspections and Pair Programming z No reason why programmers can’t pair up inside of their feature teams z FDD promotes code inspections over pair programming z Allows fresh eyes to look at the code z Chief programmer will help ensure use of best practices z Change of pace for developers 39
Comparing FDD to XP (cont. ) Testing z Incorporated into build by feature process z No mechanism formal unit testing z Chief programmer left to do what is appropriate z Unit testing can be used depending on technology and resources z Producing completely isolated test may be difficult in a reasonable amount of time 40
Comparing FDD to XP (cont. ) Reporting z Part of the Tracking by Feature process in FDD z Low-overhead highly accurate means of measuring progress z Provides data to create practical progress charts and graphs 41
Generalization: Agile Methods z XP y. The Planning Game, Small Releases, Metaphor, Simple Design, Testing, Refactoring, Pair Programming, Collective Ownership, Continuous Integration, 40 -hour Week, On-site Customer, Coding Standards z FDD z Upcoming approaches y. SCRUM (not covered in detail here) y. DSDM (not covered in detail here) 42
SCRUM What is Scrum? (from controlchaos. com) z Scrum is an iterative, incremental process for developing any product or managing any work. It produces a potentially shippable set of functionality at the end of every iteration. It's attributes are: z Scrum is an agile process to manage and control development work. z Scrum is a wrapper for existing engineering practices. z Scrum is a team-based approach to iteratively, incrementally develop systems and products when requirements are rapidly changing z Scrum is a process that controls the chaos of conflicting interests and needs. z Scrum is a way to improve communications and maximize co-operation. z Scrum is a way to detect and cause the removal of anything that gets in the way of developing and delivering products. z Scrum is a way to maximize productivity. z Scrum is scalable from single projects to entire organizations. Scrum has controlled and organized development and implementation for multiple interrelated products and projects with over a thousand developers and implementers. z Scrum is a way for everyone to feel good about their job, their contributions, and that they have done the very best they possibly could. 43
DSDM (Dynamic System Development Method) 1. 2. 3. 4. 5. 6. 7. 8. 9. Active user involvement is imperative. The team must be empowered to make decisions. The focus is on frequent delivery of products. Fitness for business purpose is the essential criterion for acceptance of deliverables. Iterative and incremental development is necessary to converge on an accurate business solution. All changes during development are reversible. Requirements are baselined at a high level. Testing is integrated throughout the life-cycle. Collaboration and cooperation between all stakeholders is essential. From http: //www. dsdm. org/tour/principles. asp 44
Agile vs. Tayloristic Methods 45
d6a4ed97a0a38eac77cdfe2b9a363bd7.ppt