TDD Patterns
Frame First
Once you've specified what behavior you would like to test-drive, it's time to frame that behavior.Framing means "constructing by fitting and uniting the parts of the skeleton of a structure" (M-W.com).
Construct the skeleton code
necessary to compile your test.
It's critical to not produce more code than you need at this point:
create whatever class(es), constructor(s) and method(s) are necessary for your assert statement and test to compile.If you're working in an IDE that lets you generate code, let it produce the
code required to successfully compile the test.At this point, your test should run and fail.You're then ready to make it pass by doing The Simplest Thing That Could Possibly Work.
necessary to compile your test.
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |