La Grande Riscrittura - Better Software 2012

Post on 19-Aug-2014

362 views 2 download

Tags:

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

La Grande RiscritturaMatteo Vaccari

vaccari@pobox.comhttp://matteo.vaccari.name/blog

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

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.

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

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

Grande Riscrittura: perché ti temiamo?

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

Storia di tre progetti

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

Fattori di successo

• Meglio il porting della riscrittura

• Accesso diretto e costante all’impianto

• Collaborazione di esperti interni

• Consegna incrementale

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.

Fattori di insuccesso

• Riscrittura totale

• Accesso negato all’impianto

• Consegna big-bang

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

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

Fattori di successo

• Consegna incrementale

• Accesso diretto e costante alla produzione

• Collaborazione di esperti interni

Collaborazione di esperti interni

• Esperto di dominio a disposizione tutti i giorni

Consegna incrementale

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

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

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

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.

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.

Accesso alla produzione

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.

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.

Fanaticamente ossessionati dalla qualità

XP tradizionale

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

Daily stand-up meeting

Test-driven development

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); }

Integrazione continua

Subversion

Sviluppatori

Jenkins Server di collaudo

1. Commit

2. Pull changes3. Build4. Unit test

5. Deploy6. Acceptance tests

7. Success! or Failure!

Training del personale

• Object-Oriented Design

• Test-Driven Development

• Acceptance Testing

Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari

Deployment plan

Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari
Matteo Vaccari

Test plan

Matteo Vaccari
Matteo Vaccari

Organizzazione del lavoro

Organizzazione del lavoro

To do

Organizzazione del lavoro

In progressTo do

Organizzazione del lavoro

Technical review

In progressTo do

Organizzazione del lavoro

Technical review

In progressTo do

Issues

Demo sempre disponibili

Matteo Vaccari
Matteo Vaccari

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

$ support/installEnvironment.sh...

Simple design

• Stateless architecture

• Tecnologie consolidate

• NO framework

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.