Out of the Tar Pit Flashcards
The system must retain input data when ___
there is a possibility that the system may be require to refer to it in the future.
Input data corresponds to ___ state.
essential
In the ideal world, control ___.
can be completely omitted
In the ideal world, concurrency is ___ state.
accidental
In the ideal world, concurrency is considered accidental because ___.
finite computations take zero time, regardless of parallel or sequential ordering
Two cases to consider regarding input data:
- There exists a possibility the system may be required to refer to the data in the future.
- There is no such possibility.
In the ideal world, control is ___ state.
accidental
In the ideal world, ___ should not appear in the formal requirements.
control
Control should not appear in the ideal world’s formal requirements because ___.
they are derived with no consideration of execution
It is recommended to avoid ___ in a system.
Accidental Useless Complexity (state / control)
It is recommended to separate ___, ___, and ___ in a system.
Essential Logic
Essential Complexity (state)
Accidental Useful Complexity (state / control)
Definition: Referential Transparency
When supplied with a given set of arguments, a function will always return exactly the same result.
In the ideal world, all state in the system is visible to the user because ___.
inputs can reasonably be expected to be visible in ways that internal cached state is not
Referential transparency guarantees elimination of one weakness of testing: ___
a system that is in one state reveals nothing about its behaviour in a different state
Because the ideal world removes all non-essential state, ___.
all the state in the system is visible to the user
Derived data is either ___ or ___.
immutable
mutable
Immutable derived data
Data that is intended only for display
Mutable derived data
Explicit requirements specify that users must be able to update the data
All data mentioned in users’ informal requirements is ___.
essential
Essential data specified in informal requirements do not necessarily correspond to ___.
essential state
“Have you tried rebooting?” is advice that attempts to solve errors by ___.
returning the system to a ‘known’ / ‘good’ state (probably)
If a stateless procedure uses any stateful procedures, even indirectly, then it ___.
can only be understood in the context of state
You will only ever discover that you did not ___ when the system breaks.
write the correct tests with the correct inputs
Complexity is primarily contributed to by (3)
state
flow of control
volume of code
Object-Oriented Programming mitigates complexity by ___.
coupling state and behaviour
Functional Programming mitigates complexity by ___.
avoiding state & side-effects entirely (in its pure form)
Normal approach to testing is:
- begin with a clean / initial / known state
- run desired tests with test inputs
- assume system will perform the same way every time the tests run with those inputs
The flaw in the normal approach to testing is that ___.
it ignores hidden internal state
The same problem (that testing in one state reveals nothing about the system in another state) also applies to ___.
test inputs
Testing shows ___, but not ___.
bugs
a lack of bugs
The more powerful a language is (e.g. manual memory management, permitting state), the harder it is to ___.
understand systems constructed in it
Encapsulation allows the programmer to control and enforce ___ by ___.
integrity constraints over an object’s state
regulating access to that state through its methods
Code volume should be ___.
reduced to an absolute minimum
Most systems’ complexity exhibit a nonlinear increase with ___.
the amount of code
Objects consist of: (2)
state
a set of procedures for accessing and manipulating that state
Extensional identity
items are considered the same if their attributes are the same
Essential complexity
Complexity that is inherent in, and the essence of, the problem (as seen by the users)
Input data that may be required to refer to in the future corresponds to ___ state.
essential
Immutable Essential Derived Data (3 qualities)
- can always be re-derived from input data / essential state whenever required
- no need to store it in ideal world
- corresponds to accidental state
Ideal World has 3 steps:
- Gather informal requirements
- Formalize these requirements
- Execute the formal requirements on the underlying general purpose infrastructure