Agile Technical Practices Distilled - Pedro M. Santos - E-Book

Agile Technical Practices Distilled E-Book

Pedro M. Santos

0,0
26,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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

  • Apply the red, green, refactor cycle of TDD to solve procedural problems
  • Implement the various techniques used in the pair programming approach
  • Use code smells as feedback
  • Test your production code using mocks and stubs
  • Refactor legacy code to bring it in line with modern Agile standards
  • Apply the object calisthenics ruleset to enhance your software design

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.

Pedro M. Santos has over 25 years of experience in the software industry. He has worked in the finance, aviation, consultancy, media, and retail industries and has built a wide range of software, ranging from embedded systems to cloud-based distributed applications. He has lived in Portugal (Lisbon), Brazil (São Paulo), Spain (Madrid, Barcelona), Netherlands (Hilversum), and Belgium (Gent), and, currently, he is based in the UK (London), where he focuses on educating and inspiring other developers. He has spent hundreds of hours in pairing sessions as well as coaching and mentoring developers at all levels of proficiency. His tutoring experience covers almost every aspect of software development: programming basics, object-oriented and functional design principles, refactoring legacy applications, pragmatic testing practices, architectural decisions, and career development choices. Follow Pedro on Twitter at @pedromsantos. Marco Consolaro is a software craftsman, systems thinker, agile technical coach, entrepreneur, philosopher, and restless traveler – all blended with Venetian humor. Marco learned to code in Basic on a Commodore when he was 9 years old. He graduated from Venice University in 2001 with a degree in Computer Science. Since then, Marco has worked in Italy and the UK and is always looking to learn something new. When his journey led him to the agile principles, he quickly realized the effectiveness of such an approach for both technical and organizational areas. He now strongly believes that an iterative approach based on trust, transparency, self-organization, and quick feedback loops is the key to success for any team in any discipline. His dream is to see these principles based on systems thinking understood and implemented at every level in businesses and public administrations. Follow Marco on Twitter at @consolondon. Alessandro Di Gioia has helped a variety of companies (from small startups to large enterprises for the past 18 years) embrace agile technical practices. He has worked in Italy and Norway. For the past few years, he has resided in London. His professional life changed when he came across agile methodologies, especially Extreme Programming. He likes concise, expressive, and readable code as well as making existing solutions better when needed. He is always trying to learn better ways of designing asynchronous distributed architectures and crafting software, in either an object-oriented or functional style. Although Alessandro considers himself a forever learner, he is also a coach and a mentor because he loves to share his experiences with others. Follow Alessandro on Twitter at @Parajao.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 372

Veröffentlichungsjahr: 2019

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Agile Technical Practices Distilled

Become agile and efficient by mastering software design

Pedro M. Santos

Marco Consolaro

Alessandro Di Gioia

Agile Technical Practices Distilled

Copyright © 2019 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Authors: Pedro M. Santos, Marco Consolaro, and Alessandro Di Gioia

Course Managing Editor: Vishal Kamal Mewada

Acquisitions Editor: Bridget Neale

Production Editor: Shantanu Zagade

Editorial Board: David Barnes, Mayank Bhardwaj, Ewan Buckingham, Simon Cox, Mahesh Dhyani, Taabish Khan, Manasa Kumar, Alex Mazonowicz, Douglas Paterson, Dominic Pereira, Shiny Poojary, Erol Staveley, Ankita Thakur, and Jonathan Wray

First Published: June 2019

Production Reference: 1280619

ISBN: 978-1-83898-084-9

Published by Packt Publishing Ltd.

Livery Place, 35 Livery Street

Birmingham B3 2PB, UK

Table of Contents

Preface   i

Section 1: First Steps   1

Chapter 1: Pair Programming   3

What is Pair Programming?   4

Roles   5

Driver/Navigator Switch Techniques   5

Chess Clock   5

Ping Pong/Popcorn   5

Breaks   7

Pomodoro   7

