Agile Technical Practices Distilled

Book description

Delve deep into the various technical practices, principles, and values of Agile.

Key Features

  • Discover the essence of Agile software development and the key principles of software design
  • Explore the fundamental practices of Agile working, including test-driven development (TDD), refactoring, pair programming, and continuous integration
  • Learn and apply the four elements of simple design

Book Description

The number of popular technical practices has grown exponentially in the last few years. Learning the common fundamental software development practices can help you become a better programmer. This book uses the term Agile as a wide umbrella and covers Agile principles and practices, as well as most methodologies associated with it.

You'll begin by discovering how driver-navigator, chess clock, and other techniques used in the pair programming approach introduce discipline while writing code. You'll then learn to safely change the design of your code using refactoring. While learning these techniques, you'll also explore various best practices to write efficient tests. The concluding chapters of the book delve deep into the SOLID principles - the five design principles that you can use to make your software more understandable, flexible and maintainable.

By the end of the book, you will have discovered new ideas for improving your software design skills, the relationship within your team, and the way your business works.

What you will learn

  • Learn the red, green, refactor cycle of classic TDD and practice the best habits such as the rule of 3, triangulation, object calisthenics, and more
  • Refactor using parallel change and improve legacy code with characterization tests, approval tests, and Golden Master
  • Use code smells as feedback to improve your design
  • Learn the double cycle of ATDD and the outside-in mindset using mocks and stubs correctly in your tests
  • Understand how Coupling, Cohesion, Connascence, SOLID principles, and code smells are all related
  • Improve the understanding of your business domain using BDD and other principles for "doing the right thing, not only the thing right"

Who this book is for

This book is designed for software developers looking to improve their technical practices. Software coaches may also find it helpful as a teaching reference manual. This is not a beginner's book on how to program. You must be comfortable with at least one programming language and must be able to write unit tests using any unit testing framework.

