Code Quality on Magento



Similar documents
Expert PHP 5 Tools. Proven enterprise development tools and best practices for designing, coding, testing, and deploying PHP applications.

Hail or Fail: The Right Way. to Override Core. Mark Shust ecommerce Developer Metrics Marketing

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

zen Platform technical white paper

HOW TO CREATE THEME IN MAGENTO 2

Case Study. Data Governance Portal Brainvire Infotech Pvt Ltd Page 1 of 1

DEVELOPMENT PORTFOLIO

Software Development & Education Center PHP 5

Integrating Online Banking and Top-up Card into Payment Gateway

Vincent Gabriel. Summary. Experience. Senior Software Developer at Landmark Network

Database Technologies MySQL, PostgreSQL, SQL Server, Oracle. Development Tools Eclipse, Aptana, NetBeans

Choosing a Content Management System (CMS)

What s really under the hood? How I learned to stop worrying and love Magento

PHPUnit and Drupal 8 No Unit Left Behind. Paul Mitchum

Magento Test Automation Framework User's Guide

Symfony2 and Drupal. Why to talk about Symfony2 framework?

CrownPeak Java Web Hosting. Version 0.20

Continuous Delivery for Alfresco Solutions. Satisfied customers and happy developers with!! Continuous Delivery!

Gabriel Iuga. London, United Kingdom Tel: ; Website:

SFC Featured Categories, Magento Extension Documentation

Learning To Fly: How Angry Birds Reached the Heights of Store Performance

Mastering Continuous Integration with Jenkins

SMZ. SocialMedia. Z olutions

Testing Tools Content (Manual with Selenium) Levels of Testing

Top 10 Oracle SQL Developer Tips and Tricks

MAGENTO TRAINING PROGRAM

Paul Boisvert. Director Product Management, Magento

The SharePoint Maturity Model

To increase scalability, the following features can be integrated:

Perfecto Mobile. All rights reserved.

November 12 th 13 th London: Mastering Continuous Integration with Jenkins

About ZPanel. About the framework. The purpose of this guide. Page 1. Author: Bobby Allen Version: 1.1

Magento Extension Developer s Guide

Developing ASP.NET MVC 4 Web Applications MOC 20486

In addition to their professional experience, students who attend this training should have technical knowledge in the following areas.

Case Study. SaaS Based Multi-Store Market Place Brainvire Infotech Pvt. Ltd Page 1 of 5

Java Software Quality Tools and techniques

Mastering Magento Theme Design

Bubble Code Review for Magento

Content. Development Tools 2(63)

Recommended Session /07/ /08/ /09/2013. Recommended Session 1. 08/07/ /08/ /09/ /07/2013 Recommended Session 1.

IT Architecture Review. ISACA Conference Fall 2003

James Singletary IV :: Front End Web Developer located in Tampa, Florida

Mahesh Babu Bokkisam. Software Expertise

Changes Overview of View Layer in Magento 2

Web Developer Toolkit for IBM Digital Experience

Continuous Integration and Bamboo. Ryan Cutter CSCI Spring Semester

Developing ASP.NET MVC 4 Web Applications

DTWMS Required Software Engineers. 1. Senior Java Programmer (3 Positions) Responsibilities:

Copyright 2013 X.commerce, Inc. All rights reserved

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

Best Practices for Building Mobile Web

Magento 1.3: PHP Developer's Guide

Localizing dynamic websites created from open source content management systems

What s New in IBM Web Experience Factory IBM Corporation

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Open Source Content Management System for content development: a comparative study

TYPO3 6.x Enterprise Web CMS

Manage Your Shop with Policy Based Management & Central Management Server

Six Common Factors to Consider When selecting a CMS

Aspire Systems - Experience in Digital Marketing and Social Media

CI:IRL. By Beth Tucker Long

An Advanced E-commerce Course

NXTware Remote. Advanced Development and Maintenance Environment for OpenVMS and other Strategic Platforms

Programming Fundamentals of Web Applications Course 10958A; 5 Days

Volkov Vyacheslav. Summary. Saransk, , Mordovia, Russian Federation Moscow, Russian Federation +7(925)

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Offerte dell 11 luglio 2014

HTML5, The Future of App Development

Developing Microsoft SharePoint Server 2013 Core Solutions

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

DETAILED BOOT CAMP AGENDA

Automate Your Deployment with Bamboo, Drush and Features DrupalCamp Scotland, 9 th 10 th May 2014

SOFTWARE DEVELOPMENT. Notes for Startup Founders. March 25 th, 2015

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Data Center Automation with YADT

In this Lecture you will Learn: Implementation. Software Implementation Tools. Software Implementation Tools

