CS180 Final Review (Lec 1-17)

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/57

encourage image

There are no tags or description

Looks like no tags are added yet.

58 Terms

1
New cards

Waterfall process

Each phase is fully completed before the next begins; handles requirement changes poorly.

2
New cards

Agile processes

Welcome changing requirements, even late; deliver small working features in short iterations.

3
New cards

Scrum

Agile process: work organized into fixed-length sprints drawn from a product backlog.

4
New cards

Extreme Programming (XP)

Agile process that advocates pair programming, test-driven development, and continuous integration.

5
New cards

Distributed version control (Git)

Every full clone holds the entire commit history; commits are local so you can commit offline; a server is only needed to share commits.

6
New cards

git merge

Joins two branches by creating a merge commit with two parents; preserves the existing history as is.

7
New cards

git rebase

Replays your commits one by one on top of the other branch; produces a linear history but rewrites the moved commits (new hashes).

8
New cards

Merge vs rebase (key contrast)

Merge combines branches and preserves history with a merge commit; rebase moves your commits for a linear history, giving them new identities.

9
New cards

Black-box (functional) testing

Tests derived from the specification without looking at the code (e.g. ECP, BVA, decision tables, state transition).

10
New cards

White-box (structural) testing

Tests derived from the code's structure, e.g. coverage criteria over the control-flow graph.

11
New cards

Control-flow graph (CFG)

Nodes are executable statements and decisions; edges are possible control transfers.

12
New cards

Statement coverage

Every executable statement runs at least once; the weakest coverage criterion.

13
New cards

Branch (decision) coverage

Every edge out of every decision is taken (each decision goes both ways).

14
New cards

Condition coverage

Each individual condition evaluates to both true and false; short-circuit evaluation can leave a condition unexercised.

15
New cards

Path coverage

Every complete path through the CFG is taken; strongest criterion, usually impractical.

16
New cards

Coverage criteria, weakest to strongest (course order)

Statement, branch, condition, path.

17
New cards

Equivalence class partitioning (ECP)

Partition inputs into classes the program treats the SAME way; cover each class with at least one test. Use one class per distinct result/behavior, including each invalid or reject case.

18
New cards

ECP common mistake

Do not merge ranges with different outputs into one class, and do not omit the invalid-input classes.

19
New cards

Boundary value analysis (BVA)

Test BOTH sides of each boundary between classes, e.g. for 6<=w<=20 test 5 and 6, and 20 and 21.

20
New cards

Decision table testing

Derive tests systematically from a table of condition combinations and their resulting actions.

21
New cards

State transition testing

Derive tests from the system's states and the transitions between them.

22
New cards

All-pairs (pairwise) testing

Cover every pair of parameter values at least once instead of all combinations.

23
New cards

Fault

The mistake in the code.

24
New cards

Error

An incorrect internal state or computation during execution; may stay hidden.

25
New cards

Failure

Wrong behavior visible to the user, violating the spec.

26
New cards

Fault -> error -> failure chain

A fault can cause an erroneous state, which can propagate to a visible failure; a hidden wrong state is an error, not a failure.

27
New cards

Systematic debugging: step 1

Create a small, repeatable test case that triggers the failure BEFORE editing anything.

28
New cards

Systematic debugging: closing step

Add a regression test, then rerun the new test AND the existing suite so the bug cannot return unnoticed.

29
New cards

Ideal test set

Reveals a failure whenever the program is incorrect.

30
New cards

Minimum-size test set

The fewest test cases that still satisfy a given coverage criterion.

31
New cards

Exhaustive testing

Testing every possible input; the baseline for comparison, usually impractical.

32
New cards

Dummy (test double)

Passed around but never actually used.

33
New cards

Stub (test double)

Returns canned answers to calls.

34
New cards

Spy (test double)

Records how it was called so the test can check the calls afterward.

35
New cards

Mock (test double)

Stub + spy + an up-front specification of expected calls; self-verifying.

36
New cards

Fake (test double)

A simplified but working implementation, e.g. an in-memory database.

37
New cards

Testable code

Pass in nondeterministic inputs (clock/date) and avoid hidden side effects (return values, inject writer/path) so dependencies can be replaced with doubles.

38
New cards

Naturalness of software

Hindle et al. 2012: source code is highly predictable, so statistical/NLP models (now LLMs) work well on code.

39
New cards

Vibe coding

Generating code without reviewing or understanding it (term: Karpathy, 2025); fine for low-stakes prototypes, bad for long-lived code.

40
New cards

LLM coding agent

An LLM that runs tools in a loop to achieve a goal (Willison): tools search, edit files, run builds and tests; the loop uses results to decide the next step.

41
New cards

Agent harness parts

Model, context, tools, permissions; the harness runs the loop and manages these parts.

42
New cards

Context engineering

Selecting the useful evidence (instructions, files, filtered tool output) that fits the model's limited context window; save key decisions in files.

43
New cards

AGENTS.md

A repository file recording project conventions (directory map, build/test commands, style) so agents and humans can discover them.

44
New cards

Prompt injection

Untrusted content in the context hijacks the LLM's instructions; the model cannot distinguish your instructions from file or web contents. Core security risk for agents.

45
New cards

Defense in depth (agents)

Sandboxing, limited filesystem/credential/network access, scoped tools and connectors, review of sensitive actions; no single layer stops injection.

46
New cards

LLM code best practices

Understand the code (review it), test it (high coverage of generated code), refactor it (linters, match project style), and prompt precisely.

47
New cards

Corrective maintenance

Fixing residual bugs found after delivery (e.g. a reported crash).

48
New cards

Adaptive maintenance

Adjusting software to environment changes (e.g. a payment provider changed its API).

49
New cards

Perfective maintenance

Improving or adding features because users requested them.

50
New cards

Refactoring

Restructuring code WITHOUT changing observable behavior; excludes bug fixes and new features.

51
New cards

Why keep bug fixes separate from refactoring

So regression tests can confirm the refactoring itself changed nothing.

52
New cards

Feature Envy (code smell)

A method that reaches into another object's data instead of using its own; fix with Move Method. Category: Couplers.

53
New cards

Linter

Parses code into an abstract syntax tree and flags bad patterns regardless of spacing/formatting; passing lint does NOT prove the absence of bugs.

54
New cards

Rust borrow rule

A value can have one mutable borrow OR unlimited shared borrows live at the same time, never a mix (one writer or many readers).

55
New cards

Generics vs downcasts

Generics are checked at compile time, so no downcasts are needed and runtime cast crashes are impossible.

56
New cards

Martin (Clean Code)

Prefer smaller, descriptively named functions and fewer comments; comments go out of date and can be ignored.

57
New cards

Ousterhout (A Philosophy of Software Design)

Comments are valuable documentation of intent and abstraction; deep modules are preferred over many tiny ones.

58
New cards

Visitor pattern

accept() dispatches to the visit method for the element's concrete type (double dispatch); the point is adding new operations without changing the element classes. Traversal of children belongs in the visit methods.