Katas   8

When Should I Move to the Next Lesson?   8

Resources   8

Web   8

Chapter 2: Classic TDD I – Test-Driven Development   11

Classic TDD   12

The Three Laws of TDD   12

1. You Are Not Allowed to Write Any More of a Unit Test That Is Sufficient to Fail, and Compilation Failures Are Failures   13

2. You Are Not Allowed to Write Any Production Code Unless It Is to Make a Failing Unit Test Pass   13

3. You Are Not Allowed to Write Any More Production Code That Is Sufficient to Pass the One Failing Unit Test   13

Refactoring and the Rule of Three – Baby Steps   14

Three Methods of Moving Forward in TDD   15

From Red to Green   15

Degrees of Freedom   15

Naming Tests   16

A Test Name Pattern   17

Katas   18

Fizz Buzz by cyber-dojo   18

Fizz Buzz Kata Summary   20

More Katas   20

Leap Year by cyber-dojo   20

Nth Fibonacci by cyber-dojo   21

Great Habits   21

Considerations when Writing a New Test   21

Considerations When Making a Failing Test Pass   22

Considerations After the Test Passes   22

Classic TDD Flow   22

Where are We in the Big Picture of Object-Oriented (OO) Software Design?   24

When Should I Move to the Next Lesson?   24

Resources   25

Web   25

Books   25

Chapter 3: Classic TDD II   27

Writing the Assertion First and Working Backward   27

Organizing Your Test in Arrange, Act, and Assert Blocks   28

Benefits of Organizing Tests in Arrange, Act, and Assert Blocks   29

Unit Test Principles   29

Katas   30

Stats Calculator by cyber-dojo   30

Anagrams by cyber-dojo   30

Great Habits   31

Considerations when Writing a New Test   31

Considerations when Making a Failing Test Pass   32

Considerations after the Test Passes   32

Classic TDD Flow   33

Where are we in the Big Picture of Object-Oriented (OO) Software Design?   34

When Should I Move to the Next Lesson?   35

Resources   35

Web   35

Books   35

Chapter 4: Classic TDD III – Transformation Priority Premise   37

Kata   38

Roman Numerals by cyber-dojo   38

TPP – Defining Obvious Implementation   39

TPP Table   40

The Transformations   41

Transformation 1 – {} -> Nil   41

Transformation 2 – Nil -> Constant   41

Transformation 3 – Constant -> Constant+   41

Transformation 4 – Constant -> Scalar   41

Transformation 5 – Statement -> Statements   41

Transformation 6 – Unconditional -> Conditional   41

Transformation 7 – Scalar -> Array   42

Transformation 8 – Array -> Container   42

Transformation 9 – Statement -> Tail Recursion   42

Transformation 10 – If -> Loop   42

Transformation 11 – Statement -> Recursion   42

Transformation 12 – Expression -> Function   42

Transformation 13 – Variable -> Mutation   43

Example Using the TPP on the Fibonacci Sequence   43

Katas   44

Roman Numerals by cyber-dojo   44

Prime Factors by cyber-dojo   44

Boolean Calculator by Alessandro Di Gioia   45

Great Habits   47

Considerations when Writing a New Test   47

Considerations when Making a Failing Test Pass   47

Considerations after the Test Passes   47

Classic TDD flow   48

Where are We in the Big Picture of Object-Oriented (OO) Software Design?   49

When Should I Move to the Next Lesson?   50

Resources   50

Web   50

Chapter 5: Design 1 – Object Calisthenics   53

It's the Design...   54

Kata   54

Tic-Tac-Toe   54

Object Calisthenics – 10 Steps to Better Software Design   55

Only One Level of Indentation per Method   56

Don't Use the ELSE Keyword   56

Wrap All Primitives and Strings   56

First-Class Collections   57

No Getters/Setters/Properties   58

Wrap All Primitives and Strings   60

One Dot per Line   61

Don't Abbreviate   61