Table of contents

  1. Preface
    1. About the Book
      1. About the Authors
      2. Learning Objectives
      3. Approach
      4. Audience
    2. Acknowledgements
      1. Pedro
      2. Marco
      3. Alessandro
      4. Conventions
    3. Agile Technical Practices
      1. Is This Book for Me?
      2. Why We Wrote This Book?
      3. Why Distilled?
      4. What are Agile Technical Practices?
      5. Pair Programming
      6. Test-Driven Development TDD
      7. Design Improvements/Refactoring
      8. Simple Design
      9. Beyond Design
    4. Rules, Principles, and Values
      1. How Rules Can Lead to Intellectual Laziness
      2. Use Rules as a Shortcut to Internalize Principles
      3. How This Book Is Organized
      4. How to Get the Most out of This Book
      5. Asking for Help or Feedback
      6. Helping Others
      7. Feedback about This Book
      8. Resources
  2. Section 1
  3. First Steps
  4. Chapter 1
  5. Pair Programming
    1. What is Pair Programming?
    2. Roles
    3. Driver/Navigator Switch Techniques
      1. Chess Clock
      2. Ping Pong/Popcorn
    4. Breaks
      1. Pomodoro
    5. Katas
    6. When Should I Move to the Next Lesson?
    7. Resources
      1. Web
  6. Chapter 2
  7. Classic TDD I – Test-Driven Development
    1. Classic TDD
    2. The Three Laws of TDD
      1. 1. You Are Not Allowed to Write Any More of a Unit Test That Is Sufficient to Fail, and Compilation Failures Are Failures
      2. 2. You Are Not Allowed to Write Any Production Code Unless It Is to Make a Failing Unit Test Pass
      3. 3. You Are Not Allowed to Write Any More Production Code That Is Sufficient to Pass the One Failing Unit Test
    3. Refactoring and the Rule of Three – Baby Steps
    4. Three Methods of Moving Forward in TDD
      1. From Red to Green
    5. Degrees of Freedom
    6. Naming Tests
    7. A Test Name Pattern
    8. Katas
      1. Fizz Buzz by cyber-dojo
      2. Fizz Buzz Kata Summary
    9. More Katas
      1. Leap Year by cyber-dojo
      2. Nth Fibonacci by cyber-dojo
    10. Great Habits
      1. Considerations when Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations After the Test Passes
    11. Classic TDD Flow
    12. Where are We in the Big Picture of Object-Oriented (OO) Software Design?
    13. When Should I Move to the Next Lesson?
    14. Resources
      1. Web
      2. Books
  8. Chapter 3
  9. Classic TDD II
    1. Writing the Assertion First and Working Backward
    2. Organizing Your Test in Arrange, Act, and Assert Blocks
      1. Benefits of Organizing Tests in Arrange, Act, and Assert Blocks
    3. Unit Test Principles
    4. Katas
      1. Stats Calculator by cyber-dojo
      2. Anagrams by cyber-dojo
    5. Great Habits
      1. Considerations when Writing a New Test
      2. Considerations when Making a Failing Test Pass
      3. Considerations after the Test Passes
    6. Classic TDD Flow
    7. Where are we in the Big Picture of Object-Oriented (OO) Software Design?
    8. When Should I Move to the Next Lesson?
    9. Resources
      1. Web
      2. Books
  10. Chapter 4
  11. Classic TDD III – Transformation Priority Premise
    1. Kata
      1. Roman Numerals by cyber-dojo
    2. TPP – Defining Obvious Implementation
      1. TPP Table
      2. The Transformations
      3. Transformation 1 – {} -> Nil
      4. Transformation 2 – Nil -> Constant
      5. Transformation 3 – Constant -> Constant+
      6. Transformation 4 – Constant -> Scalar
      7. Transformation 5 – Statement -> Statements
      8. Transformation 6 – Unconditional -> Conditional
      9. Transformation 7 – Scalar -> Array
      10. Transformation 8 – Array -> Container
      11. Transformation 9 – Statement -> Tail Recursion
      12. Transformation 10 – If -> Loop
      13. Transformation 11 – Statement -> Recursion
      14. Transformation 12 – Expression -> Function
      15. Transformation 13 – Variable -> Mutation
      16. Example Using the TPP on the Fibonacci Sequence
    3. Katas
      1. Roman Numerals by cyber-dojo
      2. Prime Factors by cyber-dojo
      3. Boolean Calculator by Alessandro Di Gioia
    4. Great Habits
      1. Considerations when Writing a New Test
      2. Considerations when Making a Failing Test Pass
      3. Considerations after the Test Passes
    5. Classic TDD flow
    6. Where are We in the Big Picture of Object-Oriented (OO) Software Design?
    7. When Should I Move to the Next Lesson?
    8. Resources
      1. Web
  12. Chapter 5
  13. Design 1 – Object Calisthenics
    1. It's the Design...
    2. Kata
      1. Tic-Tac-Toe
    3. Object Calisthenics – 10 Steps to Better Software Design
      1. Only One Level of Indentation per Method
      2. Don't Use the ELSE Keyword
      3. Wrap All Primitives and Strings
      4. First-Class Collections
      5. No Getters/Setters/Properties
      6. Wrap All Primitives and Strings
      7. One Dot per Line
      8. Don't Abbreviate
      9. Keep All Entities Small
      10. No Classes with More Than Two Instance Variables
      11. All Classes Must Have State
    4. Heuristics
    5. Katas
      1. Tic-Tac-Toe
      2. Game of Life
    6. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations after the Test Passes
    7. Classic TDD flow
    8. Where Are We in the Big Picture of OO Software Design?
    9. When Should I Move on to the Next Lesson?
    10. Resources
      1. Web
  14. Section 2
  15. Walking
  16. Chapter 6
  17. Design 2 – Refactoring
    1. When to Refactor (For Now)
    2. Main Refactors
    3. IDE Agility (Know Your Shortcuts)
    4. Kata
      1. Refactoring Golf
    5. Refactor 80-20 Rule
    6. Refactoring Guidelines
      1. Stay in the Green While Refactoring
      2. Commit as Often as Possible
      3. Refactor Readability before Design
      4. Change Design (Simple Changes)
    7. Kata
      1. Tennis Refactoring by Emily Bache
    8. Parallel Change (Or Expand, Migrate, and Contract)
      1. Expand
      2. Migrate
      3. Contract
    9. Kata
      1. Parallel Change Kata by Pawel Duda and Carlos Blé
    10. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations after the Test Passes
    11. When Should I Move on to the Next Lesson?
    12. Resources
      1. Web
      2. Books
  18. Chapter 7
  19. Design 3 – Code Smells
    1. Design Smells
    2. Code Smells
      1. Bloaters
      2. Couplers
      3. Object-Orientation Abusers
      4. Change Preventers
      5. Dispensables
    3. Highlighted Code Smells
      1. Code Smells Hierarchy
      2. Primitive Obsession
      3. Feature Envy
      4. Message Chains
    4. Object Calisthenics Preventing Code Smells
    5. When to Refactor (Extended for Code Smells)
    6. Refactor Code Smells
    7. Kata
      1. Smelly Tic-Tac-Toe
    8. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations After the Test Passes
    9. Classic TDD Flow
    10. The Big Picture
    11. When Should I Move on to the Next Lesson?
    12. Resources
      1. Web
      2. Books
  20. Chapter 8
  21. Test Doubles
    1. Principles
      1. Command-Query Separation
      2. Queries
      3. Commands
    2. Different Types of Test Doubles
      1. Dummy Objects
      2. Stubs
      3. Fake Objects
      4. Mocks
      5. Spies
    3. Test Doubles Guidelines
      1. Only Use Test Doubles for Classes That You Own
      2. Verify as Little as Possible in a Test
      3. Don't Use Test Doubles for Isolated Objects
      4. Don't Add Behavior in Test Doubles
      5. Only Use Test Doubles for Your Immediate Neighbors
      6. Too Many Test Doubles
      7. CQS Principle Trade-OffS
    4. Katas
      1. Character Copier by Urs Enzler
      2. Instrument Processor by Urs Enzler
    5. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations after the Test Passes
    6. When Should I Move on to the Next Lesson?
    7. Resources
      1. Web
      2. Books
  22. Chapter 9
  23. Testing Legacy Code
    1. Breaking Dependencies Using a Seam
      1. Using Inheritance to Decouple Production Code
    2. Characterization Tests
    3. Kata
      1. Characterization Tests on Gilded Rose Kata by Emily Bache
    4. Golden Master
      1. Feasibility
      2. Generate Input/Output (Golden Master)
      3. Assert
    5. Kata
      1. Golden Master on Gilded Rose Kata by Emily Bache
    6. Approval Tests by Llewellyn Falco
      1. Combination Tests
    7. Revisiting the Refactoring Guidelines
      1. Stay in the Green while Refactoring
    8. Kata
      1. Gilded Rose Refactoring Kata by Emily Bache
    9. Conclusions
      1. Guideline Questions
    10. Great Habits
      1. Considerations when Writing a New Test
      2. Considerations when Making a Failing Test Pass
      3. Considerations after the Test Passes
    11. When Should I Move to the Next Lesson?
    12. Resources
      1. Web
      2. Books
  24. Chapter 10
  25. Design IV –Design Patterns
    1. Design Pattern Advantages
    2. Design Pattern Pitfalls
    3. A Quick Reference Catalogue
      1. Creational Design Patterns
      2. Behavioral Design Patterns
      3. Structural Design Patterns
    4. Revisiting the Refactoring Guidelines
      1. Refactoring Design
    5. Kata
      1. Refactoring Game of Life Kata to Patterns
    6. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations After the Test Passes
    7. When Should I Move to the Next Lesson?
    8. Resources
      1. Web
      2. Books
  26. Section 3
  27. Running
  28. Chapter 11
  29. Design V – Cohesion and Coupling
    1. Coupling
      1. Types of Coupling
      2. Interaction Coupling
      3. Law of Demeter
      4. Method Coupling Premises
      5. Inheritance Coupling
    2. Cohesion
      1. Other Indicators of Possible Low Cohesion in Design
      2. Types of Cohesion
      3. Class Cohesion
      4. Method Cohesion
    3. Katas
      1. Connecting Code Smells with Cohesion/Coupling
      2. Connecting Object Calisthenics with Code Smells and Cohesion/Coupling
    4. When to Refactor (Extended for Cohesion/Coupling)
    5. Classic TDD Flow
    6. The Big Picture
    7. When Should I Move to the Next Lesson?
    8. Resources
      1. Web
      2. Books
  30. Chapter 12
  31. Design VI – Solid Principles ++
    1. Single Responsibility Principle
    2. Open/Closed Principle
    3. Liskov Substitution Principle
    4. Interface Segregation Principle
    5. Dependency Inversion Principle
    6. Balanced Abstraction Principle
    7. Principle of Least Astonishment
    8. Kata
      1. Connecting Cohesion/Coupling and SOLID principles
    9. When to Refactor (Extended for SOLID Principles)
    10. Classic TDD Flow
    11. The Big Picture
    12. When Should I Move to the Next Lesson?
    13. Resources
      1. Web
      2. Books
  32. Chapter 13
  33. Design VII – Connascence
    1. Definition
    2. Dimensions
      1. Degree
      2. Locality
      3. Strength
    3. Connascence of Name and Type (CoN and CoT)
    4. Connascence of Position
    5. Connascence of Value (CoV)
    6. Connascence of Meaning
    7. Connascence of Algorithm
    8. Connascence of Execution Order
    9. Connascence of Timing
    10. Connascence of Identity
    11. Connascence of Manual Task
    12. Classic TDD Flow
    13. The Big Picture
    14. When Should I Move to the Next Lesson?
    15. Resources
      1. Web
      2. Books
  34. Chapter 14
  35. Design VIII –The Four Elements of Simple Design
    1. What Are the Four Elements of Simple Design?
    2. What Does Each Element Mean?
      1. Passes Its Tests
      2. Minimizes Duplication
      3. Maximizes Clarity
      4. Has Fewer Elements
    3. Alternative Definitions of Simple Design
      1. Definition #1
      2. Definition #2
      3. Definition #3
      4. Definition #4
      5. Definition #5
      6. Definition #6
    4. Our Personal Definitions of Simple Design
      1. Pedro
      2. Marco
      3. Alessandro
    5. Kata
      1. Elevator Kata by Marco Consolaro
    6. Classic TDD Flow
    7. The Big Picture
    8. When Should I Move to the Next Lesson?
    9. Resources
      1. Web
      2. Books
  36. Chapter 15
  37. Conclusion
    1. Cohesion and Coupling as Forces
    2. The 3 Cs of Design: From Cohesion and Coupling to Connascence
    3. Systems Entropy
      1. The Relevance of Systems Entropy
      2. Software Development as System Building
      3. Good Design as a Low-Entropy System
    4. The Big Picture
    5. Resources
      1. Web-based resources:
      2. Books:
  38. Section 4
  39. Flying
  40. Chapter 16
  41. Outside-In Development
    1. The Classic TDD Approach
    2. Acceptance Tests
      1. Acceptance Test Styles
    3. Test Boundaries
    4. Double Loop TDD
    5. The Outside-In Approach
      1. An Outside-In Mindset
    6. Outside-In TDD: The London School
      1. Example
    7. The Direction of Dependencies
    8. Should I Use Classic TDD or Outside-In TDD?
    9. Kata
      1. Stock Portfolio
      2. Katacombs of Shoreditch by Marco Consolaro
      3. Part I
      4. PART II
    10. The Big Picture
    11. Great Habits
      1. Considerations When Writing a New Test
      2. Considerations When Making a Failing Test Pass
      3. Considerations After the Test Has Passed
    12. Resources
      1. Web-based resources:
      2. Books:
  42. Chapter 17
  43. Behavior-Driven Development
    1. Poka-Yoke
    2. Mistakes versus Defects: Feedback Is the Cure (Again)
    3. Bugs and Communication
      1. User Stories
    4. Behavior-Driven Development
      1. The Structure of a Story
      2. Acceptance Criteria: It's All about the Examples
      3. From Criteria to Acceptance Tests
    5. Acceptance Tests Done Right
      1. Readable by Business Folks
      2. Feature Complete
      3. Fast
    6. Boundaries
    7. The Walking Skeleton
    8. Kata
      1. The Messy Delivery Office Requirements
    9. Resources
      1. Web-based resources
      2. Books
  44. Chapter 18
  45. Understand the Business
    1. Knowledge versus Understanding
    2. Theory of Constraints
    3. Domain-Driven Design: What Domain?
    4. Beyond Requirements: Knowledge Crunching
      1. 5 Whys
      2. Impact Mapping
      3. PopcornFlow
      4. User Story Mapping
      5. EventStorming
      6. Business Model Canvas
    5. Value Streams and Domain Events
    6. Bounded Contexts and Communication
      1. Synchronous versus Asynchronous
      2. Command-Query Separation
    7. Business and DevOps
      1. The First Way
      2. The Second Way
      3. The Third Way
    8. Systems Thinking and Sociotechnical Organizations
    9. Resources
      1. Web-based resources
      2. Books
  46. Chapter 19
  47. Story of Team C
    1. Terraforming
    2. Team Building
    3. The Backlog: Crunching Knowledge for Breakfast
    4. Cracking On
    5. From Forming to Performing
    6. Outside-In ATDD with Optional Unit Tests
    7. The Green Flag
    8. The Moral of the Story
  48. Chapter 20
  49. Conclusion
    1. The Human Factor
    2. Team Play
    3. Bounded Rationality and Knowledge Sharing
    4. Resources
      1. Web
      2. Books
  50. Chapter 21
  51. The 12 Agile Principles
  52. Chapter 22
  53. PopcornFlow by Claudio Perrone
    1. The 7-Steps Decision Cycle
    2. The Principles
    3. Who Can Benefit from PopcornFlow
    4. Resources
      1. Web-based resources:
      2. Books:
  54. Chapter 23
  55. EventStorming by Alberto Brandolini
    1. Silos and Value Streams
    2. The Importance of Learning
    3. The EventStorming Approach
    4. The Workshop: A Quick Overview
    5. Different Flavors of EventStorming
    6. Complex Systems and Proven Solutions
    7. Resources
      1. Web
      2. Books
  56. License: CyberDojo
    1. About CyberDojo Foundation Exercises
      1. Web Resources
  57. Sample Solutions
    1. Sample Solutions: FizzBuzz in Clojure
      1. Sample Solutions: Fibonacci Sequence in C++
      2. Sample Solutions: Roman Numerals in C#
      3. Sample Solutions: Tic-Tac-Toe in Swift (Partial Solution)
      4. Sample Solutions: Connecting Code Smells with Cohesion/Coupling
      5. Sample Solutions: Connecting Object Calisthenics with Code Smells and Cohesion/Coupling
      6. Sample Solutions: Connecting Cohesion/Coupling and SOLID Principles
  58. Feedback
    1. Personalized Coaching
      1. Individuals
      2. Organizations
    2. Feedback Please

Product information

  • Title: Agile Technical Practices Distilled
  • Author(s): Pedro M. Santos, Marco Consolaro, Alessandro Di Gioia
  • Release date: June 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781838980849