Software Engineering
    for Startups	
  

        Ali Khajeh-Hosseini

     @AliKhajeh, @PlanForCloud
           Nov 2012, University of St Andrews
Why am I here?

Show you how we do…
       software engineering
Jan 2009: Started PhD in St Andrews
    May 2010: PlanForCloud v.1 ready
         Feb 2011: Interned in California for 7 months

             Dec 2011: Hassan quit his job and joined
                  Feb 2012: Launched PlanForCloud v.2
                       May 2012: Mountain View for YC interview
What the heck is…
             a cloud?
Server
Rack
Container
2500
                    Servers


Electricity, Water, Internet
Taken from one Dave Cliff ’s talk on Cloud Computing
a cloud
12 Staff
       30 Megawatts = Perth (Scotland)!
       140 Containers
       38,500 m2 = 4 ftbl pitches

       360,000 Servers
       500,000,000 Dollars
h#p://www.microso/.com/Presspass/emea/presscentre/pressreleases/February2012/23-­‐02DublinDataCentre.mspx	
  
Cloud Computing	
  
                      Infrastructure-as-a-Service

                                 Platform-as-a-Service

                                          Software-as-a-Service
PlanForCloud helps users make decisions
      RightScale helps users do it
How much would it cost to deploy my systems on Cloud X?

Would it be cheaper if I use deployment option X or Y?

What happens to my costs if:
-  my system grows?
-  cloud provider changes prices?
IT managers   Software Engs
        Consultants   Accountants
Users
around   9,000 prices in PlanForCloud
$1.7M/year
PlanForCloud Engineering

In God we trust;
all others must bring data.
W. Edwards Deming
Engineering Roles
Product Manager: what should we build?
Director of Development: how should we build it?
Architects: design it
Interaction designer: improve the user experience
Operations: deploy and monitor it
Support: help customers use it
Escalations: something just broke, who can fix it?
                                              Engineers: work with
                                        everyone to build and test it
In a startup, each person plays many roles




  Hiring        Product manager     Engineer
  Architect     Marketing manager   QA
  Operations    Support             Operations
  Escalations   User Experience     R&D
Dev Process: Scrum
1 day planning
3 week sprints
                   3	
  weeks	
  

Go/No-Go
Release
Retro
Design
           It’s all informal
Just a wiki page
  + Comments/emails

                               No Word documents
                                No UML diagrams
Planning
Engineers breakdown stories into tasks
Granularity: less than a day to complete
 Story: As a user
 I want to export report as PDF
 So that I can share it with others
      •  Refactor simulation engine to…
      •  Switch from Google charts to Highcharts
      •  Generate PDF in background queue
      •  …
      •  Write tests
      •  Code review
Estimation
Play planning poker
Sprint calculations
                   =================	
  Sprint	
  Summary	
  =================	
  
                   	
  
                   Sprint	
  Begins:	
  10/2/2012	
  
                   Sprint	
  Ends:	
  10/19/2012	
  
                   Sprint	
  DuraJon:	
  14	
  days	
  
                   	
  
                   Team:	
  John,	
  Joe,	
  Jeff,	
  Jack	
  
                   Development:	
  
                   VacaJon:	
  0	
  days	
  
                   Total	
  Capacity:	
  300	
  hours	
  
                   -­‐-­‐	
  grooming/management:	
  30	
  
                   -­‐-­‐	
  release	
  issues:	
  10	
  

Start sprinting…
                   -­‐-­‐	
  priority	
  bugs:	
  30	
  
                   -­‐-­‐	
  tech	
  debt:	
  30	
  
                   -­‐-­‐	
  backlog:	
  
                   -­‐-­‐-­‐-­‐	
  must	
  have:	
  150	
  
                   -­‐-­‐-­‐-­‐	
  nice	
  to	
  have:	
  50	
  
Daily standup
Answer:
   1.  What did you do yesterday?
   2.  What are going to do today?
   3.  Is anything blocking you?


    Every day 9:30am sharp
Sprint metrics
Release prematurely & often
But you need protection:
Good tests
Exception handling
Automate as much as you can
Good tests
        Positive tests

        Negative tests


        Fast tests
Good test coverage
Continuous integration
Name and shame
Exception handling



             1. On-call ops engineer
              2. VP of engineering
                3. CTO
                 4. CEO
Issue tracking
Automate, Automate, Automate




                Releasing new code:	
  
        heroku pgbackups:capture --app planforcloud
        git push planforcloud master
        heroku run rake db:migrate --app planforcloud
Performance monitoring
Let’s recap:
You built it and shipped it
 How is it being used?
How can you improve it?
User metrics
- Google analytics
- Custom metrics
    from DB
User testing
- Record user sessions
- Ask for lots
    of feedback