Keep All Entities Small   61

No Classes with More Than Two Instance Variables   62

All Classes Must Have State   62

Heuristics   62

Katas   63

Tic-Tac-Toe   63

Game of Life   63

Great Habits   64

Considerations When Writing a New Test   64

Considerations When Making a Failing Test Pass   64

Considerations after the Test Passes   64

Classic TDD flow   65

Where Are We in the Big Picture of OO Software Design?   66

When Should I Move on to the Next Lesson?   67

Resources   67

Web   67

Section2: Walking   69

Chapter 6: Design 2 – Refactoring   71

When to Refactor (For Now)   72

Main Refactors   72

IDE Agility (Know Your Shortcuts)   73

Kata   73

Refactoring Golf   73

Refactor 80-20 Rule   74

Refactoring Guidelines   75

Stay in the Green While Refactoring   75

Commit as Often as Possible   76

Refactor Readability before Design   76

Change Design (Simple Changes)   80

Kata   81

Tennis Refactoring by Emily Bache   81

Parallel Change (Or Expand, Migrate, and Contract)   82

Expand   82

Migrate   82

Contract   82

Kata   82

Parallel Change Kata by Pawel Duda and Carlos Blé   82

Great Habits   82

Considerations When Writing a New Test   83

Considerations When Making a Failing Test Pass   83

Considerations after the Test Passes   83

When Should I Move on to the Next Lesson?   84

Resources   84

Web   84

Books   84

Chapter 7: Design 3 – Code Smells   87

Design Smells   88

Code Smells   89

Bloaters   89

Couplers   90

Object-Orientation Abusers   90

Change Preventers   91

Dispensables   91

Highlighted Code Smells   92

Code Smells Hierarchy   92

Primitive Obsession   93

Feature Envy   93

Message Chains   94

Object Calisthenics Preventing Code Smells   95

When to Refactor (Extended for Code Smells)   96

Refactor Code Smells   96

Kata   98

Smelly Tic-Tac-Toe   98

Great Habits   98

Considerations When Writing a New Test   99

Considerations When Making a Failing Test Pass   99

Considerations After the Test Passes   99

Classic TDD Flow   100

The Big Picture   101

When Should I Move on to the Next Lesson?   102

Resources   102

Web   102

Books   102

Chapter 8: Test Doubles   105

Principles   106

Command-Query Separation   106

Queries   107

Commands   108

Different Types of Test Doubles   108

Dummy Objects   108

Stubs   108

Fake Objects   109

Mocks   109

Spies   109

Test Doubles Guidelines   109

Only Use Test Doubles for Classes That You Own   109

Verify as Little as Possible in a Test   110

Don't Use Test Doubles for Isolated Objects   111

Don't Add Behavior in Test Doubles   111

Only Use Test Doubles for Your Immediate Neighbors   113

Too Many Test Doubles   114

CQS Principle Trade-OffS   114

Katas   115

Character Copier by Urs Enzler   115

Instrument Processor by Urs Enzler   116

Great Habits   118

Considerations When Writing a New Test   118

Considerations When Making a Failing Test Pass   119

Considerations after the Test Passes   119

When Should I Move on to the Next Lesson?   119

Resources   120

Web   120

Books   120

Chapter 9: Testing Legacy Code   123

Breaking Dependencies Using a Seam   124

Using Inheritance to Decouple Production Code   124

Characterization Tests   126

Kata   126

Characterization Tests on Gilded Rose Kata by Emily Bache   126

Golden Master   127

Feasibility   127

Generate Input/Output (Golden Master)   127

Assert   128

Kata   128

Golden Master on Gilded Rose Kata by Emily Bache   128

Approval Tests by Llewellyn Falco   129

Combination Tests   129

Revisiting the Refactoring Guidelines   130

Stay in the Green while Refactoring   130

Kata   130

Gilded Rose Refactoring Kata by Emily Bache   130

Conclusions   130

