Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Winning the
Edit•Build•Test
     Cycle

  Rusty Klophaus • @rustyio
     Basho Technologies
The Edit•Build•Test Cycle
 determines how quickly
     you can see the
   results of new code
   in your application.
Developer Productivity
   How much progress can a developer make
    on a problem in some interval of time.

             ...
Developer Productivity
     How much progress can a developer make
      on a problem in some interval of time.

      Int...
Developer Productivity
     How much progress can a developer make
      on a problem in some interval of time.

      Int...
Developer Productivity
     How much progress can a developer make
      on a problem in some interval of time.

      Int...
Developer Productivity
     How much progress can a developer make
      on a problem in some interval of time.

      Int...
How do we “win” it?




         5
How do we win it?


SPEED



POWER



CONSISTENCY

              6
How do we win it?

              Waste Less Time
SPEED



POWER



CONSISTENCY

              6
How do we win it?

              Waste Less Time
SPEED
              Shorter Iterations


POWER



CONSISTENCY

          ...
How do we win it?

              Waste Less Time
SPEED
              Shorter Iterations
              Maintain Focus
POWER...
How do we win it?

              Waste Less Time
SPEED
              Shorter Iterations
              Maintain Focus
POWER...
How do we win it?

              Waste Less Time
SPEED
              Shorter Iterations
              Maintain Focus
POWER...
How do we win it?

              Waste Less Time
SPEED
              Shorter Iterations
              Maintain Focus
POWER...
Edit•Build•Test


       7
Tip 1: Navigating a Project
Tool
 • PeepOpen (Mac only, not free)
 • Works with BBEdit, Coda, Emacs, MacVim,
   TextMate, ...
Tip 1: Navigating a Project




               9
Tip 2: Erlang Documentation
Tool
 • ErlDocs.com

What It Does
 • Searchable Erlang documentation
 • Offline version




    ...
Tip 2: Erlang Documentation




              11
Edit•Build•Test


       12
Tip 3: Manage Erlang Versions
Tool
 • Kerl - Erlang Version Manager
 • https://github.com/spawngrid/kerl

What It Does
 • ...
Tip 3: Manage Erlang Versions

# Install kerl utility...
curl -O https://raw.github.com/spawngrid/
kerl/master/kerl
chmod ...
Tip 4: Simplify Your Makefile
Tool
 • Rebar - Simple-yet-sophisticated build tool
 • https://github.com/basho/rebar

What I...
Tip 4: Simplify Your Makefile

# Rebar simplifies your Makefile.
# (NOTE: Include rebar in your repo.)

all: deps compile

co...
Dependencies


%% FILE: rebar.config
{sub_dirs, ["rel", "deps/myproject"]}.

