La Grande Riscrittura - Better Software 2012

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

description

This is the story of three "big rewrites". What are success factors? What are the risks?

Transcript of La Grande Riscrittura - Better Software 2012

Page 1: La Grande Riscrittura - Better Software 2012

La Grande RiscritturaMatteo Vaccari

[email protected]://matteo.vaccari.name/blog

We are going to talk about three “big rewrite” projects

Page 2: La Grande Riscrittura - Better Software 2012

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.

Page 3: La Grande Riscrittura - Better Software 2012

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

Page 4: La Grande Riscrittura - Better Software 2012

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

Page 5: La Grande Riscrittura - Better Software 2012

Grande Riscrittura: perché ti temiamo?

Page 6: La Grande Riscrittura - Better Software 2012
Page 7: La Grande Riscrittura - Better Software 2012

• 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?

Page 8: La Grande Riscrittura - Better Software 2012

Storia di tre progetti

Page 9: La Grande Riscrittura - Better Software 2012

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

Page 10: La Grande Riscrittura - Better Software 2012

Fattori di successo

• Meglio il porting della riscrittura

• Accesso diretto e costante all’impianto

• Collaborazione di esperti interni

• Consegna incrementale

Page 11: La Grande Riscrittura - Better Software 2012

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.

Page 12: La Grande Riscrittura - Better Software 2012

Fattori di insuccesso

• Riscrittura totale

• Accesso negato all’impianto

• Consegna big-bang

Page 13: La Grande Riscrittura - Better Software 2012

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.”

Page 14: La Grande Riscrittura - Better Software 2012

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

Matteo Vaccari
Page 15: La Grande Riscrittura - Better Software 2012

Fattori di successo

• Consegna incrementale

• Accesso diretto e costante alla produzione

• Collaborazione di esperti interni

Page 16: La Grande Riscrittura - Better Software 2012

Collaborazione di esperti interni

• Esperto di dominio a disposizione tutti i giorni

Page 17: La Grande Riscrittura - Better Software 2012

Consegna incrementale

Page 18: La Grande Riscrittura - Better Software 2012

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”.

Page 19: La Grande Riscrittura - Better Software 2012

Qual è il requisito più importante?

Nome: Migrazione-MerchantDescrizione: Il Merchant prosegue la sua operatività con il nuovo sistemaScala: % del transato migratoStatus: [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”.

Page 20: La Grande Riscrittura - Better Software 2012

Censimento MerchantUtenti tipo I - 3 merchant che necessitano della feature AUtenti tipo II - 2 merchant che necessitano delle feature A, BUtenti tipo III - 400 merchant che necessitano delle feature A, B, CUtenti tipo IV - 1600 merchant che necessitano delle feature A, B, C, D

Step-Feature-ADescrizione: Implementare la feature ACriterio di accettazione: Un merchant tipo I migrato con successo

Step-Feature-BDescrizione: Implementare la feature BCriterio di accettazione: Un merchant tipo II migrato con successo

Step-Feature-CDescrizione: Implementare le feature CCriterio 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”.

Page 21: La Grande Riscrittura - Better Software 2012

Consegna incrementale

Database

nuovo

App Nuova

Database

legacy

App Legacy

Batch Sync

Utenti

ApachePerl 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.

Page 22: La Grande Riscrittura - Better Software 2012

Consegna incrementale

Database

nuovo

App Nuova

Database

legacy

App Legacy

Batch Sync

Utenti

ApachePerl 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.

Page 23: La Grande Riscrittura - Better Software 2012

Accesso alla produzione

Page 24: La Grande Riscrittura - Better Software 2012

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.

Page 25: La Grande Riscrittura - Better Software 2012

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.

Page 26: La Grande Riscrittura - Better Software 2012

Fanaticamente ossessionati dalla qualità

XP tradizionale

Page 27: La Grande Riscrittura - Better Software 2012

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

Page 28: La Grande Riscrittura - Better Software 2012

Daily stand-up meeting

Page 29: La Grande Riscrittura - Better Software 2012

Test-driven development

Page 30: La Grande Riscrittura - Better Software 2012

Test di accettazione automatici

@Test public void authorizeTranpipeRequest() throws Exception { String request ="" + "<id>" + TerminalFactory.getTranpipeExplicitCaptureType().getId() + "</id>" + "<password>"+ TerminalFactory.getTranpipeExplicitCaptureType().getPassword() + "</password>" + "<card>" + CCFactory.getVisaOnUsNotEnrolled().getPan() + "</card>" + "<cvv2>" + CCFactory.getVisaOnUsNotEnrolled().getCVV2() + "</cvv2>" + "<expYear>" + CCFactory.getVisaOnUsNotEnrolled().getExpirationYear() + "</expYear>" + "<expMonth>"+ CCFactory.getVisaOnUsNotEnrolled().getExpirationMonth() + "</expMonth>" + "<action>4</action>" + "<type>CC</type>" + "<member>member&member</member>" + "<amt>0.1</amt>" + "<currencycode>978</currencycode>" + "<trackid>2011IVR4189718</trackid>"; String expectedResponse = "" + "<response type=\"valid\">" + "<result>APPROVED</result>" + "<auth>DONTCARE</auth>" + "<ref>DONTCARE</ref>" + "<tranid>DONTCARE</tranid>" + "<trackid>2011IVR4189718</trackid>" + "<udf5>EQUAL2REF</udf5>" + "<responsecode>000</responsecode>" + "</response>"; String actualResponse = sendTranpipeRequest(request); assertXmlResponseEquals(expectedResponse, actualResponse); }

Page 31: La Grande Riscrittura - Better Software 2012

Integrazione continua

Page 32: La Grande Riscrittura - Better Software 2012

Subversion

Sviluppatori

Jenkins Server di collaudo

1. Commit

2. Pull changes3. Build4. Unit test

5. Deploy6. Acceptance tests

7. Success! or Failure!

Page 33: La Grande Riscrittura - Better Software 2012

Training del personale

• Object-Oriented Design

• Test-Driven Development

• Acceptance Testing

Page 34: La Grande Riscrittura - Better Software 2012
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Page 35: La Grande Riscrittura - Better Software 2012

Deployment plan

Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Page 36: La Grande Riscrittura - Better Software 2012

Test plan

Matteo Vaccari
Matteo Vaccari
Page 37: La Grande Riscrittura - Better Software 2012

Organizzazione del lavoro

Page 38: La Grande Riscrittura - Better Software 2012

Organizzazione del lavoro

To do

Page 39: La Grande Riscrittura - Better Software 2012

Organizzazione del lavoro

In progressTo do

Page 40: La Grande Riscrittura - Better Software 2012

Organizzazione del lavoro

Technical review

In progressTo do

Page 41: La Grande Riscrittura - Better Software 2012

Organizzazione del lavoro

Technical review

In progressTo do

Issues

Page 42: La Grande Riscrittura - Better Software 2012

Demo sempre disponibili

Matteo Vaccari
Matteo Vaccari
Page 43: La Grande Riscrittura - Better Software 2012

Automazione$ deploy/deployToEnv.sh Usage: deploy/deployToEnv.sh [stage|production] [latest|<version number>]$ deploy/deployToEnv.sh stage latest...

$ support/installEnvironment.sh...

Page 44: La Grande Riscrittura - Better Software 2012

Simple design

• Stateless architecture

• Tecnologie consolidate

• NO framework

Page 45: La Grande Riscrittura - Better Software 2012

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.

Page 46: La Grande Riscrittura - Better Software 2012