SlideShare une entreprise Scribd logo
1  sur  113
Télécharger pour lire hors ligne
Best Practices
                              Youssef Chaker
                            February 23-24 2012

                                 Presented by




Monday, February 27, 12
Day 1


                          The Why, What and How




Monday, February 27, 12
but first...

                          Who am I and why should
                             you listen to me?




Monday, February 27, 12
Monday, February 27, 12
Why?



Monday, February 27, 12
Developers are not
                            code monkeys


Monday, February 27, 12
Better relationships
                          with customers and
                          business dev people


Monday, February 27, 12
Professionalism
                            ...remember that one?




Monday, February 27, 12
<warning>



Monday, February 27, 12
Ariane 5 Flight 501
                      Flight 501, which took place on June 4, 1996, was the first, and
                      unsuccessful, test flight of the European Ariane 5 expendable launch system.
                      Due to an error in the software design (inadequate        protection
                      from integer overflow), the rocket veered off its flight path 37
                      seconds after launch and was destroyed by its automated self-destruct
                      system when high aerodynamic forces caused the core of the vehicle to
                      disintegrate. It is one of the most infamous computer bugs in history.
                      The breakup caused the loss of four Cluster mission spacecraft, resulting in
                      a loss of more than US$370 million




                                                           10
Monday, February 27, 12
Therac-25
             The Therac-25 was a radiation therapy machine produced by Atomic Energy of
             Canada Limited (AECL) [...]. It was involved with at least six accidents between 1985
             and 1987, in which patients were given massive overdoses of radiation, approximately
             100 times the intended dose. Three of the six patients died as a direct consequence.
             These accidents highlighted the dangers of software control of safety-critical systems,
             and they have become a standard case study in health informatics and software
             engineering.
             [...]
             A commission has concluded that the primary reason should be attributed to the bad
             software design and development practices, and not explicitly to several coding errors
             that were found. In particular, the software was designed so that it was relatively
             impossible to test it in a clean automated way.




Monday, February 27, 12
More online:
            http://en.wikipedia.org/wiki/List_of_software_bugs




Monday, February 27, 12
</warning>



Monday, February 27, 12
what not to do!



Monday, February 27, 12
source: http://thedailywtf.com/Articles/Flexible-Spending.aspx#pic2
Monday, February 27, 12
Shortcuts

                           Quick & dirty

                          Cutting Corners
Monday, February 27, 12
Live Coding



Monday, February 27, 12
A Simple Prayer


                           Lord, please protect our biggest VPS from
                                    Eric's installed software

                            - including but not limited to plugins and
                            gems written by 11 year old  Pakistanis.

                          May his apps be well behaved and may they
                               be considerate of CPU and RAM.

                          Lord, if any of these terms are unfamiliar to
                               you, look them up on Wikipedia.

                            Peace be to all other apps and all other
                              VPSs on the same physical server.


                                             Amen.



Monday, February 27, 12
what to do?



Monday, February 27, 12
What You Already Know
                    •     Follow coding standards.

                    •     Be consistent. If you do operations in a specific way, do that kind of
                          operations in the same way (e.g. defining variable/method/class names,
                          parenthesis usage etc.).

                    •     More code does not mean better code. Keep it simple and reduce
                          complexity.

                    •     Catch specific exceptions instead of highest level class 'Exception'. This will
                          provide understandability and more performance.

                    •     Use understandable and long names for variables. Loop variable names can
                          be i, j, k, index etc., local variable names must be longer than loop variables,
                          parameter names must be longer than local variables and static variable
                          names must be longer than parameters; proportional with scope size.

                    •     Don't use magic numbers and strings directly in the code. Use constants.
                          This method provides more modularity and understandability.

                    •     Use understandable comments. Bad comment is worse than no comment.

                    •     Method names must include "what is done by this method" information.