{deps, [
    {webmachine, "1.9.0", {
       gi...
Tip 4: Simplify Your Makefile
$ make

./rebar get-deps compile
==> rel (get-deps)
==> myproject (get-deps)
==> MyProject (g...
Tip 5: Stay in the Zone




               19
Tip 5: Stay in the Zone




                    Doesn’t realize his code
                    finished compiling...

       ...
Tip 5: Stay in the Zone




                    Doesn’t realize his code
                    finished compiling...
        ...
Tip 5: Stay in the Zone


# Get alerted when `make` is finished.
# Drop this in your .bashrc

function make {
  /usr/bin/ma...
Tip 5: Stay in the Zone

# Get alerted when `make` is finished.
# Drop this in your .bashrc

function make {
  START=$SECON...
Tip 6: Avoid VM Restarts
Tool
 • Mochiweb Reloader

What It Does
 • Automatically reload new beams




                   ...
Tip 6: Avoid VM Restarts
$ erl -pa deps/*/ebin

Eshell V5.8.4 (abort with ^G)
1> % Start the reloader.
1> reloader:start()...
Tip 7: Avoid the Shell
Tool
 • Sync
 • https://github.com/rustyio/Sync

What It Does
 • Automatically recompile new code
 ...
Tip 7: Avoid the Shell
%% Pull http://github.com/rustyio/Sync into
%% ERL_LIBS path and compile.

%% Then, start sync with...
Tip 7: Avoid the Shell
Growl Notifications

         Success!




        Warning!




          Error!



                ...
Edit•Build•Test


       27
Tip 8: Unit Testing + Coverage
Tool
 • Rebar + EUnit + Cover

Goals
 • Run tests for all dependencies
 • Run tests for a s...
Tip 8: Unit Testing + Coverage
./rebar eunit app=mochiweb suite=mochijson2

==> mochiweb (eunit)
======================== ...
Tip 8: Unit Testing + Coverage




              30
In Closing...




      31
Think about your workflow.

   Fix the rough edges.

     You’re worth it.
Thanks!


Rusty Klophaus • @rustyio
   Basho Technologies
Upcoming SlideShare
Loading in …5
×

of

Winning the Erlang Edit•Build•Test Cycle Slide 1 Winning the Erlang Edit•Build•Test Cycle Slide 2 Winning the Erlang Edit•Build•Test Cycle Slide 3 Winning the Erlang Edit•Build•Test Cycle Slide 4 Winning the Erlang Edit•Build•Test Cycle Slide 5 Winning the Erlang Edit•Build•Test Cycle Slide 6 Winning the Erlang Edit•Build•Test Cycle Slide 7 Winning the Erlang Edit•Build•Test Cycle Slide 8 Winning the Erlang Edit•Build•Test Cycle Slide 9 Winning the Erlang Edit•Build•Test Cycle Slide 10 Winning the Erlang Edit•Build•Test Cycle Slide 11 Winning the Erlang Edit•Build•Test Cycle Slide 12 Winning the Erlang Edit•Build•Test Cycle Slide 13 Winning the Erlang Edit•Build•Test Cycle Slide 14 Winning the Erlang Edit•Build•Test Cycle Slide 15 Winning the Erlang Edit•Build•Test Cycle Slide 16 Winning the Erlang Edit•Build•Test Cycle Slide 17 Winning the Erlang Edit•Build•Test Cycle Slide 18 Winning the Erlang Edit•Build•Test Cycle Slide 19 Winning the Erlang Edit•Build•Test Cycle Slide 20 Winning the Erlang Edit•Build•Test Cycle Slide 21 Winning the Erlang Edit•Build•Test Cycle Slide 22 Winning the Erlang Edit•Build•Test Cycle Slide 23 Winning the Erlang Edit•Build•Test Cycle Slide 24 Winning the Erlang Edit•Build•Test Cycle Slide 25 Winning the Erlang Edit•Build•Test Cycle Slide 26 Winning the Erlang Edit•Build•Test Cycle Slide 27 Winning the Erlang Edit•Build•Test Cycle Slide 28 Winning the Erlang Edit•Build•Test Cycle Slide 29 Winning the Erlang Edit•Build•Test Cycle Slide 30 Winning the Erlang Edit•Build•Test Cycle Slide 31 Winning the Erlang Edit•Build•Test Cycle Slide 32 Winning the Erlang Edit•Build•Test Cycle Slide 33 Winning the Erlang Edit•Build•Test Cycle Slide 34 Winning the Erlang Edit•Build•Test Cycle Slide 35 Winning the Erlang Edit•Build•Test Cycle Slide 36 Winning the Erlang Edit•Build•Test Cycle Slide 37 Winning the Erlang Edit•Build•Test Cycle Slide 38 Winning the Erlang Edit•Build•Test Cycle Slide 39 Winning the Erlang Edit•Build•Test Cycle Slide 40 Winning the Erlang Edit•Build•Test Cycle Slide 41 Winning the Erlang Edit•Build•Test Cycle Slide 42 Winning the Erlang Edit•Build•Test Cycle Slide 43 Winning the Erlang Edit•Build•Test Cycle Slide 44
Upcoming SlideShare
Clojure made-simple - John Stevenson
Next
Download to read offline and view in fullscreen.

11 Likes

Share

Download to read offline

Winning the Erlang Edit•Build•Test Cycle

Download to read offline

Having a fast, low-friction Edit/Build/Test cycle is one of the best and easiest ways to increase developer productivity across an organization.

This breadth-first tour covers some of the tools we use at Basho to speed up and streamline the Edit/Build/Test cycle for our Erlang projects.

Winning the Erlang Edit•Build•Test Cycle

  1. 1. Winning the Edit•Build•Test Cycle Rusty Klophaus • @rustyio Basho Technologies
  2. 2. The Edit•Build•Test Cycle determines how quickly you can see the results of new code in your application.
  3. 3. Developer Productivity How much progress can a developer make on a problem in some interval of time. Intelligence X Knowledge / Experience X Typing Speed X Edit•Build•Test Cycle = Developer Productivity (Simplified) 3
  4. 4. Developer Productivity How much progress can a developer make on a problem in some interval of time. Intelligence X Knowledge / Experience X Typing Speed X Edit•Build•Test Cycle = Developer Productivity (Simplified) 4
  5. 5. Developer Productivity How much progress can a developer make on a problem in some interval of time. Intelligence X Knowledge / Experience X Typing Speed X Easy to improve Edit•Build•Test Cycle = Developer Productivity (Simplified) 4
  6. 6. Developer Productivity How much progress can a developer make on a problem in some interval of time. Intelligence X Knowledge / Experience X Typing Speed X Easy to improve Edit•Build•Test Cycle Transferrable to other projects = Developer Productivity (Simplified) 4
  7. 7. Developer Productivity How much progress can a developer make on a problem in some interval of time. Intelligence X Knowledge / Experience X Typing Speed X Easy to improve Edit•Build•Test Cycle Transferrable to other projects = Developer Productivity Transferrable to other people (Simplified) 4
  8. 8. How do we “win” it? 5
  9. 9. How do we win it? SPEED POWER CONSISTENCY 6
  10. 10. How do we win it? Waste Less Time SPEED POWER CONSISTENCY 6
  11. 11. How do we win it? Waste Less Time SPEED Shorter Iterations POWER CONSISTENCY 6
  12. 12. How do we win it? Waste Less Time SPEED Shorter Iterations Maintain Focus POWER CONSISTENCY 6
  13. 13. How do we win it? Waste Less Time SPEED Shorter Iterations Maintain Focus POWER Find Points of Leverage CONSISTENCY 6
  14. 14. How do we win it? Waste Less Time SPEED Shorter Iterations Maintain Focus POWER Find Points of Leverage Avoid Re-invention CONSISTENCY 6
  15. 15. How do we win it? Waste Less Time SPEED Shorter Iterations Maintain Focus POWER Find Points of Leverage Avoid Re-invention CONSISTENCY Easy Onboarding 6
  16. 16. Edit•Build•Test 7
  17. 17. Tip 1: Navigating a Project Tool • PeepOpen (Mac only, not free) • Works with BBEdit, Coda, Emacs, MacVim, TextMate, XCode • http://peepcode.com/products/peepopen What It Does • Find and open files quickly 8
  18. 18. Tip 1: Navigating a Project 9
  19. 19. Tip 2: Erlang Documentation Tool • ErlDocs.com What It Does • Searchable Erlang documentation • Offline version 10
  20. 20. Tip 2: Erlang Documentation 11
  21. 21. Edit•Build•Test 12
  22. 22. Tip 3: Manage Erlang Versions Tool • Kerl - Erlang Version Manager • https://github.com/spawngrid/kerl What It Does • Manage multiple Erlang installations • rbenv / rvm / nvm for Erlang 13
  23. 23. Tip 3: Manage Erlang Versions # Install kerl utility... curl -O https://raw.github.com/spawngrid/ kerl/master/kerl chmod 755 kerl sudo mv kerl /usr/local/bin # Build and install the R14B03 release... kerl build R14B03 r14b03 kerl install r14b03 /opt/erlang/r14b03 # Activate a release . /opt/erlang/r14b03/activate 14
  24. 24. Tip 4: Simplify Your Makefile Tool • Rebar - Simple-yet-sophisticated build tool • https://github.com/basho/rebar What It Does • Simplify our Makefile • Will build *anything* if you follow OTP conventions • Fetch project dependencies • And more... 15
  25. 25. Tip 4: Simplify Your Makefile # Rebar simplifies your Makefile. # (NOTE: Include rebar in your repo.) all: deps compile compile: ./rebar get-deps compile clean: ./rebar clean rel: ./rebar generate 16
  26. 26. Dependencies %% FILE: rebar.config {sub_dirs, ["rel", "deps/myproject"]}. {deps, [ {webmachine, "1.9.0", { git, "git://github.com/basho/webmachine", {tag, "1.9.0"} }} ]}. 17
  27. 27. Tip 4: Simplify Your Makefile $ make ./rebar get-deps compile ==> rel (get-deps) ==> myproject (get-deps) ==> MyProject (get-deps) Pulling webmachine from {git,"git://github.com/basho/webmachine", {tag,"1.9.0"}} Cloning into webmachine... ==> webmachine (get-deps) Pulling mochiweb from {git,"git://github.com/mochi/mochiweb",{tag,"1.5.1"}} Cloning into mochiweb... ==> mochiweb (get-deps) ==> mochiweb (compile) Compiled src/mochiweb_sup.erl ...snip... ==> webmachine (compile) Compiled src/webmachine_util.erl ...snip... ==> rel (compile) ==> MyProject (compile) Compiled src/myproject_app.erl Compiled src/myproject_sup.erl
  28. 28. Tip 5: Stay in the Zone 19
  29. 29. Tip 5: Stay in the Zone Doesn’t realize his code finished compiling... 19
  30. 30. Tip 5: Stay in the Zone Doesn’t realize his code finished compiling... 20 minutes ago. 19
  31. 31. Tip 5: Stay in the Zone # Get alerted when `make` is finished. # Drop this in your .bashrc function make { /usr/bin/make "$@" say "Finished make $1" } 20
  32. 32. Tip 5: Stay in the Zone # Get alerted when `make` is finished. # Drop this in your .bashrc function make { START=$SECONDS /usr/bin/make "$@" ELAPSED=`echo $SECONDS - $START | bc` growlnotify -n "make" "Finished make $1!" -m "Took $ELAPSED seconds." } 21
  33. 33. Tip 6: Avoid VM Restarts Tool • Mochiweb Reloader What It Does • Automatically reload new beams 22
  34. 34. Tip 6: Avoid VM Restarts $ erl -pa deps/*/ebin Eshell V5.8.4 (abort with ^G) 1> % Start the reloader. 1> reloader:start(). 2> % Ensure mymodule is loaded 2> code:ensure_loaded(mymodule). 3> % Edit and compile mymodule.erl 3> % and Mochiweb reloader will reload it. Reloading myproject_sup ... ok. 23
  35. 35. Tip 7: Avoid the Shell Tool • Sync • https://github.com/rustyio/Sync What It Does • Automatically recompile new code • Automatically reload new beams • Growl (or notify) the results 24
  36. 36. Tip 7: Avoid the Shell %% Pull http://github.com/rustyio/Sync into %% ERL_LIBS path and compile. %% Then, start sync within your project. %% Make sure erl is started with `-mode interactive`, %% not `-mode embedded`. sync:go(). Starting Sync (Automatic Code Compiler / Reloader) Scanning source files... ok =INFO REPORT==== 10-Oct-2011::10:37:58 === /Users/rusty/Documents/Code/MyProject/src/ myproject_sup.erl:0: Recompiled. =INFO REPORT==== 10-Oct-2011::10:37:58 === myproject_sup: Reloaded! (Beam changed.) 25 Reloading myproject_sup ... ok.
  37. 37. Tip 7: Avoid the Shell Growl Notifications Success! Warning! Error! 26
  38. 38. Edit•Build•Test 27
  39. 39. Tip 8: Unit Testing + Coverage Tool • Rebar + EUnit + Cover Goals • Run tests for all dependencies • Run tests for a specific dependency • Run tests for a specific module • Include a coverage report 28
  40. 40. Tip 8: Unit Testing + Coverage ./rebar eunit app=mochiweb suite=mochijson2 ==> mochiweb (eunit) ======================== EUnit ======================== module 'mochijson2' mochijson2: decode_test...[0.001 s] ok ...snip... [done in 0.044 s] =================================== ==================== All 14 tests passed. Cover analysis: /Users/rusty/Documents/Code/ MyProject/deps/mochiweb/.eunit/index.html ==> webmachine (eunit) ==> rel (eunit) ==> myproject (eunit) 29 ==> MyProject (eunit)
  41. 41. Tip 8: Unit Testing + Coverage 30
  42. 42. In Closing... 31
  43. 43. Think about your workflow. Fix the rough edges. You’re worth it.
  44. 44. Thanks! Rusty Klophaus • @rustyio Basho Technologies
  • shreekavi

    Jul. 19, 2015
  • aloyer

    Jun. 9, 2014
  • mkrogemann

    Jan. 3, 2014
  • mwk20

    May. 16, 2013
  • DmitriyMazurin

    Dec. 29, 2012
  • algking

    Jun. 11, 2012
  • popopome

    Apr. 30, 2012
  • uwearzt

    Dec. 14, 2011
  • bciceron

    Nov. 12, 2011
  • tim.lossen.de

    Oct. 21, 2011
  • async_io

    Oct. 20, 2011

Having a fast, low-friction Edit/Build/Test cycle is one of the best and easiest ways to increase developer productivity across an organization. This breadth-first tour covers some of the tools we use at Basho to speed up and streamline the Edit/Build/Test cycle for our Erlang projects.

Views

Total views

5,999

On Slideshare

0

From embeds

0

Number of embeds

1,291

Actions

Downloads

75

Shares

0

Comments

0

Likes

11

×