Slide 1

Slide 1 text

La Grande Riscrittura Matteo Vaccari [email protected] http://matteo.vaccari.name/blog We are going to talk about three “big rewrite” projects

Slide 2

Slide 2 text

The first one happened at this metalworking plant. This is one of the largest rolling mills in Europe. The big roller stacks are 4 meters high. Task: port the control software for the cooling part to modern hardware.

Slide 3

Slide 3 text

The second one happened at a fuel distribution plant. Task: rewrite the control software.

Slide 4

Slide 4 text

The third one happened at a bank. Task: rewrite the e-commerce payment gateway.

Slide 5

Slide 5 text

Grande Riscrittura: perché ti temiamo?

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

• Abbiamo capito tutto quello che fa il sistema? • Cosa succede il giorno in cui sostituiamo il sistema vecchio con il nuovo? • Che cosa farà il nuovo sistema meglio di quello vecchio?

Slide 8

Slide 8 text

Storia di tre progetti

Slide 9

Slide 9 text

This project was a success. We delivered the new system within the expected date and it worked flawlessly.

Slide 10

Slide 10 text

Fattori di successo • Meglio il porting della riscrittura • Accesso diretto e costante all’impianto • Collaborazione di esperti interni • Consegna incrementale

Slide 11

Slide 11 text

This one was much less successful. The deliveries were late, there were many problems in production. What’s worse is that later deliveries were increasingly late.

Slide 12

Slide 12 text

Fattori di insuccesso • Riscrittura totale • Accesso negato all’impianto • Consegna big-bang

Slide 13

Slide 13 text

This one was very successful. The customer told us “I expected blood and tears in production as it always happens. But this time production was flawless.”

Slide 14

Slide 14 text

Case study • Gateway di pagamento e-commerce • Rifacimento sistema esistente • Stima 1100 gg • Deadline 39 settimane • Team 8 XPeppers + 2 dev cliente + 1 esperto del cliente + 1 tirocinante

Slide 15

Slide 15 text

Fattori di successo • Consegna incrementale • Accesso diretto e costante alla produzione • Collaborazione di esperti interni

Slide 16

Slide 16 text

Collaborazione di esperti interni • Esperto di dominio a disposizione tutti i giorni

Slide 17

Slide 17 text

Consegna incrementale

Slide 18

Slide 18 text

Qual è il requisito più importante? We wrote a long and detailed list of requirements, but we realized it would have been a very poor way to frame a contract with us, the software house, and the customer, the bank. Much better to go the the main stakeholders and ask what they value. In this particular case, the boss cared about “migrating all existing customers to the new system without causing them any inconvenience”.

Slide 19

Slide 19 text

Qual è il requisito più importante? Nome: Migrazione-Merchant Descrizione: Il Merchant prosegue la sua operatività con il nuovo sistema Scala: % del transato migrato Status: [10/02/2012] ~8% Goal: [31/03/2012] 100% We wrote a long and detailed list of requirements, but we realized it would have been a very poor way to frame a contract with us, the software house, and the customer, the bank. Much better to go the the main stakeholders and ask what they value. In this particular case, the boss cared about “migrating all existing customers to the new system without causing them any inconvenience”.

Slide 20

Slide 20 text

Censimento Merchant Utenti tipo I - 3 merchant che necessitano della feature A Utenti tipo II - 2 merchant che necessitano delle feature A, B Utenti tipo III - 400 merchant che necessitano delle feature A, B, C Utenti tipo IV - 1600 merchant che necessitano delle feature A, B, C, D Step-Feature-A Descrizione: Implementare la feature A Criterio di accettazione: Un merchant tipo I migrato con successo Step-Feature-B Descrizione: Implementare la feature B Criterio di accettazione: Un merchant tipo II migrato con successo Step-Feature-C Descrizione: Implementare le feature C Criterio di accettazione: Un merchant tipo III migrato con successo So we partitioned the customers according to how many functions they required. We tracked the main progress metrics “% of customers migrated to the new system” and “availability of the new system”.

Slide 21

Slide 21 text

Consegna incrementale Database nuovo App Nuova Database legacy App Legacy Batch Sync Utenti Apache Perl filter Utenti migrati Utenti non migrati We migrated the first customer (an important one) at 6 weeks into the project. All other customers kept using the old system. The first migration was frontend-only; the newly migrated customer was still using the legacy backoffice app. This was possible because we kept the legacy DB in sync with the new one.