Monday, February 27, 12
•      Package related classes (that changed together and/or used together) together.

          •      Use positive conditionals. Readability of positive conditionals are better than negative
                 ones.

          •      Use dependency injection to manage too many singletons.

          •      Use exceptions only for catching exceptions, not for control flow. Think as required and
                 perform control flow with control statements/conditionals.

          •      Don't use so many arguments with methods. Keep the number at most 8-10. If more is
                 required, review your design.

          •      Don't use method alternatives with boolean flag variables (public void
                 someMethod(bool flag)). Write more than one method for each flag condition.

          •      Think twice before defining a method as static and be sure if you really need to. Static
                 methods are harder to manage.

          •      Avoid using methods with reference parameters. Use multi attributed object
                 parameters instead.

          •      Number of interface methods must be minimized to decrease coupling/dependency.



Monday, February 27, 12
What School Did not Teach You
                    • Deliver often, get user feedback in a
                          continuous regular and intense flow
                    • Don't try to be too much smarter than
                          your customer, just enough
                    • Do only whats needed to deliver the
                          functionality expected in each step in the
                          best possible way
                    • Make sure you love and care about your
                          work, code, user and customer
Monday, February 27, 12
Questions?
                          Comments?
                          Concerns?


Monday, February 27, 12
“Motivational
  products don’t
      work.
     But our
  Demotivators®
  products don’t
    work even
     better.”
Monday, February 27, 12
TDD
           Test Driven Development


Monday, February 27, 12
Write Tests
                          Let them fail


Monday, February 27, 12
Write the minimal
                          code that will make
                            your tests pass


Monday, February 27, 12
Write More Tests



Monday, February 27, 12
rinse lather repeat



Monday, February 27, 12
source: http://www.agiledata.org/essays/tdd.html
Monday, February 27, 12
= TFD
                  Test First Development


Monday, February 27, 12
TDD = x + TFD
                           any guesses to
                             what x is?

Monday, February 27, 12
Refactor



Monday, February 27, 12
source: http://www.agiledata.org/essays/tdd.html
Monday, February 27, 12
source: http://www.despair.com/overconfidence.html
Monday, February 27, 12
Monday, February 27, 12
TDD
                                     ||
                                     /
                          less fluff, more stuff

Monday, February 27, 12
xUnit                   Frameworks                                           RSpec




                          for more: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks
Monday, February 27, 12
Monday, February 27, 12
Monday, February 27, 12
bash-3.2$ bundle exec rake spec
   ..................................................................................*.....................................................................................................
   .......................................................

   Pending:
    GroupVenue add some examples to (or delete) /Users/ychaker/Dev/jogabo/spec/models/
   group_venue_spec.rb
      # No reason given
      # ./spec/models/group_venue_spec.rb:4

   Finished in 3 minutes 43.24 seconds
   239 examples, 0 failures, 1 pending


   .................................................................................................................................................................
   .............................................................................

   Finished in 3 minutes 49.69 seconds
   238 examples, 0 failures




Monday, February 27, 12
Break
                          15 minutes


Monday, February 27, 12
and we’re back...



Monday, February 27, 12
Question:


                            Why are you writing code?
                          What’s the purpose of your code?




Monday, February 27, 12
Answer:


                          solve Business problems

                          produce a certain Behavior




Monday, February 27, 12
Then maybe we should
                    do Behavior Driven
                      Development!


Monday, February 27, 12
D’oh!



Monday, February 27, 12
source: http://www.agiledata.org/essays/tdd.html
Monday, February 27, 12
Disclaimer:
                          The RSpec example
                          was actually a BDD
                               example
Monday, February 27, 12
User Stories



Monday, February 27, 12
Features



Monday, February 27, 12
Scenarios



Monday, February 27, 12
Monday, February 27, 12
Integration Testing



Monday, February 27, 12
cucumber demo



Monday, February 27, 12
Continuous Integration
                          (CI)


Monday, February 27, 12
Hudson




Monday, February 27, 12
Monday, February 27, 12
Monday, February 27, 12
standup, stretch your legs



Monday, February 27, 12
if there’s anything I
                     want you to take away
                     from today is this last
                               part

Monday, February 27, 12
Client-server model
                               (examples)

                    • Concurrent Versions System (CVS)
                    • Subversion (svn)


Monday, February 27, 12
Distributed model
                             (examples)

                               • Fossil
                               • git
                               • Mercurial


Monday, February 27, 12
delete,
                          don’t comment out


Monday, February 27, 12
Always use source
                      control system even if
                       the project has only
                          one developer

