Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Exploring design-alternatives-using-tdd


Published on

Exploring alternatives is part of the design process.
TDD is a way to do incremental design, or design while you write code.
So can we use TDD to explore design alternatives?

Turns out, I've seen a lot of design exploration during the 30+ code retreats I facilitated and attended. While I don't have a definite proof, it seems that TDD could be used for this purpose.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Exploring design-alternatives-using-tdd

  1. 1. ExploringDesignAlternativesusingTDD
  2. 2. How do you design software?
  3. 3. Waystodesignsoftware● Sketch a diagram (hopefully not UML)● Think about the problem● Write code (prototype)● Review with other people, or work together
  4. 4. Why do we design software?
  5. 5. WhyDesignSoftware?
  6. 6. What is design?
  7. 7. Designis...“Conceiving and givingform to artifacts thatsolve problems.”Karl Ulrich
  8. 8. Designis...Conceiving and giving form to artifacts thatsolve problemswithin constraints.The primary constraint for software is need forquick change.
  9. 9. GeneralDesignProcess
  10. 10. ExploringDesignAlternativesSource: Apollo Paul Paredes
  11. 11. Software design:What are the artifacts?
  12. 12. OOPArtifacts● Classes– List of methods● Methods– Names– Parameter lists● Collaboration between objects => contracts
  13. 13. Do you explore design alternatives?How?
  14. 14. ExploringDesignAlternatives● On paper● By writing code
  15. 15. Whats this got to do with TDD?
  16. 16. TDDis...A way of doing incremental design(design while writing code)
  17. 17. IncrementalDesignDefine examples of inputs – outputsImplementparticular casesExtract abstractionsaka generalize solutionaka design
  18. 18. Design is creation of artifacts that solve problemsSoftware design is the creation of classes,methods etc. that solve a problemExploring design alternatives is part of the designprocessOne way to explore an alternative is to build itTDD is a method to design software while writingcode
  19. 19. How about using TDD as way to explore designalternatives?
  20. 20. Turns out, Ive seen a lot of exploration with TDD
  21. 21. Coderetreat● One day● 6 sessions, 45● Pair program, TDD● Delete code, changepair after session● Use constraintsCode Retreat #1 in EuropeAttended / facilitated: ~30 code retreats
  22. 22. Inoticedatcoderetreatsthat...How you start and the constraints you set maychange the final design.
  23. 23. How to start?
  24. 24. Vary:numberofdesignentitiesTDD As If you meant it → 0 entities...n entities
  25. 25. Startfromexistingentities● Must have a certain class● Cant modify a certain class
  26. 26. Use different constraints
  27. 27. Constraints● Pure functions● Dont use data structures● Use only events to communicate betweenobjects
  28. 28. Paradigm● Only OOP● Only Functional Programming
  29. 29. ConclusionTDD can be used to explore design alternatives.
  30. 30. Thankyou!Alexandru BolboacaCoach and Trainer at MozaicWorksContact me:@alexbolyalex.bolboaca@mozaicworks.comRemote pair with meCome at code and beer!