Guideline Questions   130

Great Habits   131

Considerations when Writing a New Test   131

Considerations when Making a Failing Test Pass   132

Considerations after the Test Passes   132

When Should I Move to the Next Lesson?   132

Resources   133

Web   133

Books   133

Chapter 10: Design IV –Design Patterns   135

Design Pattern Advantages   136

Design Pattern Pitfalls   137

A Quick Reference Catalogue   137

Creational Design Patterns   137

Behavioral Design Patterns   138

Structural Design Patterns   140

Revisiting the Refactoring Guidelines   140

Refactoring Design   140

Kata   141

Refactoring Game of Life Kata to Patterns   141

Great Habits   141

Considerations When Writing a New Test   142

Considerations When Making a Failing Test Pass   142

Considerations After the Test Passes   142

When Should I Move to the Next Lesson?   143

Resources   143

Web   143

Books   143

Section 3: Running   145

Chapter 11: Design V – Cohesion and Coupling   147

Coupling   147

Types of Coupling   148

Interaction Coupling   148

Law of Demeter   150

Method Coupling Premises   151

Inheritance Coupling   151

Cohesion   152

Other Indicators of Possible Low Cohesion in Design   153

Types of Cohesion   153

Class Cohesion   154

Method Cohesion   155

Katas   156

Connecting Code Smells with Cohesion/Coupling   156

Connecting Object Calisthenics with Code Smells and Cohesion/Coupling   158

When to Refactor (Extended for Cohesion/Coupling)   159

Classic TDD Flow   160

The Big Picture   161

When Should I Move to the Next Lesson?   162

Resources   162

Web   162

Books   162

Chapter 12: Design VI – Solid Principles ++   165

Single Responsibility Principle   165

Open/Closed Principle   167

Liskov Substitution Principle   171

Interface Segregation Principle   174

Dependency Inversion Principle   175

Balanced Abstraction Principle   178

Principle of Least Astonishment   180

Kata   181

Connecting Cohesion/Coupling and SOLID principles   181

When to Refactor (Extended for SOLID Principles)   182

Classic TDD Flow   182

The Big Picture   183

When Should I Move to the Next Lesson?   183

Resources   184

Web   184

Books   184

Chapter 13: Design VII – Connascence   187

Definition   187

Dimensions   189

Degree   189

Locality   189

Strength   189

Connascence of Name and Type (CoN and CoT)   190

Connascence of Position   192

Connascence of Value (CoV)   197

Connascence of Meaning   201

Connascence of Algorithm   203

Connascence of Execution Order   205

Connascence of Timing   209

Connascence of Identity   211

Connascence of Manual Task   213

Classic TDD Flow   214

The Big Picture   215

When Should I Move to the Next Lesson?   216

Resources   216

Web   216

Books   217

Chapter 14: Design VIII –The Four Elementsof Simple Design   219

What Are the Four Elements of Simple Design?   220

What Does Each Element Mean?   220

Passes Its Tests   220

Minimizes Duplication   221

Maximizes Clarity   221

Has Fewer Elements   222

Alternative Definitions of Simple Design   222

Definition #1   222

Definition #2   222

Definition #3   222

Definition #4   223

Definition #5   223

Definition #6   223

Our Personal Definitions of Simple Design   224

Pedro   224

Marco   224

Alessandro   224

Kata   224

Elevator Kata by Marco Consolaro   224

Classic TDD Flow   226

The Big Picture   227

When Should I Move to the Next Lesson?   228

Resources   228

Web   228

Books   228

Chapter 15: Conclusion   231

Cohesion and Coupling as Forces   233

The 3 Cs of Design: From Cohesion and Coupling to Connascence   233

Systems Entropy   236

The Relevance of Systems Entropy   237

Software Development as System Building   238

Good Design as a Low-Entropy System   238

The Big Picture   239

Resources   240

Web-based resources:   240

Books:   240

Section4: Flying   243