Monday, February 27, 12
git demo



Monday, February 27, 12
Questions?
                          Comments?
                          Concerns?


Monday, February 27, 12
Monday, February 27, 12
Day 2


                          Go Beyond




Monday, February 27, 12
Activity



Monday, February 27, 12
Be Agile, Be Happy



Monday, February 27, 12
Agile Manifesto
                    We are uncovering better ways of developing
                    software by doing it and helping others do it.
                     Through this work we have come to value:

Individuals and interactions over processes & tools
Working software over comprehensive documentation
 Customer collaboration over contract negotiation
    Responding to change over following a plan

                     That is, while there is value in the items on
                   the right, we value the items on the left more.
Monday, February 27, 12
Let’s go closer



Monday, February 27, 12
Agile Modeling
                       Agile Unified Process (AUP)
              Dynamic Systems Development Method (DSDM)
                    Essential Unified Process (EssUP)
                       Extreme Programming (XP)
                   Feature Driven Development (FDD)
                    Open Unified Process (OpenUP)
                                  Scrum
                             Velocity tracking


Monday, February 27, 12
Scrum



Monday, February 27, 12
Monday, February 27, 12
iterative, incremental
                   framework for project
                   management and agile
                   software development.

Monday, February 27, 12
Monday, February 27, 12
2-4 week sprints



Monday, February 27, 12
“ScrumMaster”, who
                          maintains the processes
                            (typically in lieu of a
                              project manager)


Monday, February 27, 12
“Product Owner”,
                             who represents the
                          stakeholders, represents
                                the business



Monday, February 27, 12
“Team”, a cross-
                          functional group of about 7
                           people who do the actual
                                analysis, design,
                            implementation, testing,
                                      etc.

Monday, February 27, 12
Pigs & Chickens
 A pig and a chicken are walking down a road. The chicken
                   looks at the pig and says,
           “Hey, why don’t we open a restaurant?”
   The pig looks back at the chicken and says, “Good idea,
                 what do you want to call it?”
             The chicken thinks about it and says,
            “Why don’t we call it ‘Ham and Eggs’?”
 “I don’t think so,” says the pig, “I’d be committed, but you’d
                       only be involved.”


Monday, February 27, 12
Key Notions

                    • (Sprint) Planning
                    • Backlog*
                    • (Sprint) Burn down
                    • Daily Standups
                    • + more...
          *Backlog: Product/Sprint backlog or any list of tasks
Monday, February 27, 12
Scrum for Kids



Monday, February 27, 12
YES!
                          I’m serious


Monday, February 27, 12
The Meads




Monday, February 27, 12
Introducing the Scrum
                             Board




Monday, February 27, 12
The Pughs




Monday, February 27, 12
The Board (again)




Monday, February 27, 12
The Toyota way



Monday, February 27, 12
The Right Process Will
                     Produce the Right Results
     1. Create continuous process flow to bring problems to the surface.
     2. Use the "pull" system to avoid overproduction.
     3. Level out the workload (heijunka). (Work like the tortoise, not the
        hare.)
     4. Build a culture of stopping to fix problems, to get quality right from
        the [start].
     5. Standardized tasks are the foundation for continuous improvement
        and employee empowerment.
     6. Use visual control so no problems are hidden.
     7. Use only reliable, thoroughly tested technology that serves your
        people and processes.
Monday, February 27, 12
Add Value to the Organization by
    Developing Your People and Partners

                    1. Grow leaders who thoroughly understand
                       the work, live the philosophy, and teach it
                       to others.
                    2. Develop exceptional people and teams who
                       follow your company's philosophy.
                    3. Respect your extended network of
                       partners and suppliers by challenging them
                       and helping them improve.
Monday, February 27, 12
Continuously Solving Root Problems
       Drives Organizational Learning
         1. Go and see for yourself to thoroughly understand
            the situation (Genchi Genbutsu, 現地現物);

         2. Make decisions slowly by consensus, thoroughly
            considering all options (Nemawashi, 根回し);
                 implement decisions rapidly;
         3. Become a learning organization through relentless
            reflection (Hansei, 反省) and continuous
                 improvement (Kaizen, 改善).
Monday, February 27, 12
Break
                          15 minutes


