Test Driven Development: Part I Flashcards
What is the definition of kata provided in the text?
Kata is described as a Japanese word meaning form, particularly in martial arts, where it denotes a choreographed pattern of movements.
What is a coding kata and how long does it typically last?
A coding kata is a short exercise lasting between thirty minutes to an hour.
What is the primary focus when working on coding katas?
The focus is on learning and improving skills rather than achieving perfection.
How is a domain defined in the context of the text?
A domain is defined as a specific sphere of activity or knowledge.
What is the problem domain and the solution domain?
The problem domain refers to real-world things and concepts related to a problem, while the solution domain refers to real-world things and concepts related to a solution.
How is a domain expert defined in the text?
A domain expert is someone with special knowledge or skill in a particular domain, such as an accountant being an expert in the accounting domain.
What is the process described for defining the problem domain and the solution domain?
When reading a problem statement in textual form, concepts can be identified within it. These concepts can be listed and grouped together to derive the problem domain name.
What is domain knowledge, and why is it important?
Domain knowledge is expertise in a particular problem domain. It is crucial in coming up with abstractions that lead to elegant solutions.
What domain would a leaking sink belong to?
“Leaking sink” is an example of a term found in the problem domain.
What are some examples of terms belonging to the solution domain for fixing a leaking sink?
Terms like “clevis screw,” “stopper rod,” “clevis,” and “retaining nut” belong to the solution domain.
According to Kent Beck, what is Test Driven Development (TDD) primarily?
Test Driven Development (TDD) is primarily described as an analysis technique and a design technique, rather than a testing technique.
Why does the text suggest using coding kata to learn TDD?
Coding kata is recommended for learning TDD because it allows for the practice of TDD skills separately, helping individuals move past the difficulty associated with TDD and hone their skills.
What is suggested as a practice after completing a coding kata using TDD?
After completing a coding kata using TDD, it is recommended to reflect on the practice session by asking questions such as what went well, what went wrong, and what can be done differently next time to improve.
How does the text differentiate between intent and implementation, using the example of driving a car?
The text explains that intent refers to the determination to do something, such as driving a car, while implementation refers to the details under the hood, known only to the car mechanic.
What analogy does the text use to illustrate intent and implementation in the context of programming?
The text uses the analogy of music composition and performance, where music notation represents the intent, and the actual music played by performers represents the implementation.
Why is it important to separate the intent from implementation in coding?
It is crucial to separate the intent from implementation because it allows for changing the implementation without breaking the tests. The intent remains the focus of the tests, while the implementation is the focus of the production code.
What method does the text suggest for separating intent from implementation in coding?
The text suggests using Chris Stevenson’s TestDox method, which expresses the subject in the code as part of a sentence to clearly define the behavior.
Can you provide an example of how TestDox expresses behavior in code?
Here’s an example: “A sheep eats grass.” “A sheep bleats when frightened.” “A sheep produces delicious milk.” “A sheep moves away from sheep dogs.”
How does TestDox help in automatically converting behavior specifications into code?
TestDox expresses behavior in natural language sentences, which can then be automatically converted into specifications in code, facilitating clear and precise coding practices.
What is the problem with the initial test provided in the text for the bowling game scoring program?
The initial test does not reveal the intent behind rolling the ball ten times, making it unclear why the roll method is invoked ten times.
How is the intent made explicit in the bowling game scoring program test?
The intent is made explicit by introducing a strike method, which directly expresses the concept of hitting all ten pins in bowling.
Why is it important to use intent-revealing methods in coding?
Intent-revealing methods communicate the purpose and meaning of the code directly to other developers, enhancing readability and maintainability.
How does the text compare the development of language in children to the precision of meaning in software tests?
Similar to how children’s language becomes more precise as they grow, the precision of meaning in software tests increases as the software evolves.