Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Quality Magento Projects with Confidence

Building Quality Magento Projects with Confidence

In this technical session, we will look at how to you can create a project environment with tools and process to deliver Magento projects of the highest possible quality. We will explore the use of tools from other programming languages and some standard PHP tools customized for use with Magento. Based on recent experience we will identify the roles within a team that can help the team succeed in even the most high pressured and complex parts of a project. Using examples from large successful Magento projects we will look at some of the processes that can help a team deliver complex Magento projects of the highest standards.

Alistair Stead

April 25, 2012
Tweet

More Decks by Alistair Stead

Other Decks in Technology

Transcript

  1. View Slide

  2. Insert photo of speaker here
    891 pixels h x 688 pixels w
    Building Quality
    with Confidence
    and Magento
    Alistair Stead
    Technical Assurance Manager
    sessiondigital.com
    @alistairstead

    View Slide

  3. Session Digital is a UK based Gold Solutions partner focusing on large
    scale deployment and integration of Magento Enterprise solutions.
    Session have delivered technically complex solutions for many high
    profile brands in the UK and Europe:
    Dreams
    Kookai UK & France
    3663
    Warner Music International
    Smythson of Bond Street
    ACNE Studios
    Kurt Geiger
    Interflora

    View Slide

  4. ASSURED
    DELIVERY
    Building Quality
    Magento Projects
    with Confidence

    View Slide

  5. Team Roles,
    Tools &
    Processes

    View Slide

  6. Magento LOC
    Directories: 2851
    Files: 7984
    Lines of Code : 1287442
    Interfaces: 184
    Classes: 7011
    Methods: 41192
    Anonymous Functions: 4
    Functions: 31

    View Slide

  7. Repeatable State!
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State
    Repeatable State

    View Slide

  8. Vagrant + VirtualBox

    View Slide

  9. Chef
    Scripted Infrastructure

    View Slide

  10. 1287442lines
    Don’t forget..

    View Slide

  11. - - -
    +++github

    View Slide

  12. View Slide

  13. feature 1
    feature 2
    develop

    View Slide

  14. Git-Flow / Github-Flow

    View Slide

  15. Definition of Done

    View Slide

  16. I will describe a unit of work
    complete when:
    It meets the ..... requirement.
    It has ..... tests.

    View Slide

  17. Code Reviews

    View Slide

  18. Code Reviews

    View Slide

  19. Release
    Manager

    View Slide

  20. /**
    * submittingForgotPasswordWithValidEmailReturnsSuccess
    * @author Alistair Stead
    * @group password
    * @test
    *
    */
    public function submittingForgotPasswordWithValidEmailReturnsSuccess()
    {
    $this->request->setMethod('POST')
    ->setPost(array('email' => $this->email));
    $this->dispatch('admin/index/forgotpassword/');
    $this->assertQueryCount('li.success-msg', 1);
    $this->assertQueryContentContains('li.success-msg', 'A new password was sent to your email
    address. Please check your email and click Back to Login.');
    // Test that the email contains the correct data
    $emailContent = $this->getResponseEmail()
    ->getBodyHtml()
    ->getContent();
    // Overriding the response body to be able to use the standard content assertions
    $this->response->setBody($emailContent);
    // The email content addresses the fixture user
    $this->assertQueryContentContains('body', "Dear $this->firstName $this->lastName");
    // The fixture users password has been changed
    $this->assertNotQueryContentContains('body', $this->password);
    } // submittingForgotPasswordWithValidEmailReturnsSuccess
    Static

    Analysis

    View Slide

  21. PHPCode_Sniffer

    View Slide

  22. Cyclomatic Complexity

    View Slide

  23. Testing

    View Slide

  24. PHPUnit

    View Slide

  25. Mage-Test

    View Slide

  26. Behavioural Testing

    View Slide

  27. Acceptance
    Criteria (Y/N)

    View Slide

  28. Feature: Homepage
    In order to maximise site performance
    As a website user
    I need the homepage to be cached in the gateway cache
    Scenario: Visit the homepage
    Given I am on "/"
    And I reload the page
    Then the response status code should be 200
    Then the response is a cache hit

    View Slide

  29. Behat / Mink

    View Slide

  30. Web Driver / Sahi

    View Slide

  31. Continuous
    Integration

    View Slide

  32. Jenkins
    Our CI server is called

    View Slide

  33. Ant
    Ant

    View Slide

  34. Application State

    View Slide

  35. Application Content

    View Slide

  36. Application Configuration

    View Slide

  37. Upgrade Hooks
    @magento
    mysql4-data-upgrade-0.7.63-0.7.64
    mysql4-upgrade-0.7.1-0.7.2

    View Slide

  38. Deploy = Capistrano

    View Slide

  39. Magentify

    View Slide

  40. 1 2 3 4
    Dev CI UAT Prod

    View Slide

  41. Zero downtime deployment

    View Slide

  42. Assured Delivery
    Delivering the right features
    first time on time!
    A quick recap...

    View Slide

  43. Complex Projects

    View Slide

  44. Many People

    View Slide

  45. Clear Requirements

    View Slide

  46. Many Tests

    View Slide

  47. Many Deployments

    View Slide

  48. Zero Defects...

    View Slide

  49. Evaluate & Improve

    View Slide

  50. Questions?
    Thank you!
    @alistairstead

    View Slide

  51. http://bit.ly/I0IQGz
    All references and slides

    View Slide

  52. Come Join us...
    http://blog.sessiondigital.com/careers

    View Slide