Monday, February 27, 12
and we’re back...



Monday, February 27, 12
Monday, February 27, 12
Activity



Monday, February 27, 12
Sprint Planning
+ Scrum Poker




Monday, February 27, 12
Daily Standups
       Short: less than
         15 minutes
                            What did I do yesterday?
                            What am I doing today?
                            What are my obstacles?
Monday, February 27, 12
Stay Flexible
                           Stay Lean


Monday, February 27, 12
Retrospectives




Monday, February 27, 12
Monday, February 27, 12
Monday, February 27, 12
Pair Programming



Monday, February 27, 12
Monday, February 27, 12
Questions?
                          Comments?
                          Concerns?


Monday, February 27, 12
Bonus



Monday, February 27, 12
Lean Startup



Monday, February 27, 12
Screen



Monday, February 27, 12
You have now learnt
                          the basic of software
                              craftsmanship


Monday, February 27, 12
References
• Fowler, Martin. The New Methodology: http://martinfowler.com/articles/newMethodology.html
• Wikipedia. Agile Software Development: http://en.wikipedia.org/wiki/Agile_software_development
• Manifesto for Agile Software Development: http://agilemanifesto.org/
• Wikipedia. Scrum (development): http://en.wikipedia.org/wiki/Scrum_(development)
• Wikipedia. Ariane 5 Flight 501: http://en.wikipedia.org/wiki/Ariane_5_Flight_501
• Ariane 5 Failure, Full Report: http://sunnyday.mit.edu/accidents/Ariane5accidentreport.html
• Wikipedia. Tehrac-25: http://en.wikipedia.org/wiki/Therac-25
• Wikipedia. List of software bugs: http://en.wikipedia.org/wiki/List_of_software_bugs
• Rails Maturity Models: http://railsmaturitymodels.com/practices
• Scrum For Kids http://scrumforkids.com/
• Toyota Production System http://en.wikipedia.org/wiki/Toyota_Production_System
• The Toyota Way http://en.wikipedia.org/wiki/The_Toyota_Way
• Manifesto for Software Craftsmanship http://manifesto.softwarecraftsmanship.org/
• The Lean Startup http://theleanstartup.com/
• Cucumber-Rails https://github.com/cucumber/cucumber-rails
• Gherkin https://github.com/cucumber/cucumber/wiki/Gherkin
Monday, February 27, 12
Contact

                                  @ychaker

                               http://youhoo.im

                          http://linked.com/in/ychaker

Monday, February 27, 12

Contenu connexe

Similaire à Best Practices - Seeqnce - 23/24-02-2012

Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)
Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)
Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)Rick. Bahague
 
eXo Software Factory Overview
eXo Software Factory OvervieweXo Software Factory Overview
eXo Software Factory OverviewArnaud Héritier
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...mCloud
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CDRoger Turnau
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)Dennis Doomen
 
An Analytics Toolkit Tour
An Analytics Toolkit TourAn Analytics Toolkit Tour
An Analytics Toolkit TourRory Winston
 
5 physical data modeling blunders 09092010
5 physical data modeling blunders 090920105 physical data modeling blunders 09092010
5 physical data modeling blunders 09092010ERwin Modeling
 
Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.Amin Shahnazari
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - IntroductionPiers Warmers
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentLim Chanmann
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependenciesDennis Doomen
 
Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Dennis Doomen
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDDDhaval Dalal
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 
Testing and TDD - KoJUG
Testing and TDD - KoJUGTesting and TDD - KoJUG
Testing and TDD - KoJUGlburdz
 

Similaire à Best Practices - Seeqnce - 23/24-02-2012 (20)

Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)
Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)
Drupal campmanila 2012 (Responsive Web in Drupal with Omega Theme)
 
Test Driven Development - Caleb Tutty
Test Driven Development - Caleb TuttyTest Driven Development - Caleb Tutty
Test Driven Development - Caleb Tutty
 
eXo Software Factory Overview
eXo Software Factory OvervieweXo Software Factory Overview
eXo Software Factory Overview
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CD
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)
 
An Analytics Toolkit Tour
An Analytics Toolkit TourAn Analytics Toolkit Tour
An Analytics Toolkit Tour
 
