AdPlatform Framework update
Jan 21, 2015
Seungjoon Lee| joon@sharethis.com
1
Let’s start with problems we have
• No Git Branch Rule
• No Testing framework for Javascript and PHP
• No Code Coverage for Javascript and PHP
• No Continuous Database Integration Rule
• No Task Runner for repetition
• No UserTest or Integration Test
2
Then… I was thinking and researching
• Researching online and Reading books
3
Found the right way in the bathtub
4
Let’s start!
5
Git Branch Model : Git Flow (1)
• Git Flow generates an elegant mental model that is easy to understand
and allows team members to develop a shared understanding of the
branching and releasing processes with Jira.
6
Git Branch Model : Git Flow (2)
• Git + Jira : Easy to see the development progress for managers
7
Git submodule (1)
• It often happens that while working on one project (Adops), you need to
use another project(AdAPI) from within it. Perhaps it’s a library that a third
party developed or that you’re developing separately and using in multiple
parent projects.
8
Git submodule (2)
9
• Decouple the core library : Easy to test and mange
Javascript test runner : Grunt (1)
10
• Why use a task runner?
In one word: Automation. The less work you have to do when performing
repetitive tasks like minification, compilation, unit testing, linting, etc, the
easier your job becomes.
Javascript test runner : Grunt (2)
11
• Configure your task in Gruntfile.js
Package Manager : NPM (JS)
12
• Npm(Node Package Manager) runs through the command line and
manages dependencies for an application.
• Setting dependency in package.json
Package Manager : Composer (PHP)
13
• Composer is a application-level dependency manager for the PHP
programming language that provides a standard format for managing
dependencies of PHP software and required libraries.
• Setting dependency in composer.json
Continuous Database Integration : Phinx (1)
14
• Most database migration tools are framework dependent, complicated,
confusing to install/configure and a pain in the ass to write migrations for.
In less than 5 minutes you can install Phinx, create and execute your first
migration.
Continuous Database Integration : Phinx (2)
15
Javascript UnitTest : Jasmine.js, Karma.js (1)
16
• Jasmine is an open source testing framework for JavaScript. It aims to run
on any JavaScript-enabled platform, to not intrude on the application nor
the IDE, and to have easy-to-read syntax.
• The main goal for Karma is to bring a productive testing environment to
developers. The environment being one where they don't have to set up
loads of configurations, but rather a place where developers can just
write the code and get instant feedback from their tests. (karma.conf.js)
Javascript UnitTest : Jasmine.js, Karma.js (2)
17
Javascript Code Coverage : istanbul
18
• Made by Krishnan Anantheswaran from the YUI team Yahoo! Cocktail
team, Istanbul is extremely easy to use. It is suitable for both browser-
based instrumentation or Node.js application analysis.
• Under the hood, Istanbul uses Esprima to parse JavaScript code and
Escodegen to generate the instrumented version of the code
PHP UnitTest : PHPUnit, Fixture, Clover (1)
19
• PHPUnit is a unit testing framework for the PHP programming language. It
is an instance of the xUnit architecture for unit testing frameworks that
originated with SUnit and became popular with Junit.
• Setting the configuration in phpunit.xml
PHP UnitTest : PHPUnit, Fixture, Clover (2)
20
• One of the most time-consuming parts of writing tests is writing the code
to set the world up in a known state and then return it to its original
state when the test is complete. This known state is called the fixture of
the test
PHP UnitTest : PHPUnit, Fixture, Clover (3)
21
UserTest : Selenium IDE, Selenium Server (1)
22
• Selenium is a portable software testing framework for web applications.
Selenium provides a record/playback tool for authoring tests without
learning a test scripting language (Selenium IDE)
UserTest : Selenium IDE, Selenium Server (2)
23
• java -jar selenium-server-standalone-2.44.0.jar -htmlSuite
"*googlechrome" "http://xxx.com" src/TestFIle.html
report/ReportFile.html
Excellent!
24
Let’s Recap!
25
Let’s Recap!
26
• No Git Branch Rule => Git Flow
• No Testing framework for Javascript and PHP => Jasmine, Karma, PHPUnit
• No Code Coverage for Javascript and PHP => Istanbul, Clover
• No Continuous Database Integration Rule => Phinx
• No Task Runner for repetition => Grunt
• No UserTest or Integration Test => Selenium
Q & A
27
Don't code today what you can't debug tomorrow
28

