adopting agile tools & methods in a legacy context v8.0

Upload: xwarzee

Post on 30-May-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    1/39

    Xavier WarzeeEmail: [email protected]

    Blog: http://warzee.fr

    Site: http://www.agilescale.com

    http://warzee.fr/http://www.agilescale.com/http://www.agilescale.com/http://warzee.fr/
  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    2/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    3/39

    Insurance applicationsTalk based on one year engagement

    In an insurance companyA subsidiary ofone of the largest french bank

    6 insurance applicationsUsed by several networks of regional insurance

    agencies

    Running in a datacenter (Mainframes, Unix servers)

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    4/39

    Legacy systemsApplicationsImplemented inJava/J2EE running on Unix

    servers

    No dependency injection, no cool frameworks(Spring, Hibernate, )

    Various size and maturity

    Business rules and servicesImplemented in Cobol running on IBM

    mainframes

    IBM MQ to communicate with applications

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    5/39

    Tools & practicesBuilding and deployment of J2EE

    applications

    with IBM RAD6 (based on Eclipse 3.0.1)

    Software Configuration Management

    with IBM Rational Clearcase LT 2003 for

    Java/J2EENothing for Cobol developments

    No tests (unit & acceptance tests)

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    6/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    7/39

    Bottom-up Approach

    > pragmatic metrics : RTFsMonitor projects progress with RTFs (Running,Tested Features)Running means here deployed to a Websphere

    server (we have J2EE applications) =>continuous deployment

    Tested means a development is done whentested => automated tests during projectsbuilding

    Features means make the latestdevelopments available at any time =>

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    8/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    9/39

    Adoption strategy/audit> Identify steps to improve the

    developmentNo scripted buildingManual building under RAD6/EclipseCheckout code, check dependencies, package correctly

    EAR/WAR1 to 3 days needed to check an application is correctlypackaged !

    No scripted deployment

    manual deployment with the Websphere consoleError prone, need to know Websphere Application ServerNeed 1 or 2 days to deploy an application under WAS6.1

    No code review to measure quality

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    10/39

    Adoption plan proposed

    (1/3)Use Maven to build applications/projects No longer use an IDE to build apps/projects

    (error prone)

    Better traceability of packaged components

    Develop scripts to deploy applications

    Jython Scripts used both by production anddevelopment teams to deploy to WebsphereAS 6.1 Avoid behavior gaps between dev and prod

    environments Scri ts called from Maven to automate

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    11/39

    Adoption plan proposed

    (2/3)Review projects with Maven to measurecode qualitySimple declarative approach to configure code

    review tools PMD, Checkstyle, FindBugs Maven plugins!

    Integrate code review reporting during nightlybuilds

    Just simply use the Maven build lifecycle

    Implement Builds Management withCruisecontrol

    Continuous integration of changes (build, unit

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    12/39

    Adoption plan proposed

    (3/3)Implement unit tests withJunit, XMLUnit andJMockItCheck code behaves as expected by developers !

    JMockit helps to disconnect J2EE applications from MAINFRAMETo test in isolation without modifying application codes

    (bytecode rewriting)

    Use acceptance tests with Fit/FitNessecheck code behaves as expected by users for each

    releaseUse FitNesse plugin for RAD/Eclipse and for

    MavenPost deployment tests to ensure full testability by

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    13/39

    In a legacy context

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    14/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    15/39

    Manual

    Acceptance

    testingUsing the

    GUI

    UnitTests

    Automated

    tests of

    the GUI

    Simple usual approach

    manual and error-prone traceability with requirements?

    Technical solution Quick to run since automated numerous similar tests to write

    fragile tests (HTML may change) What do we test ? Priorities ? How to identify tests to run ? How to identify failing tests ?

    Start Stop ?Start Stop Look

    Mike Cohn tests pyramidadoption>> current practices!

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    16/39

    Acceptance

    tests with the

    GUI

    FitNesse

    Unit Tests

    Small number of tests Try automate these tests

    Define accurate functional tests

    Unit tests generalized Adopt a TDD approach

    Start Stop ?Start Stop Look

    Mike Cohn tests pyramid adoption> target practices: the pyramid of Mike Cohn

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    17/39

    adoption> pragmatic target practices!

    Unit Tests

    Acceptance

    tests with the

    GUI

    Automated

    acceptance

    tests

    Try to reduce the number of tests

    (if any, use FitNesse + Selenium)

    Use Fit/FitNesse

    reach a high coverage of code improve capacities of test with

    supporting tools (xUnit tools such as

    JMockIt, DbUnit, XMLUnit, JUnitPerf,

    JsUnit, )

    Start Stop Look

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    18/39

    DAOBusiness Service

    Business Component

    Business Component

    Business layer (EAR) Mainframe layer

    Business

    Service

    (Cobol)

    MQ

    DAO

    Business Service

    MQ

    Business Component

    Presentation layer

    (EAR)

    EIARD Application

    Application

    Process

    Service

    Business Process

    Service

    DAS

    HTML/JS/JSP

    Pages

    xml/http mq

    Business

    Service

    (Cobol)

    DAS

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    19/39

    Functional testing with FitNesse> Business layer

    Black box approachWiki to easy functional data injection!

    Dossier component

    Personne component

    Business layer Mainframe layer

    Functional

    Service

    (Cobol)

    MQ

    DAO

    Business

    Service

    Functional

    Service

    (Cobol)

    MQ

    ElementStructure component

    PMGestionCompte

    SUT

    PMColumnFixture

    DAS

    DAO

    Business

    Service

    DAS

    PMListeDossiersSUT

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    20/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    21/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    22/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    23/39

    Selenium is powerful

    Issues to set timeout when MQ access not mocked!(JDBC/DB2)

    CADOMDevisA4

    Dossier component

    Personne component

    Business layer Mainframe layer

    Functional

    Service

    (Cobol)

    MQ

    CAD

    OM

    Functional

    Service

    (Cobol)

    MQ

    ElementStructure component

    Presentation layer

    PUPerteMdp PMGestionCompte

    SAD

    Pages

    HTML/JS/JSP Request

    Other systems

    Selenium RC

    Functional testing with FitNesse> Presentation layer with Selenium

    EIARD application

    SeleniumRunner

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    24/39

    Testing scenarios> Car insurance quote scenarioWrite scenario in natural language with the FitNesse wiki

    Use the SeleniumRunner fixture to translate naturallanguages into Selenium verbs (open, click, select, )The SeleniumRunner fixture invokes a Selenium instanceThe Selenium instance interacts with the application !

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    25/39

    FitNesse Tests & Continuous integration1/3

    1

    3

    Continuous integration server machine

    - Windows Service : Selenium-RC

    - Windows Service : FitNesse Server (port 9987)

    Deployment Platform

    SCM repository

    (Clearcase, SVN, )

    2

    6

    4 5

    1 Check in (restitution)

    2 Projects updated on the continuous

    integration server

    3 Projects built :

    compilation, application and tests resourcesgeneration, unit tests and components tests

    execution, code review,

    4 Projects deployment (when needed : EAR)

    5 Acceptation tests executed using FitNesse

    (and Selenium)6 Notification by email

    FitNesse Tests & Continuous integration

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    26/39

    FitNesse Tests & Continuous integration2/3> Maven command called by CruisecontrolDefinition of a Maven profile:

    fitnesseTo declare and configure Fitnesse

    plugin

    To set FitNesse parameters to useHere for the Dossier project: s00sic001.ca-pacifica.fr

    8081 TestsAcceptation.TestsNm.TestsDossier

    Select a Maven project phaseAfter package: ear applications are deployed to

    Websphere App Server during this phase !!!

    Command to launch FitNesse tests

    (cration du jar)

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    27/39

    FitNesse Tests & Continuous integration 3/3Cruisecontrol builds applications with Maven

    Maven launches FitNesse tests (if present) afterapplication deployment

    Cruisecontrol webapp adapted to collect FitNesse

    results in a new tab ! Adaptation de Cruisecontrol

    Ajout dun onglet Fit (FitNesse est la surcoucheWiki Fit)

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    28/39

    How to define scenarios? (1/3)

    Launch an application with Firefox (here e-IARD)

    Select Tools -> Selenium IDE

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    29/39

    How to define scenarios? (2/3)Complete forms for Car Insurance

    Quote (Simulation AssuranceAutomobile) Events captures by Selenium IDE

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    30/39

    How to define scenarios? (3/3)

    FitNesse

    Page

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    31/39

    Integration ofThe FitNesse report

    FitNesse reports> included in the web site generated byMaven

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    32/39

    Eclipse/RAD plugins> Plugin Eclipse FitNesse (Band XI)

    Boutons daccs aux serveurs Fitnesse En local En remote

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    33/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    34/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    35/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    36/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    37/39

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    38/39

    Incremental releases

    Iterative releases

  • 8/14/2019 Adopting Agile Tools & Methods in a Legacy Context v8.0

    39/39