User experience
- Investigate user flow
- Wireframing tools help
Why you should join a startup
•    Great learning environment
•    Informal and fun
•    Young people with lots of energy
•    Take work seriously, but not themselves
•    Move quickly: Just F*ing Do It (JFDI)
RightScale
 Employee
 Meetup
 
Sunny
 Santa

Software Engineering For Startups

  • 1.
    Software Engineering for Startups   Ali Khajeh-Hosseini @AliKhajeh, @PlanForCloud Nov 2012, University of St Andrews
  • 2.
    Why am Ihere? Show you how we do… software engineering
  • 3.
    Jan 2009: StartedPhD in St Andrews May 2010: PlanForCloud v.1 ready Feb 2011: Interned in California for 7 months Dec 2011: Hassan quit his job and joined Feb 2012: Launched PlanForCloud v.2 May 2012: Mountain View for YC interview
  • 5.
    What the heckis… a cloud?
  • 6.
  • 7.
  • 8.
  • 9.
    2500 Servers Electricity, Water, Internet
  • 12.
    Taken from oneDave Cliff ’s talk on Cloud Computing
  • 13.
  • 14.
    12 Staff 30 Megawatts = Perth (Scotland)! 140 Containers 38,500 m2 = 4 ftbl pitches 360,000 Servers 500,000,000 Dollars h#p://www.microso/.com/Presspass/emea/presscentre/pressreleases/February2012/23-­‐02DublinDataCentre.mspx  
  • 15.
    Cloud Computing   Infrastructure-as-a-Service Platform-as-a-Service Software-as-a-Service
  • 16.
    PlanForCloud helps usersmake decisions RightScale helps users do it
  • 17.
    How much wouldit cost to deploy my systems on Cloud X? Would it be cheaper if I use deployment option X or Y? What happens to my costs if: -  my system grows? -  cloud provider changes prices?
  • 18.
    IT managers Software Engs Consultants Accountants Users
  • 19.
    around 9,000 prices in PlanForCloud
  • 21.
  • 22.
    PlanForCloud Engineering In Godwe trust; all others must bring data. W. Edwards Deming
  • 23.
    Engineering Roles Product Manager:what should we build? Director of Development: how should we build it? Architects: design it Interaction designer: improve the user experience Operations: deploy and monitor it Support: help customers use it Escalations: something just broke, who can fix it? Engineers: work with everyone to build and test it
  • 24.
    In a startup,each person plays many roles Hiring Product manager Engineer Architect Marketing manager QA Operations Support Operations Escalations User Experience R&D
  • 25.
    Dev Process: Scrum 1day planning 3 week sprints 3  weeks   Go/No-Go Release Retro
  • 26.
    Design It’s all informal Just a wiki page + Comments/emails No Word documents No UML diagrams
  • 27.
    Planning Engineers breakdown storiesinto tasks Granularity: less than a day to complete Story: As a user I want to export report as PDF So that I can share it with others •  Refactor simulation engine to… •  Switch from Google charts to Highcharts •  Generate PDF in background queue •  … •  Write tests •  Code review
  • 28.
  • 29.
    Sprint calculations =================  Sprint  Summary  =================     Sprint  Begins:  10/2/2012   Sprint  Ends:  10/19/2012   Sprint  DuraJon:  14  days     Team:  John,  Joe,  Jeff,  Jack   Development:   VacaJon:  0  days   Total  Capacity:  300  hours   -­‐-­‐  grooming/management:  30   -­‐-­‐  release  issues:  10   Start sprinting… -­‐-­‐  priority  bugs:  30   -­‐-­‐  tech  debt:  30   -­‐-­‐  backlog:   -­‐-­‐-­‐-­‐  must  have:  150   -­‐-­‐-­‐-­‐  nice  to  have:  50  
  • 30.
    Daily standup Answer: 1.  What did you do yesterday? 2.  What are going to do today? 3.  Is anything blocking you? Every day 9:30am sharp
  • 31.
  • 32.
    Release prematurely &often But you need protection: Good tests Exception handling Automate as much as you can
  • 33.
    Good tests Positive tests Negative tests Fast tests
  • 34.
  • 35.
  • 36.
  • 37.
    Exception handling 1. On-call ops engineer 2. VP of engineering 3. CTO 4. CEO
  • 38.
  • 39.
    Automate, Automate, Automate Releasing new code:   heroku pgbackups:capture --app planforcloud git push planforcloud master heroku run rake db:migrate --app planforcloud
  • 40.
  • 41.
    Let’s recap: You builtit and shipped it How is it being used? How can you improve it?
  • 42.
    User metrics - Googleanalytics - Custom metrics from DB
  • 43.
    User testing - Recorduser sessions - Ask for lots of feedback
  • 44.
    User experience - Investigateuser flow - Wireframing tools help
  • 45.
    Why you shouldjoin a startup •  Great learning environment •  Informal and fun •  Young people with lots of energy •  Take work seriously, but not themselves •  Move quickly: Just F*ing Do It (JFDI)
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.