Framework

  • 1.
    AdPlatform Framework update Jan21, 2015 Seungjoon Lee| joon@sharethis.com 1
  • 2.
    Let’s start withproblems we have • No Git Branch Rule • No Testing framework for Javascript and PHP • No Code Coverage for Javascript and PHP • No Continuous Database Integration Rule • No Task Runner for repetition • No UserTest or Integration Test 2
  • 3.
    Then… I wasthinking and researching • Researching online and Reading books 3
  • 4.
    Found the rightway in the bathtub 4
  • 5.
  • 6.
    Git Branch Model: Git Flow (1) • Git Flow generates an elegant mental model that is easy to understand and allows team members to develop a shared understanding of the branching and releasing processes with Jira. 6
  • 7.
    Git Branch Model: Git Flow (2) • Git + Jira : Easy to see the development progress for managers 7
  • 8.
    Git submodule (1) •It often happens that while working on one project (Adops), you need to use another project(AdAPI) from within it. Perhaps it’s a library that a third party developed or that you’re developing separately and using in multiple parent projects. 8
  • 9.
    Git submodule (2) 9 •Decouple the core library : Easy to test and mange
  • 10.
    Javascript test runner: Grunt (1) 10 • Why use a task runner? In one word: Automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes.
  • 11.
    Javascript test runner: Grunt (2) 11 • Configure your task in Gruntfile.js
  • 12.
    Package Manager :NPM (JS) 12 • Npm(Node Package Manager) runs through the command line and manages dependencies for an application. • Setting dependency in package.json
  • 13.
    Package Manager :Composer (PHP) 13 • Composer is a application-level dependency manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. • Setting dependency in composer.json
  • 14.
    Continuous Database Integration: Phinx (1) 14 • Most database migration tools are framework dependent, complicated, confusing to install/configure and a pain in the ass to write migrations for. In less than 5 minutes you can install Phinx, create and execute your first migration.
  • 15.
  • 16.
    Javascript UnitTest :Jasmine.js, Karma.js (1) 16 • Jasmine is an open source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. • The main goal for Karma is to bring a productive testing environment to developers. The environment being one where they don't have to set up loads of configurations, but rather a place where developers can just write the code and get instant feedback from their tests. (karma.conf.js)
  • 17.
    Javascript UnitTest :Jasmine.js, Karma.js (2) 17
  • 18.
    Javascript Code Coverage: istanbul 18 • Made by Krishnan Anantheswaran from the YUI team Yahoo! Cocktail team, Istanbul is extremely easy to use. It is suitable for both browser- based instrumentation or Node.js application analysis. • Under the hood, Istanbul uses Esprima to parse JavaScript code and Escodegen to generate the instrumented version of the code
  • 19.
    PHP UnitTest :PHPUnit, Fixture, Clover (1) 19 • PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit architecture for unit testing frameworks that originated with SUnit and became popular with Junit. • Setting the configuration in phpunit.xml
  • 20.
    PHP UnitTest :PHPUnit, Fixture, Clover (2) 20 • One of the most time-consuming parts of writing tests is writing the code to set the world up in a known state and then return it to its original state when the test is complete. This known state is called the fixture of the test
  • 21.
    PHP UnitTest :PHPUnit, Fixture, Clover (3) 21
  • 22.
    UserTest : SeleniumIDE, Selenium Server (1) 22 • Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE)
  • 23.
    UserTest : SeleniumIDE, Selenium Server (2) 23 • java -jar selenium-server-standalone-2.44.0.jar -htmlSuite "*googlechrome" "http://xxx.com" src/TestFIle.html report/ReportFile.html
  • 24.
  • 25.
  • 26.
    Let’s Recap! 26 • NoGit Branch Rule => Git Flow • No Testing framework for Javascript and PHP => Jasmine, Karma, PHPUnit • No Code Coverage for Javascript and PHP => Istanbul, Clover • No Continuous Database Integration Rule => Phinx • No Task Runner for repetition => Grunt • No UserTest or Integration Test => Selenium
  • 27.
  • 28.
    Don't code todaywhat you can't debug tomorrow 28