5. The London
School
http://www.flickr.com/photos/doug88888/4507077583/
6. The London School
1.Write a failing functional test
2.Mark it as Work-in-progress
3.Write a failing unit or integration test
4.Make it pass
5.Refactor
6.Repeat steps 3 to 5 until your functional
test passes
http://www.flickr.com/photos/doug88888/4507077583/
14. “There are three aspects of TDD
that help us achieve [good
design]:
15. First, starting with a test means
that we have to describe what we
want to achieve before we
consider how. This focus helps
us maintain the right level
of abstraction.
16. “Write code in terms of the
problem's data types, not the types
that happen to be in the
implementation.”
Peter Norvig, Good Lisp Programming Style - http://bit.ly/u6JTPt
23. To ensure that you say what you mean:
1.Start with an English description of the
algorithm
2.Write the code from the description
3.Translate the code back to English
4.Compare 3 to 1
Peter Norvig, Good Lisp Programming Style - http://bit.ly/u6JTPt
25. Second, to keep tests
understandable and maintainable,
we limit their scope. Tests that
are dozens of lines long tell us
that the component they’re testing
is too large and needs breaking up
into smaller components.
26. “Break the problem into parts.
Design useful subparts. Be
opportunistic.”
Peter Norvig, Good Lisp Programming Style - http://bit.ly/u6JTPt
31. Every function should have:
●A single specific purpose
●If possible, a generally useful purpose
●A meaningful name
●A structure that is simple to understand
●An interface that is simple yet general
enough
Peter Norvig, Good Lisp Programming Style - http://bit.ly/u6JTPt
32.
33.
34. Third, to prepare a component for
a unit test, we have to pass its
dependencies to it, which means
that we have to know what they
are. A component with
implicit (or just too many)
dependencies is painful to
test.”
35. “Determine dependencies.
Re-modularise to reduce
dependencies. Design most
dependent parts first.”
Peter Norvig, Good Lisp Programming Style - http://bit.ly/u6JTPt