Intro to Program Vis Flashcards
Identify the 2 kinds of abstractions
Data abstraction: info in a program
Control abstraction: what’s happening in a program (execution)
Identify the 3 levels of abstraction
Basic: hardware
Structured: global (???)
Unit: big things (files)
Examples of basic, control abstraction
assign, add
Examples of basic, data abstraction
integer, float
Examples of structured, control abstraction
subroutines, idioms, code blocks
Examples of structured, data abstractions
data structures
Examples of unit, control abstractions
objects (as behaviour), filters, aspect patterns
Examples of unit, data abstractions
objects (as data), files, modules
Examples of meta properties
authors diffs version history file size code quality comments
Examples of static properties
calls and assignments that COULD be made (present in the code itself)
# lines of code
types (in a typed language)
program dependence (which objects depend on which other objects)
metrics: cohesion, coupling, complexity
text itself, including comments
Examples of analysis you can do with static properties
call graphs control flow graphs data flow graphs architectural conformance checks pattern finding reachability keyword tagging
Examples of dynamic properties
runtime behaviour emergent properties of the code threads memory usage the stack performance dynamic types symbol table entries
Examples of analysis you can do with dynamic properties
bounds checking code coverage memory overrun types invariant detection object allocation on stack
Lexical analysis: what is
- looks at presence or absence of stuff
- can use regex
- doesn’t look at syntax at all
Lexical analysis: good for…?
- meta properties
- pattern recognition
- keywords
- comments