7 Practical insights for IT Asset Management

Kentico E-commerce Solution for developers

IGW+ Certificate. I d e a l G r o u p i n W e b. International professional web design,

Abdullah Radwan. Target Job. Work Experience (9 Years)

Volkov Vyacheslav. Summary. Saransk, , Mordovia, Russian Federation Moscow, Russian Federation +7(925) , +7(917)

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

SaaS-Based Employee Benefits Enrollment System

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

Transcription:

Code Quality on Magento Motivation General Quality Magento Quality Dr. Nikolai Krambrock Meet Magento Romania, 13.09. code4business Software GmbH Dennewartstr. 25-27 52068 Aachen Germany

Person Dr. Nikolai Krambrock Computer Scientist 4 years Magento experience 28 years of development experience CEO at code4business Software GmbH in Aachen, Germany Focus on Processes, Quality and Code-Reviews in my current work

Agenda Motivation General Code Quality Magento-Specific Code Quality Questions and Answers patpitchaya / shutterstock.com

Are we aware of code quality in Magento?

What is code quality good for? For customers Functionality Usability Security Availability and Reliability For developers Code is easy to read Easy to understand Easy to adapt Easy to extend Good code is easy to use. It leads to reasonable development costs and a late end-of-life.

GENERAL CODE QUALITY code4business Software GmbH Dennewartstr. 25-27 52068 Aachen Germany

Coding Conventions (1) Middle size: classes 100-200 Lines of Code (LoC), methods 3-20 LoC Speaking variable names: very bad: $c = Mage::getModel("..."); bad: $customer = getmodel("..."); good: $customertoadd = getmodel("..."); Speaking methods and class-names: deepclone() better than copy() Avoid dead code and unread variables; static analysis is possible

Coding Conventions (2) Avoid duplicated source code code smell #1 according to Martin Fowler Easy solutions: 5 static methods instead of interface and class hierarchy Double check of indentation > 3 Magic numbers: Where does the 7 come from? Define and follow coding conventions in your team

Tools #1 Use version management like git or svn: Single-Branch if all are in one room; Multi-Branch in case of spread development #1 Use a proper Development environment like Zend Studio, PHP-Storm, Eclipse PDT or Netbeans #2 Debugger like Zend Debugger or Xdebug #2 Automated tests: Black-Box (Selenium) easy vs. White-Box (PHPUnit) Use IDE and version management

MAGENTO-SPECIFIC CODE QUALITY code4business Software GmbH Dennewartstr. 25-27 52068 Aachen Germany

Maintain the ability to Update (1) No core-hacks No hacks of external modules Instead: Rewrites, better observer No changes of language files Instead: Separated translation files Correct use of code pools local: Project-specific modules community: Published/shared modules core: Core lib: External library

Maintain the ability to Update (2) Minimize copies of template files local.xml Use (multiple) fallbacks Don t change other peoples code use proper Magento techniques instead

Encapsulation of Modules Modules independent of other modules: Limited dependency shown in the modules Modules independent of templates: Layout-updates (base/default) instead of adaption of template files Template independent of modules: One module that covers additional functions of the template Be able to switch off every module and template individually

Minimal Changes Minimal amount of Line of Code (LoC) for a function only no code is good code Use existing functions Example: Implement free products with price rules http://github.com/code4business/freeproduct/ Example: Generate additional custom options to have tier prices for custom options http:///tier-prices-formagento-custom-options-en/ Write least possible code

Model View Controller (MVC) Separation of code and template No (SQL-)code in the template! No HTML in the code! Try to implement MVC Data based functions (e.g. fullname) in models Logic in controllers and observers Help functions for the template in blocks Observer are models by convention Separate code and html

Setup Scripts Setup scripts instead of direct updates through backend Tables and columns of the database Attributes Configuration Content (CMS, categories, products, ) More reliable deployment Use setup scripts

Third-Party Modules Use of modules of well-known resources Detailed code-analysis is an alternative Avoid modules with encrypted code, licensing modules or class loaders Customers think of third-party modules being Plug-and-Play they often are Plug-and-Pray Checking Third-Party modules is effort

Coding guidelines Zend Framework Coding Standard http://framework.zend.com/manual/1.12/de/ coding-standard.html Magento Extension Developers Guide http://info.magento.com/rs/magentocommerce/images /Magento-Extension-Developers-Guide-v1.0.pdf Imitate the Magento-core

Thank you for your attention! Questions? Blog and slides: http:///quality Xing: Nikolai_Krambrock Twitter: @nkrambrock code4business Software GmbH Dennewartstr. 25-27 52068 Aachen Germany