La Grande Riscrittura - Better Software 2012

947 views

Published on

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

Published in: Engineering, Technology, Business

La Grande Riscrittura - Better Software 2012

  1. 1. La Grande Riscrittura MatteoVaccari vaccari@pobox.com http://matteo.vaccari.name/blog We are going to talk about three “big rewrite” projects
  2. 2. 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.
  3. 3. The second one happened at a fuel distribution plant. Task: rewrite the control software.
  4. 4. The third one happened at a bank. Task: rewrite the e-commerce payment gateway.
  5. 5. Grande Riscrittura: perché ti temiamo?
  6. 6. • 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?
  7. 7. Storia di tre progetti
  8. 8. This project was a success. We delivered the new system within the expected date and it worked flawlessly.
  9. 9. Fattori di successo • Meglio il porting della riscrittura • Accesso diretto e costante all’impianto • Collaborazione di esperti interni • Consegna incrementale
  10. 10. 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.
  11. 11. Fattori di insuccesso • Riscrittura totale • Accesso negato all’impianto • Consegna big-bang
  12. 12. 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.”
  13. 13. 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
  14. 14. Fattori di successo • Consegna incrementale • Accesso diretto e costante alla produzione • Collaborazione di esperti interni
  15. 15. Collaborazione di esperti interni • Esperto di dominio a disposizione tutti i giorni
  16. 16. Consegna incrementale
  17. 17. 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”.
  18. 18. 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”.
  19. 19. 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”.
  20. 20. 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.
  21. 21. 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.
  22. 22. Accesso alla produzione
  23. 23. 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.
  24. 24. 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.
  25. 25. Fanaticamente ossessionati dalla qualità XP tradizionale
  26. 26. 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
  27. 27. Daily stand-up meeting
  28. 28. Test-driven development
  29. 29. 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); }
  30. 30. Integrazione continua
  31. 31. Subversion Sviluppatori Jenkins Server di collaudo 1. Commit 2. Pull changes3. Build 4. Unit test 5. Deploy 6.Acceptance tests 7. Success! or Failure!
  32. 32. Training del personale • Object-Oriented Design • Test-Driven Development • Acceptance Testing
  33. 33. Deployment plan
  34. 34. Test plan
  35. 35. Organizzazione del lavoro
  36. 36. Organizzazione del lavoro To do
  37. 37. Organizzazione del lavoro In progress To do
  38. 38. Organizzazione del lavoro Technical review In progress To do
  39. 39. Organizzazione del lavoro Technical review In progress To do Issues
  40. 40. Demo sempre disponibili
  41. 41. Automazione $ deploy/deployToEnv.sh Usage: deploy/deployToEnv.sh [stage|production] [latest|<version number>] $ deploy/deployToEnv.sh stage latest ... $ support/installEnvironment.sh ...
  42. 42. Simple design • Stateless architecture • Tecnologie consolidate • NO framework
  43. 43. 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.

×