5 physical data modeling blunders 09092010
5 physical data modeling blunders 090920105 physical data modeling blunders 09092010
5 physical data modeling blunders 09092010
 
Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - Introduction
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Bdd with m spec
Bdd with m specBdd with m spec
Bdd with m spec
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependencies
 
Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDD
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Testing and TDD - KoJUG
Testing and TDD - KoJUGTesting and TDD - KoJUG
Testing and TDD - KoJUG
 

Dernier

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Dernier (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Best Practices - Seeqnce - 23/24-02-2012

  • 1. Best Practices Youssef Chaker February 23-24 2012 Presented by Monday, February 27, 12
  • 2. Day 1 The Why, What and How Monday, February 27, 12
  • 3. but first... Who am I and why should you listen to me? Monday, February 27, 12
  • 6. Developers are not code monkeys Monday, February 27, 12
  • 7. Better relationships with customers and business dev people Monday, February 27, 12
  • 8. Professionalism ...remember that one? Monday, February 27, 12
  • 10. Ariane 5 Flight 501 Flight 501, which took place on June 4, 1996, was the first, and unsuccessful, test flight of the European Ariane 5 expendable launch system. Due to an error in the software design (inadequate protection from integer overflow), the rocket veered off its flight path 37 seconds after launch and was destroyed by its automated self-destruct system when high aerodynamic forces caused the core of the vehicle to disintegrate. It is one of the most infamous computer bugs in history. The breakup caused the loss of four Cluster mission spacecraft, resulting in a loss of more than US$370 million 10 Monday, February 27, 12
  • 11. Therac-25 The Therac-25 was a radiation therapy machine produced by Atomic Energy of Canada Limited (AECL) [...]. It was involved with at least six accidents between 1985 and 1987, in which patients were given massive overdoses of radiation, approximately 100 times the intended dose. Three of the six patients died as a direct consequence. These accidents highlighted the dangers of software control of safety-critical systems, and they have become a standard case study in health informatics and software engineering. [...] A commission has concluded that the primary reason should be attributed to the bad software design and development practices, and not explicitly to several coding errors that were found. In particular, the software was designed so that it was relatively impossible to test it in a clean automated way. Monday, February 27, 12
  • 12. More online: http://en.wikipedia.org/wiki/List_of_software_bugs Monday, February 27, 12
  • 14. what not to do! Monday, February 27, 12
  • 16. Shortcuts Quick & dirty Cutting Corners Monday, February 27, 12
  • 18. A Simple Prayer Lord, please protect our biggest VPS from Eric's installed software - including but not limited to plugins and gems written by 11 year old  Pakistanis. May his apps be well behaved and may they be considerate of CPU and RAM. Lord, if any of these terms are unfamiliar to you, look them up on Wikipedia. Peace be to all other apps and all other VPSs on the same physical server. Amen. Monday, February 27, 12
  • 19. what to do? Monday, February 27, 12
  • 20. What You Already Know • Follow coding standards. • Be consistent. If you do operations in a specific way, do that kind of operations in the same way (e.g. defining variable/method/class names, parenthesis usage etc.). • More code does not mean better code. Keep it simple and reduce complexity. • Catch specific exceptions instead of highest level class 'Exception'. This will provide understandability and more performance. • Use understandable and long names for variables. Loop variable names can be i, j, k, index etc., local variable names must be longer than loop variables, parameter names must be longer than local variables and static variable names must be longer than parameters; proportional with scope size. • Don't use magic numbers and strings directly in the code. Use constants. This method provides more modularity and understandability. • Use understandable comments. Bad comment is worse than no comment. • Method names must include "what is done by this method" information. Monday, February 27, 12
  • 21. Package related classes (that changed together and/or used together) together. • Use positive conditionals. Readability of positive conditionals are better than negative ones. • Use dependency injection to manage too many singletons. • Use exceptions only for catching exceptions, not for control flow. Think as required and perform control flow with control statements/conditionals. • Don't use so many arguments with methods. Keep the number at most 8-10. If more is required, review your design. • Don't use method alternatives with boolean flag variables (public void someMethod(bool flag)). Write more than one method for each flag condition. • Think twice before defining a method as static and be sure if you really need to. Static methods are harder to manage. • Avoid using methods with reference parameters. Use multi attributed object parameters instead. • Number of interface methods must be minimized to decrease coupling/dependency. Monday, February 27, 12
  • 22. What School Did not Teach You • Deliver often, get user feedback in a continuous regular and intense flow • Don't try to be too much smarter than your customer, just enough • Do only whats needed to deliver the functionality expected in each step in the best possible way • Make sure you love and care about your work, code, user and customer Monday, February 27, 12
  • 23. Questions? Comments? Concerns? Monday, February 27, 12
  • 24. “Motivational products don’t work. But our Demotivators® products don’t work even better.” Monday, February 27, 12
  • 25. TDD Test Driven Development Monday, February 27, 12
  • 26. Write Tests Let them fail Monday, February 27, 12
  • 27. Write the minimal code that will make your tests pass Monday, February 27, 12
  • 28. Write More Tests Monday, February 27, 12
  • 29. rinse lather repeat Monday, February 27, 12
  • 31. = TFD Test First Development Monday, February 27, 12
  • 32. TDD = x + TFD any guesses to what x is? Monday, February 27, 12
  • 37. TDD || / less fluff, more stuff Monday, February 27, 12
  • 38. xUnit Frameworks RSpec for more: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks Monday, February 27, 12
  • 41. bash-3.2$ bundle exec rake spec ..................................................................................*..................................................................................................... ....................................................... Pending: GroupVenue add some examples to (or delete) /Users/ychaker/Dev/jogabo/spec/models/ group_venue_spec.rb # No reason given # ./spec/models/group_venue_spec.rb:4 Finished in 3 minutes 43.24 seconds 239 examples, 0 failures, 1 pending ................................................................................................................................................................. ............................................................................. Finished in 3 minutes 49.69 seconds 238 examples, 0 failures Monday, February 27, 12
  • 42. Break 15 minutes Monday, February 27, 12
  • 43. and we’re back... Monday, February 27, 12
  • 44. Question: Why are you writing code? What’s the purpose of your code? Monday, February 27, 12
  • 45. Answer: solve Business problems produce a certain Behavior Monday, February 27, 12
  • 46. Then maybe we should do Behavior Driven Development! Monday, February 27, 12
  • 49. Disclaimer: The RSpec example was actually a BDD example Monday, February 27, 12
  • 56. Continuous Integration (CI) Monday, February 27, 12
  • 60. standup, stretch your legs Monday, February 27, 12
  • 61. if there’s anything I want you to take away from today is this last part Monday, February 27, 12
  • 62. Client-server model (examples) • Concurrent Versions System (CVS) • Subversion (svn) Monday, February 27, 12
  • 63. Distributed model (examples) • Fossil • git • Mercurial Monday, February 27, 12
  • 64. delete, don’t comment out Monday, February 27, 12
  • 65. Always use source control system even if the project has only one developer Monday, February 27, 12
  • 67. Questions? Comments? Concerns? Monday, February 27, 12
  • 69. Day 2 Go Beyond Monday, February 27, 12
  • 71. Be Agile, Be Happy Monday, February 27, 12
  • 72. Agile Manifesto We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: Individuals and interactions over processes & tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more. Monday, February 27, 12
  • 73. Let’s go closer Monday, February 27, 12
  • 74. Agile Modeling Agile Unified Process (AUP) Dynamic Systems Development Method (DSDM) Essential Unified Process (EssUP) Extreme Programming (XP) Feature Driven Development (FDD) Open Unified Process (OpenUP) Scrum Velocity tracking Monday, February 27, 12
  • 77. iterative, incremental framework for project management and agile software development. Monday, February 27, 12
  • 79. 2-4 week sprints Monday, February 27, 12
  • 80. “ScrumMaster”, who maintains the processes (typically in lieu of a project manager) Monday, February 27, 12
  • 81. “Product Owner”, who represents the stakeholders, represents the business Monday, February 27, 12
  • 82. “Team”, a cross- functional group of about 7 people who do the actual analysis, design, implementation, testing, etc. Monday, February 27, 12
  • 83. Pigs & Chickens A pig and a chicken are walking down a road. The chicken looks at the pig and says, “Hey, why don’t we open a restaurant?” The pig looks back at the chicken and says, “Good idea, what do you want to call it?” The chicken thinks about it and says, “Why don’t we call it ‘Ham and Eggs’?” “I don’t think so,” says the pig, “I’d be committed, but you’d only be involved.” Monday, February 27, 12
  • 84. Key Notions • (Sprint) Planning • Backlog* • (Sprint) Burn down • Daily Standups • + more... *Backlog: Product/Sprint backlog or any list of tasks Monday, February 27, 12
  • 85. Scrum for Kids Monday, February 27, 12
  • 86. YES! I’m serious Monday, February 27, 12
  • 88. Introducing the Scrum Board Monday, February 27, 12
  • 90. The Board (again) Monday, February 27, 12
  • 91. The Toyota way Monday, February 27, 12
  • 92. The Right Process Will Produce the Right Results 1. Create continuous process flow to bring problems to the surface. 2. Use the "pull" system to avoid overproduction. 3. Level out the workload (heijunka). (Work like the tortoise, not the hare.) 4. Build a culture of stopping to fix problems, to get quality right from the [start]. 5. Standardized tasks are the foundation for continuous improvement and employee empowerment. 6. Use visual control so no problems are hidden. 7. Use only reliable, thoroughly tested technology that serves your people and processes. Monday, February 27, 12
  • 93. Add Value to the Organization by Developing Your People and Partners 1. Grow leaders who thoroughly understand the work, live the philosophy, and teach it to others. 2. Develop exceptional people and teams who follow your company's philosophy. 3. Respect your extended network of partners and suppliers by challenging them and helping them improve. Monday, February 27, 12
  • 94. Continuously Solving Root Problems Drives Organizational Learning 1. Go and see for yourself to thoroughly understand the situation (Genchi Genbutsu, 現地現物); 2. Make decisions slowly by consensus, thoroughly considering all options (Nemawashi, 根回し); implement decisions rapidly; 3. Become a learning organization through relentless reflection (Hansei, 反省) and continuous improvement (Kaizen, 改善). Monday, February 27, 12
  • 95. Break 15 minutes Monday, February 27, 12
  • 96. and we’re back... Monday, February 27, 12
  • 99. Sprint Planning + Scrum Poker Monday, February 27, 12
  • 100. Daily Standups Short: less than 15 minutes What did I do yesterday? What am I doing today? What are my obstacles? Monday, February 27, 12
  • 101. Stay Flexible Stay Lean Monday, February 27, 12
  • 107. Questions? Comments? Concerns? Monday, February 27, 12
  • 111. You have now learnt the basic of software craftsmanship Monday, February 27, 12
  • 112. References • Fowler, Martin. The New Methodology: http://martinfowler.com/articles/newMethodology.html • Wikipedia. Agile Software Development: http://en.wikipedia.org/wiki/Agile_software_development • Manifesto for Agile Software Development: http://agilemanifesto.org/ • Wikipedia. Scrum (development): http://en.wikipedia.org/wiki/Scrum_(development) • Wikipedia. Ariane 5 Flight 501: http://en.wikipedia.org/wiki/Ariane_5_Flight_501 • Ariane 5 Failure, Full Report: http://sunnyday.mit.edu/accidents/Ariane5accidentreport.html • Wikipedia. Tehrac-25: http://en.wikipedia.org/wiki/Therac-25 • Wikipedia. List of software bugs: http://en.wikipedia.org/wiki/List_of_software_bugs • Rails Maturity Models: http://railsmaturitymodels.com/practices • Scrum For Kids http://scrumforkids.com/ • Toyota Production System http://en.wikipedia.org/wiki/Toyota_Production_System • The Toyota Way http://en.wikipedia.org/wiki/The_Toyota_Way • Manifesto for Software Craftsmanship http://manifesto.softwarecraftsmanship.org/ • The Lean Startup http://theleanstartup.com/ • Cucumber-Rails https://github.com/cucumber/cucumber-rails • Gherkin https://github.com/cucumber/cucumber/wiki/Gherkin Monday, February 27, 12
  • 113. Contact @ychaker http://youhoo.im http://linked.com/in/ychaker Monday, February 27, 12