refactoring

Recursos de programación de refactoring
Yesterday we practiced doing the Sieve of Eratosthenes kata at a Barcelona Software Craftsmanship event. My partner Fernando Mora and I used TDD in Scala to write the code. Today I did it once again in Clojure. I'd like to explain here how I did it step by step in order to share it with the Barcelona Software Craftsmanship members. I started by writing this test: which I quickly got to green by just hard-coding the response: In this first test I used wishful thinking to get the function and s...
Material del vídeo: http://codely.tv/screencasts/solid-responsabilidad-unica-segregacion-interfaces Proceso de refactoring de un código que viola el primero de los principios SOLID: Principio de Responsabilidad Única. Índice: 0:29 - Qué son los principios SOLID 1:28 - Contexto: Qué hace el código a refactorizar 5:12 - Violación del Principio de Responsabilidad Única - SRP 7:07 - Problemática al violar SRP 9:57 - Refactoring del método registerNewUser 17:41 - Violación del Principio de Segregación de Interfaces - ISP
January- Software Architecture for Developers, Simon Brown- Functional Programming Patterns in Scala and Clojure, Michael Bevilacqua-Linn- Working Effectively with Unit Tests, Jay FieldsFebruary- Vida y Destino (Жизнь и судьба), Vasili Grossman. (2nd time)- Primer Libro de Lankhmar (The First Book of Lankhmar), Fritz Leiber- Drown, Junot Díaz- Los girasoles ciegos, Alberto Méndez- Smalltalk Best Practice Patterns, Kent BeckMarch- Las puertas del paraiso (The Vagrants), Yiyun Li- Growing Object-O...
I've just listened this great Ruby Rogues podcast with Martin Fowler talking about his Refactoring books (both Java and Ruby editions): Refactoring Ruby with Martin Fowler - por Garajeando
8. Achieving Dependency Inversion by extracting an interface.Even though we are already injecting into Alarm the dependency on Sensor, we haven't inverted the dependency yet. Alarm still depends on a concrete implementation. Now we'll show how to invert the dependency by extracting an interface. Normally, it's better to defer this refactoring until you have more information, i.e., until the need for another sensor types arises, to avoid falling in the Speculative Generality code smell. However,...
1. Introduction.Last week I facilitated a guided kata for a Gran Canaria Ágil event in Aplicaciones Informáticas Domingo Alonso (thanks to both for inviting me) in which I explained a possible way to solve Luca Minudel's Tire Pressure Monitoring System exercise. This exercise is part of his TDD with Mock Objects: Design Principles and Emergent Properties exercises. I like these exercises very much because they contain clear violations of the SOLID principles but they are sill small enough to be...
Yesterday in the Barcelona Software Craftsmanship coding dojo we did the Binary Search Tree kata. Raúl Lorca and I paired using TDD in C# to get to a pretty OO solution. We didn't finish the exercise. We got to create the binary search tree but we didn't have time to code the in-order depth-first traversal. Well, it doesn't matter. The important thing is that we practiced TDD, recursion and OO by test-driving a recursive data structure. Today, with a bit more of time, I did the the whole kata i...
I've just watched this wonderful practical demonstration of using connascence to guide the refactoring step of TDD by James Jeffries and Kevin Rutherford: Red, Green, ... now what ?!These are the slides. These other slides explain more about each type of connascence. - por Garajeando
¿Cuándo lo hacemos? Hablamos sobre esto, sobre la utilidad que le encontramos y damos alguna bibliografía que a nosotros nos sirvió para asimilar conceptos. Bibliografía [LIBRO] Refactoring, by Martin Fowler [LIBRO] Refactoring to Patterns, by Joshua Kerievsky [LIBRO] Pro PHP Refactoring [VIDEO] Curso de Refactoring, by Xavi Gost [WIKI] Principios SOLID [VIDEO] Debate de “gurús” sobre cohesión y acoplamiento … Sigue leyendo 01×08 Refactoring →
Last week we started working on the String Calculator kata at the Clojure Developers Barcelona meetup. Finally, this week I found some time to finish it. These are the tests using Midje: The resulting code which is divided in several name spaces. The string-calculator.core name space: The string-calculator.numbers-parser which is where most of the logic lives: The string-calculator.numbers-validation name space: Finally, the string-calculator.numbers-filter name space: I used a mix of TDD a...