Slide 22

Slide 22 text

Consegna incrementale Database nuovo App Nuova Database legacy App Legacy Batch Sync Utenti Apache Perl filter Utenti migrati Utenti non migrati • Primo rilascio dopo 6 settimane We migrated the first customer (an important one) at 6 weeks into the project. All other customers kept using the old system. The first migration was frontend-only; the newly migrated customer was still using the legacy backoffice app. This was possible because we kept the legacy DB in sync with the new one.

Slide 23

Slide 23 text

Accesso alla produzione

Slide 24

Slide 24 text

Delivery senza problemi in PRO Il cliente si fida Delivery piccole e frequenti We have a self-reinforcing loop. This cuts both ways: it can be a virtuous circle, or a vicious one. If you mess up in production, the customer will not trust you and will ask you to deliver in larger batches, which will lead to increased likelihood of problems in production.

Slide 25

Slide 25 text

Delivery senza problemi in PRO Il cliente si fida Delivery piccole e frequenti Qualità You can stack chance in your favour by applying a lot of energy to “not messing up in production”. This will set a virtuous circle in motion.

Slide 26

Slide 26 text

Fanaticamente ossessionati dalla qualità XP tradizionale

Slide 27

Slide 27 text

Fanaticamente ossessionati dalla qualità • Automated Acceptance Tests • Test-Driven Development • Pair programming • Integrazione continua • Specifiche su wiki • Training del personale • Technical Reviews • Manual test plans • Automazione spinta • NO Frameworks XP tradizionale

Slide 28

Slide 28 text

Daily stand-up meeting

Slide 29

Slide 29 text

Test-driven development

Slide 30

Slide 30 text

Test di accettazione automatici @Test public void authorizeTranpipeRequest() throws Exception { String request ="" + "" + TerminalFactory.getTranpipeExplicitCaptureType().getId() + "" + ""+ TerminalFactory.getTranpipeExplicitCaptureType().getPassword() + "" + "" + CCFactory.getVisaOnUsNotEnrolled().getPan() + "" + "" + CCFactory.getVisaOnUsNotEnrolled().getCVV2() + "" + "" + CCFactory.getVisaOnUsNotEnrolled().getExpirationYear() + "" + ""+ CCFactory.getVisaOnUsNotEnrolled().getExpirationMonth() + "" + "4" + "CC" + "member&member" + "0.1" + "978" + "2011IVR4189718"; String expectedResponse = "" + "" + "APPROVED" + "DONTCARE" + "DONTCARE" + "DONTCARE" + "2011IVR4189718" + "EQUAL2REF" + "000" + ""; String actualResponse = sendTranpipeRequest(request); assertXmlResponseEquals(expectedResponse, actualResponse); }

Slide 31

Slide 31 text

Integrazione continua

Slide 32

Slide 32 text

Subversion Sviluppatori Jenkins Server di collaudo 1. Commit 2. Pull changes 3. Build 4. Unit test 5. Deploy 6. Acceptance tests 7. Success! or Failure!

Slide 33

Slide 33 text

Training del personale • Object-Oriented Design • Test-Driven Development • Acceptance Testing

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Deployment plan

Slide 36

Slide 36 text

Test plan

Slide 37

Slide 37 text

Organizzazione del lavoro

Slide 38

Slide 38 text

Organizzazione del lavoro To do

Slide 39

Slide 39 text

Organizzazione del lavoro In progress To do

Slide 40

Slide 40 text

Organizzazione del lavoro Technical review In progress To do

Slide 41

Slide 41 text

Organizzazione del lavoro Technical review In progress To do Issues

Slide 42

Slide 42 text

Demo sempre disponibili

Slide 43

Slide 43 text

Automazione $ deploy/deployToEnv.sh Usage: deploy/deployToEnv.sh [stage|production] [latest|] $ deploy/deployToEnv.sh stage latest ... $ support/installEnvironment.sh ...

Slide 44

Slide 44 text

Simple design • Stateless architecture • Tecnologie consolidate • NO framework

Slide 45

Slide 45 text

1988 1999 Grazie! Sono freelance. Chiedimi come posso aiutarti! The two main sources of inspiration: Evo taught me how to frame the project for success by tracking the metrics that really mattered to the customer. XP taught us how to deliver very high quality software.

Slide 46

Slide 46 text

No content