Chapter 16: Outside-In Development   245

The Classic TDD Approach   247

Acceptance Tests   248

Acceptance Test Styles   250

Test Boundaries   251

Double Loop TDD   252

The Outside-In Approach   253

An Outside-In Mindset   253

Outside-In TDD: The London School   258

Example   260

The Direction of Dependencies   262

Should I Use Classic TDD or Outside-In TDD?   264

Kata   264

Stock Portfolio   264

Katacombs of Shoreditch by Marco Consolaro   265

Part I   266

PART II   267

The Big Picture   269

Great Habits   270

Considerations When Writing a New Test   270

Considerations When Making a Failing Test Pass   270

Considerations After the Test Has Passed   271

Resources   271

Web-based resources:   271

Books:   271

Chapter 17: Behavior-Driven Development   273

Poka-Yoke   274

Mistakes versus Defects: Feedback Is the Cure (Again)   275

Bugs and Communication   276

User Stories   278

Behavior-Driven Development   279

The Structure of a Story   279

Acceptance Criteria: It's All about the Examples   280

From Criteria to Acceptance Tests   281

Acceptance Tests Done Right   281

Readable by Business Folks   282

Feature Complete   285

Fast   286

Boundaries   286

The Walking Skeleton   287

Kata   287

The Messy Delivery Office Requirements   287

Resources   288

Web-based resources   288

Books   289

Chapter 18: Understand the Business   291

Knowledge versus Understanding   292

Theory of Constraints   294

Domain-Driven Design: What Domain?   296

Beyond Requirements: Knowledge Crunching   297

5 Whys   298

Impact Mapping   300

PopcornFlow   302

User Story Mapping   303

EventStorming   304

Business Model Canvas   305

Value Streams and Domain Events   307

Bounded Contexts and Communication   310

Synchronous versus Asynchronous   313

Command-Query Separation   314

Business and DevOps   316

The First Way   316

The Second Way   317

The Third Way   318

Systems Thinking and Sociotechnical Organizations   319

Resources   320

Web-based resources   320

Books   321

Chapter 19: Story of Team C   325

Terraforming   326

Team Building   327

The Backlog: Crunching Knowledge for Breakfast   328

Cracking On   329

From Forming to Performing   330

Outside-In ATDD with Optional Unit Tests   330

The Green Flag   331

The Moral of the Story   332

Chapter 20: Conclusion   335

The Human Factor   337

Team Play   338

Bounded Rationality and Knowledge Sharing   340

Resources   341

Web   341

Books   341

Chapter 21: The 12 Agile Principles   343

Chapter 22: PopcornFlow by Claudio Perrone   347

The 7-Steps Decision Cycle   349

The Principles   349

Who Can Benefit from PopcornFlow   350

Resources   351

Web-based resources:   351

Books:   351

Chapter 23: EventStorming by Alberto Brandolini   353

Silos and Value Streams   354

The Importance of Learning   355

The EventStorming Approach   356

The Workshop: A Quick Overview   356

Different Flavors of EventStorming   359

Complex Systems and Proven Solutions   360

Resources   360

Web   360

Books   360

License: CyberDojo   363

About CyberDojo Foundation Exercises   363

Web Resources   364

Sample Solutions   367

Sample Solutions: FizzBuzz in Clojure   367

Sample Solutions: Fibonacci Sequence in C++   368

Sample Solutions: Roman Numerals in C#   369

Sample Solutions: Tic-Tac-Toe in Swift (Partial Solution)   385

Sample Solutions: Connecting Code Smells with Cohesion/Coupling   388

Sample Solutions: Connecting Object Calisthenics with Code Smells and Cohesion/Coupling   389

Sample Solutions: Connecting Cohesion/Coupling and SOLID Principles   389

Feedback   391

Personalized Coaching   391

Individuals   391

Organizations   392

Feedback Please   392

Preface

About

This section briefly introduces the authors and what is covered in this book.