Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Software Gardening

Software Gardening

Developing software is not like constructing a building. Software is more organic and should be treated as a garden. This presentation takes several gardening concepts and applies them to software development.

Craig Berntson

July 17, 2018
Tweet

More Decks by Craig Berntson

Other Decks in Programming

Transcript

  1. Today’s Agenda The problem of the definition Three basic needs

    Getting our hands dirty Caring for our garden Harvesting Using the right tools
  2. Rather than construction, software is more like gardening – it

    is more organic than concrete. - Pragmatic Programmer
  3. ▪ Having an organization similar in its complexity to that

    of living things ▪ Characterized by the systematic arrangement of parts; organized; systematic ▪ Developing in a manner analogous to the natural growth and evolution characteristic of living organisms; arising as a natural outgrowth - Dictionary.com
  4. OOP Principles Basic OOP Inheritance Polymorphism Encapsulation Loose coupling Tight

    cohesion DRY YAGNI SOLID OOP Single Responsibility Open/Closed Liskov Substitution Interface Segregation Dependency Inversion
  5. In 1976, G.J. Meyers described a 100-line program that had

    1018 unique paths. In 1979 he described a much simpler program. It was just a loop and a few if statements. In most languages, you could write it in 20 lines of code. This program has 100 trillion paths. – Testing Computer Software, Cem Kaner
  6. Refactoring It is not rewriting It is reorganizing without changing

    behavior Improves maintainability and extensibility
  7. Smells are certain structures in the code that indicate violation

    of fundamental design principles and negatively impact design quality. - Martin Fowler
  8. Application-level Smells • Duplicated code • Contrived complexity Class-level Smells

    • Large class • Cyclomatic complexity • Excessive use of literals Method-level smells • Too many parameters • Too many optional parameters or nulls • Long method
  9. “When and Why Your Code Starts to Smell Bad” 2015

    – College of William and Mary 1. Most of the time, smells are introduced when code is originally written 2. Maintenance and evolution smells are characterized by peculiar metrics trends 3. Refactoring itself can introduce new smells 4. Developers with high workloads and release pressure are more likely to introduce smells http://www.cs.wm.edu/~denys/pubs/ICSE'15-BadSmells-CRC.pdf
  10. Create Patterns • Factory • Singleton Structural Patterns • Adapter

    • Facade • Decorator Behavioral Patterns • Chain of Responsibility • Strategy • Template
  11. Continuous Integration Build and test code with every commit Fail

    fast / Learn early Reduce risk Increase quality Enable better project visibility Reduce repetitive or manual processes
  12. Development Tools • Visual Studio • VS Code • .NET

    Framework • .NET Core Other Tools • Fiddler • LinqPad • Database • Pluralsight • VS Add-ons • VS Extensions Technologies • Restful Web Services • Microservices
  13. Agile Software craftsmanship Professional development SOLID Unit testing Refactoring Design

    patterns Version control Continuous Integration Software delivery pipeline Tools