Diagrams and tables are in italics
abstraction
compared to concrete problem-solving 48
context 60 – 3
definition xiv , 58
examples 9 , 58 – 60 , 61 – 3 , 232 – 3
generalisation 57
importance of 58 , 74
instantiation 167 , 171 – 2
layers 60 – 3 , 74
programming 162 , 164 , 167 – 8 , 182 see also object-oriented programming
risks 63 – 4
acceptance testing 216 – 19
accuracy (modelling) 72 , 199
actions (modelling) 67 , 231
activity diagrams (UML) 196 , 236
actors (UML) 198
aggregation (UML) 192
algorithmic thinking 9 , 25 – 31
algorithms
compared to logic 25 , 37
complexity classes 95 – 6
definition xiv , 25 , 26 – 7 , 276 n1
efficiency 94 – 7
execution 27 – 9
exhaustiveness 79 – 80
if-then-else 31 – 2 , 120
modelling 71
Python 116 – 24 , 137
ambiguity 17 – 18 , 19 – 20 , 77 – 8
AND
definition xiv , 18 – 19
natural language errors 31
symbolic logic 20
truth table 21
Venn diagram 22
arguments 15 – 17
assertion methods 212
assignment xiv , 27
associations (UML) 191 – 3 , 198
assumptions 48 , 80 , 86
Barr, V. 12
Behave 216 – 17
behaviour-driven development (BDD) 217 – 18
behavioural patterns 179 , 180 – 1
behaviours (modelling) 66
Beizer, B. 80 , 121
biconditional statements xiv , 19 , 24
‘Big-O’ 96 – 7
Boolean logic 17 – 19 , 110 , 165 – 6
bottom-up testing 82 – 3 , 210 – 14
brainstorming 42
break statement 123 – 4
breakpoints 224
bugs see also errors; testing
debugging 85 – 8 , 90
definition 76
mitigation 80 – 2 , 90 , 208 – 9
prevention 77 – 80 , 90 , 203 – 4
testing 82 – 5 , 90
types 77 – 80 , 204 – 5
cardinality xiv , 71
class diagrams 186 – 7
class variables 168 – 9
classes
exceptions 207
as models 200
Python 167 – 75 , 207
Unified Modelling Language (UML) 186 – 7 , 233 , 234 , 235
climate models 69 , 70
collaboration 42 , 47
complexity 40 , 95 – 6
components (UML) 188
composition
objects 174 – 5
Unified Modelling Language (UML) 191 – 3
compound propositions 18 , 115
comprehensions 133 – 4
computational thinking
definition 7 – 9 , 11 , 13
misunderstandings about 11 – 12
shortcomings 12
usage examples 9 – 10
computers, precision of 30 – 1
concerns 141 – 5 , 154 , 159
conditional expressions 120
conditionals
as abstractions 164
algorithm use 28 – 9 , 117
bugs 79 – 80
complex 32 – 6 , 118 – 19
definition xiv
Python 118 – 20
as rule identifier 54
UML activity diagrams 196
conjunction
definition xiv , 18 – 19
truth table 21
continue statement 121 – 3
correctness 93 – 4 , 104
creational patterns 179 – 80
critical thinking 47 – 8 , 79
data attributes 168
data compression 101 – 4
data representation (modelling) 71
debuggers 88 , 222 – 5
debugging 85 – 8 , 90 , 206 – 7 , 219 – 25
declarative programming 131 – 3
decomposition see also pattern recognition
home automation system example 228 – 9 , 230
principles 43 – 7 , 54 – 5 , 57 , 139
deductive reasoning xiv , 15 – 16
defensive programming 80 – 1 , 208 , 225
definiteness 26
Denning, P. 8 , 12
dependencies (UML) 189 – 91
disjunction
definition xiv , 19
truth table 22
dissertation example 45 – 6 , 49
divide-and-conquer 86 see also decomposition
dot notation 158
drawing 140
Dromey, R. G. 48 , 49
dynamic models 66 – 7 , 184
dynamic typing 187
edges (graphs) 68
effectiveness 97 – 8
efficacy of computational thinking 12
efficiency 94 – 7 , 100 , 104
elegance 97 – 9 , 104
elif blocks 119
else block 207
emails 59 – 60 , 61
empirical testing 93 – 4
entities (modelling) 65 – 6 , 68 , 186 – 9 , 229
equivalence classes 84 – 5
errors see also bugs; testing
definition 77
exceptions 206
logical 78 – 9
priority 89 – 90
severity 89 – 90 , 220 – 1
types 77 – 80 , 204 – 5
users 100
Euler, Leonard 67 – 9
evaluation see also testing
correctness 93 – 4 , 104
efficiency 94 – 7 , 104
elegance 97 – 9 , 104
overview 92
program evaluation 203
trade-offs 101 – 4 , 105
usability 99 – 101 , 104 , 248
events (modelling) 67
except block 206 , 207 , 220
exceptions 117 – 18 , 206 – 7 , 209 , 225
exhaustiveness 79 – 80
expressions (Python) 115 – 16 , 137
facade pattern 177 – 9
factory pattern 179 – 80
fallacies 16
filter function 133 , 136 , 137 , 278 n55
finally block 208
FizzBuzz game 84 – 5
float variable type 165 – 6
for-loop 121
formality (modelling) 72
format parameter 222
function signature xiv , 152
functional primitives 136 – 7
functions (Python) 112 – 13 , 134 – 7 , 144 , 151 – 2 , 168 , 172 – 3
Furber, S. 8
games, difficulty of definition 7
Gauss, Carl Friedrich 97 – 8
generalisation 50 – 5 , 57
grammar bugs 77 – 8
graph models 68 – 9
guard conditions 195 , 196
hasattr method 174
Hemmendinger, David 8 , 11 – 12
heuristics xiv , 43
home automation system example
abstraction 232 – 3
decomposition 228 – 9 , 230
improvement options 246
modelling 233 – 7
pattern recognition 229 – 32
problem definition 227 – 8
source code 237 – 42
testing 243 – 6
IF AND ONLY IF
definition 19
logic compared to algorithms 31 – 2
symbolic logic 20
Venn diagram 24
if-statements 118 – 20
ignition system example 177 – 81
image compression 101 – 4
immutability see mutability
imperative programming 132 , 133
imperialism 12
IMPLIES (implication)
definition xiv , 19
symbolic logic 20
truth table 23 , 24
Venn diagram 24
importing 151 – 2 , 158
inconsistency 78
indentation 112 , 118
inductive reasoning xiv , 16 – 17
information hiding xv , 156 – 7 , 159
inheritance 170 – 2 , 174 , 175 , 190 – 1
initialisers 168 – 9 , 173 – 4 , 177 , 179 , 180
instance variables 168 , 169 , 170
instantiation 63 , 167 , 171 – 2
interactions
error reactions 81 – 2
modelling 72
interfaces 155 – 6 , 173
Interpreter Prompt 110
intuition 14 , 25
iteration 27 – 8 , 43 , 80 , 117 , 120 – 4
Jobs, Steve 98
Königsberg bridges 68 – 9
lazy initialisation 177
learnability 100
library modules xv , 152 , 153
list comprehensions 131 , 136 , 164
load testing 216 , 217
logging 87 , 219 – 22
logical errors 78 – 9
logical operators
natural language errors 31 , 33
principles 18 – 19
propositions 115
Python 116 , 137
logical propositions see propositions
logical thinking
arguments 15 – 17
Boolean logic 17 – 19
natural language errors 31 , 33
principles 15
symbolic logic 19 – 24
Logo 8
loops see also iteration
as abstractions 164
bugs 80
concept 27 – 8 , 52 – 3
definition xv
imperative programming 133
Python 120 – 4
selection 28 – 9
machine language 164
map function 136 – 7
maturity of computational thinking 12
memorability 100
memory (human) 58
method chaining 180 – 1
methods (Python) 168 – 9 , 174 , 212 , 213 – 14
model-driven development 200
modelling see also Unified Modelling Language
abstraction 58 , 199
accuracy 72 , 199
advantages 200
algorithms 71
dynamic models 66 – 7 , 184
effective characteristics 199
examples 67 – 70 , 229 – 32
exceptions 233 – 7
formality 72
fundamentals 65 – 6 , 74
general-purpose modelling language 185
interactions 72
precision 72
purpose 72 , 184 – 5 , 199 – 200
static models 66 , 184 , 186
usages 67 – 71 , 200 – 1
modules (Python) 150 – 7 , 160 , 188
mutability xv , 126 – 30 , 248
negation
definition xv , 19
truth table 22
Netflix 62
Nielsen, Jakob 100 , 248
nodes
graphs 68
Unified Modelling Language (UML) 189
NOT
complex conditionals 32 – 3
definition xv , 19
natural language errors 33
symbolic logic 20
truth table 22
Venn diagram 23
Noughts and Crosses example 18 – 19 , 29 – 30
object composition 174 – 5
object-oriented programming (OOP) 166 – 75
Occam’s Razor 86 , 88
operations 51 , 186 – 7
optimisation, trade-offs 101 – 4 , 105
OR
definition xiv , 19
symbolic logic 20
truth table 22
Venn diagram 23
order of precedence 33 – 6 , 116 , 247
orreries 69 , 70
packages
Python 157 – 9 , 160
Unified Modelling Language (UML) 187 – 8
parameters
definition xv , 51
format 222
loops 53
modelling 70
self 168 , 170
subroutines 54
parentheses 116
pattern categories 179
pattern recognition 50 – 4 , 139 , 162 – 4 , 175 – 82 , 229 – 32
pedantry 30 – 1
performance testing 216 , 217
Pierce, B. C. 162
pixels xv , 101 – 4
Pólya, George 39 – 40 , 43
polymorphism 172 – 4
precedence 33 – 6 , 116 , 247
precision 19 , 26 , 30 – 1 , 72 see also ambiguity
premises
deductive reasoning 16
definition xv , 15
probability 16 – 17
problem-solving see also decomposition
collaboration 42
computational thinking 11
concrete instances 48 – 9
creativity 39
critical thinking 47 – 8
goal definition 40 – 2
iteration 43
quality 42
related problems 49
working backwards 49 – 50
procedural thinking 8
processes (UML) 194 – 6
programming see also Python
abstraction 162 , 164 , 167 – 8
compared to computational thinking 11
declarative compared to imperative 131 – 3
dynamic typing 187
object-oriented programming (OOP) 166 – 75
pattern recognition 175 – 6
properties
modelling 66
pattern recognition 51 , 231 – 2
propositions
compound 18 , 115
definition xv
logical operators 18 – 19
properties 17 – 18
Python 115 – 16
pseudocode 29
Python
abstraction 164 , 182
acceptance testing 218 – 19
algorithms 116 – 24 , 137
classes 167 – 75 , 207
comments 113
comprehensions 133 – 4
data types 110 – 11 , 130 , 248
debugger 222 – 5
expressions 115 – 16 , 137
functions 112 – 13 , 135 – 7 , 144 , 151 – 2 , 168 , 172 – 3
home automation system example 237 – 42
Interpreter Prompt 110
logging 220 – 2
methods 174 , 212
modules 150 – 7 , 159 , 188
operations 111
order of precedence 116 , 247
packages 157 – 9 , 160 , 188
pattern recognition 175 – 82
scoping 147 – 9
separation of concerns 141 – 5 , 154 , 159
state 124 – 31 , 137
statements 116 , 130 – 1
system testing 212 – 14 , 244 – 6
unit tests 211 – 14 , 243 – 4
variable types 165 – 6
quality 42
raise 209
ranges 121
reasoning xiv , 15 – 17 see also algorithmic thinking; logical thinking
recipe analogy 26 – 7 , 30 – 1 , 135
recursion 44
reduce function 136 , 137
relationships (modelling) 65 – 6 , 68 , 189 – 93
rendering 142 , 144 – 5
reusability 152 , 166 , 182
‘rubber duck debugging’ 88 , 277 n39
rules
modelling 66
pattern recognition 52 , 54 , 232
safety 81
scepticism 47 , 93
scoping 147 – 9
scripts xv , 152 – 3
security testing 217
Selby, Cynthia 8 , 9 , 12
selection 28 – 9
self parameter 168 , 170
semantic errors 205
separation of concerns 144 , 154 , 159
sequencing 26 , 117 – 18
server/client module 151
setUp method 213 – 14
severity (debugging) 89 – 90 , 220 – 1
signature see function signature
simplicity 98 – 9
simulation see modelling
sink traps 97 , 98
skills, transferable 11
smiley face example 48 – 9 , 141 – 5 , 153 – 5 , 163 – 4
Socrates 15
solar system models 65 , 69 , 70
solution evaluation see evaluation
solutions, non-obvious 98 – 9
specifications 42 , 93 , 209 , 216 , 217
specificity 41
stability testing 217
state
algorithms 26 – 7 , 137
modelling 67 , 194 – 6 , 234 – 7
Python 124 – 31
state machine diagrams 67 , 194 – 6 , 235 , 236 , 237
statements
ordering 130 – 1
Python definition 116
static models 66 , 184 , 186
Stephenson, C. 12
strings 110 , 165 – 6
structural patterns 179
student grading example 31 – 6
student records example 71 , 72 , 198 – 9 , 213
subroutines xv , 52 , 53 – 4 , 112
switchboard metaphor 155 – 6
symbolic logic 19 – 24 , 33 – 6
syntax errors 77 – 8 , 94 , 204 – 5
system testing 214 – 16 , 244 – 6
tearDown method 211 – 12
temporary variable swap 176 – 7
testing see also bugs; errors; evaluation
bottom-up 82 – 3 , 210 – 14
home automation system example 243 – 6
purpose 82
system testing 214 – 16
test phases 210
test plans 93 , 216 , 217
top-down 82 – 3
unit tests 83 – 5 , 210 – 14
user testing 100 – 1 , 217
validation 209 – 10 , 216 – 19
verification 209
top-down testing 82 – 3
tracing 87 – 8
transactions, error reactions 81
transferable skills 11
transitions (modelling) 67
tree (structure) xv , 44 – 6
truth tables
AND 21
IF AND ONLY IF 24
IMPLIES 23
NOT 22
OR 22
overview 21
truth values xv , 15
try block 206
tuples 130 , 165 – 6
turnstile example 67 , 194 – 6
types
modelling 66
Python 165 – 6 , 182 see also classes
typos 77
underground maps 58 – 9 , 66
Unified Modelling Language (UML)
entities 186 – 9
introduction 185
processes 194 – 6
relationships 189 – 93
usage 196 – 8 , 200 – 1
unit tests 83 – 5 , 210 – 14 , 243 – 4
unittest library 211 , 214
usability 99 – 101 , 104 , 248
use case diagrams 197 – 9
user input, error reactions 81 – 2
user interfaces 72
user satisfaction 100
user scenarios 217 – 18
user testing 100 – 1 , 217
validation 209 – 10 , 216 – 19
variables
as abstractions 164
class 168 – 9
definition 27
global 146 – 7 , 148 – 9
instance 168 , 169 , 170
local 148 – 9
mutability 126 – 30 , 248
Python 110 , 124 – 30 , 146 – 7 , 165 – 6 , 176 – 7
temporary variable swap 176 – 7
types 110 , 165 – 6
vehicle rental example 61 – 2 , 166 , 167 , 168 – 75 , 186 – 7
vending machines 81 , 93 , 218 – 19
Venn diagrams
AND 22
IF AND ONLY IF 24
IMPLIES 24
NOT 23
OR 23
verification 209 , 214 – 16
visualisation see modelling
Voogt, J. et al. 7 , 8
while loop 120 – 1
Wilkes, M. 76
Wing, Jeannette 2 – 3 , 7 , 8 , 11 , 58
workflows (UML) 196 , 234 – 7
Yadav, A. et al. 8
YouTube 62