CS35L - Final Key Terms

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

1/67

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:54 PM on 6/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

68 Terms

1
New cards

Debugging Lifecycle

  1. Symptom (find what’s wrong)

  2. Predict (what should the state be?)

  3. Evidence (collect data with the right tool)

  4. Hypothesis (one sentence cause)

  5. Localize (first wrong line)

  6. Fix (minimal change)

  7. Verify (rerun ALL tests)

2
New cards

Fault

Erroneous location in the code (line number where something went wrong)

3
New cards

Error

Incorrect state during program execution (e.g., variable has the wrong value)

4
New cards

Failure/Symptom

Observed incorrect outside behavior (e.g., system crashes, incorrect output displayed)

5
New cards

Rubber Duck Debugging

Debugging process in which you:

  • Formulate mental model of what you want your code to do

  • Explain to the duck hat your code should do, line by line

  • At some point, what you tell your duck will be different from what is actually happening

6
New cards

Code smell

A surface-level indicator in source code that hints at a deeper structural or design problem

7
New cards

Test-Driven Development

The practice of adding tests, running a test, and making small changes (until all tests pass)

8
New cards

Rules of TDD

  1. Do not write a line of production code until you have failing unit tests

  2. Do not write more of a unit test than is sufficient for the test to fail

  3. Do not write more production code than is sufficient to pass the tests

Unit tests and production code will end up being written somewhat concurrently.

9
New cards

Mock Object Pattern

Replaces the DOC (depended-on-component) and verifies the indirect outputs

Ex. test that a trading system sends well-formed buy/sell orders to the stock exchange, without using the actual stock exchange

10
New cards

Test Spy Pattern

Similar to mock object, but with an emphasis on recording what was done so it can be inspected later. The spy collects data, and forwards it to test for analysis.

Ex. tests that the trading system sends buy/sell orders to the stock exchange in the correct order

11
New cards

Test Stub Pattern

Control what is fed into the SUT (system under test). The stub replaces the DOC, feeds pre-programmed responses back to the SUT. This allows us to check the SUT’s behavior under controlled conditions.

Ex. testing that a trading system responds to stock exchanges correctly

12
New cards

SUT

System under test, which sends indirect outputs to the DOC

13
New cards

DOC

Depended-on-component, something external that the SUT talks to (like a database, API, or other service)

14
New cards

Static linking

Bundles all required libraries directly into the executable at compile time, creating a self-contained program with fewer runtime dependencies but a larger file size.

15
New cards

Dynamic linking

Loads shared libraries at runtime, reducing executable size and allowing shared updates, but requiring external library dependencies.

16
New cards

Buffer

A temporary memory area where C stores output before sending it to the screen or file. A newline ("\n") or fflush(stdout) often forces the buffered output to appear immediately.

17
New cards

malloc(…)

Function in the <stdlib.h> library that allocates memory on the heap; the memory is later released with free(...)

18
New cards

Continuous Integration (CI) Workflow

Software development practices in which changes are frequently merged into the main branch—tests are run automatically, making our work faster

19
New cards

Confidentiality, Integrity, Availability

The three main security attributes, denoted by CIA

20
New cards

Confidentiality

Sensitive data must be accessed by authorized users only

21
New cards

Integrity

Sensitive data must be modifiable by authorized users only. The system maintains the accuracy, consistency, and trustworthiness of data over its entire lifecycle

22
New cards

Availability

Critical services must be available when needed by clients

23
New cards

SQL Injections

Common software vulnerability in which a hacker inputs a malicious SQL statement into a user field, causing the system to run that statement. Violates confidentiality and integrity (may disrupt availability too).

We solve this issue with prepared statements and parametrized queries, which essentially use placeholder values for user input within the statement.

<p>Common software vulnerability in which a hacker inputs a malicious SQL statement into a user field, causing the system to run that statement. Violates confidentiality and integrity (may disrupt availability too).</p><p></p><p>We solve this issue with prepared statements and parametrized queries, which essentially use placeholder values for user input within the statement.</p>
24
New cards

Cross-Site Scripting (XSS) Attack

Also known as a Javascript Injection attack; this is what happens when an attacker injects JS code into a trusted site.

The JS code can access cookies, session tokens, or other sensitive information retained by the browser and sent to the attacker.

25
New cards

Zero Trust Principle

Security design principle, which states that users and devices should not be trusted by default. Also, any input might be malicious, so sanitize all inputs.

26
New cards

Security Through Obscurity

Concealing the details or mechanisms of a system to enhance its security. This should NOT be the primary approach, as if implementation details were discovered, vulnerabilities could open throughout the app.

Analogy: putting house key in the flower pot

27
New cards

Open Design Principle

Attackers shouldn’t be able to break into a system simply by understanding how it works. Use robust, public security mechanisms.

28
New cards

Public Scrutiny

Full transparency allows independent experts, researchers, and the security community to examine, test, and critique the design for potential vulnerabilities. Effective when we are proposing a new security approach of algorithm.

29
New cards

Complementary Obscurity

Hide implementation details & configuration details (e.g., version of a particular framework or database) to make it harder to exploit known vulnerabilities. Effective when using existing, publicly scrutinized technology.

30
New cards

Symmetric Encryption

Cleartext (plaintext) is encrypted into ciphertext using a secret key.

Ciphertext can only be decrypted back into cleartext using this secret key.

Ex. AES = Advanced Standard Encryption

31
New cards

Public-Key Cryptography

Goal: encrypt/decrypt data without secretly exchanging a key

Method: large random number is plugged into a special key generating algorithm, which creates a pair of keys

  • Public key is known to EVERYONE

  • Private key is only known to YOU

Public —> private: Alice uses Bob’s public key to encrypt cleartext, only Bob can decrypt and read it w/ his private key

Private —> public: Bob encrypts a document with his private key, Alice decrypts it with her public key (only Bob could have written it)

Ex. RSA = Rivest-Shamir-Adleman algorithm

32
New cards

JSON Web Tokens (JWT)

Form of stateless authentication in which the server generates a JWT (upon initial login) by signing it with a private key. The client then stores this JWT in memory, cookies, or local storage, granting them access throughout the session.

33
New cards

Session Cookies

Form of stateful authentication where the server creates a session record upon user’s initial login (usually in memory, Redis, or a database). The server sends a session ID in a cookie, and the client automatically sends that cookie on future requests. The server uses the session ID to look up the corresponding session and retrieve the user's authenticated information.

34
New cards

Security Plan

Analyzes four aspects of the system, listed below:

  1. Security Model —> what are you defending?

  2. Threat model —> who might be attacking? What is the attacker trying to achieve? Consider the attacker’s knowledge, actions, resources, and incentive

  3. Attack surface —> which parts of the system are exposed to an attacker?

  4. Protection mechanisms —> how do we prevent an attacker from compromising the system?

35
New cards

Principle of Least Privelege

Every program and every privileged user of the system should operate using the least set of privileges necessary to complete the job

<p>Every program and every privileged user of the system should operate using the least set of privileges necessary to complete the job</p>
36
New cards

Internal Reuse

Code was written by the same developer, team, or organization that is reusing it (e.g., product lines)

37
New cards

External Reuse

Code was written by a 3rd party (e.g., commercial off-the-shelf, open-source libraries, and so on)

38
New cards

Design Principles w/ External Reuse

  • Minimize package dependencies

  • Avoid reusing trivial code

  • Analyze supply chain for weaknesses and risks

  • Defects in popular modules are usually fixed quickly

39
New cards

Designing w/ Internal Reuse

  • Check documentation and code to identify assumptions made by a reuse candidate

  • Check to make sure that reusable software was designed to operate reliably under the conditions you want

  • Always test the reuse candidate’s code

40
New cards

Design Doc

Early-stage document that serves as a high-level outline of a product before software implementation. Consists of: context and scope, goals/non-goals, the actual design, and alternatives considered.

Allows for early identification of design issues, transfers knowledge of senior engineers, achieves design consensus in organization, forms organizational memory regarding such decisions, and acts as a summary artifact in a SWE’s technical portfolio.

Practiced by companies like Google and AWS.

41
New cards

“Hollywood Principle” of Inversion of Control

In a library, you are in charge of the flow (code calls library when it needs something, like in axios). In contrast, a framework calls your code at predefined points (like Express). It’s like Hollywood—an actor auditions, but they call an actor.

42
New cards

Large Language Models

Non-deterministic, advanced artificial intelligence systems designed to understand, process, and generate human language. Their training workflow is:

  1. Pre-training (creating foundation model)

  2. Post-training (model optimization)

  3. Inference (prompting the model)

43
New cards

Information Hiding Principle

Begin with a list of difficult design decisions, or decisions that are likely to change. Then, create software that abstracts away those design decisions behind a neat interface that does not reveal any volatile information.

<p>Begin with a list of difficult design decisions, or decisions that are likely to change. Then, create software that abstracts away those design decisions behind a neat interface that does not reveal any volatile information.</p>
44
New cards

Interface

Part of a software module that should be visible. This is a stable contract that describes what the module does.

45
New cards

Implementation

Part of a software module that should be hidden. This is how the module fulfills the contract, and can be changed freely without affecting the rest of the system (as long as the rest of the interface remains the same).

46
New cards

Module Design Principles

  • Deep modules: hide a lot of code under a small interface (preferred over shallow modules)

  • Modules should have low coupling (dependencies between different modules) and high cohesion (dependencies within the same module)

47
New cards

Syntactic Dependency

Component A cannot be compiled/interpreted without Component B

48
New cards

Semantic dependencies

Component A does not function properly without Component B (changing B requires changing A).

49
New cards

Single Choice Principle

Whenever a software system must support a set of alternatives, one and only one module in the system should know the exhaustive list (e.g., supported payment methods). This way, when adding a new alternative, only one module needs to change.

50
New cards

Beacons

Key lines of code, recognizable variable names, or distinct structures that reliably indicate the presence of a specific operation or algorithm. Types of beacons include:

  • Function/var names

  • Physical layout

  • Guard clauses (signal exit paths)

  • Tests

  • Assertions

  • UML diagrams (help build top-down mental model)

51
New cards

Global Distribution System

A computerized network system that acts as a central hub connecting travel providers (like airlines, hotels, and car rentals) with travel agencies and corporate bookers.

52
New cards

Interoperability

The degree to which systems are able to meaningfully exchange data.

53
New cards

Bottom-Up

Novice approach to understanding code, in which you read code line by line and group statements into logical chunks; takes more time.

54
New cards

Top-Down

Expert workflow or reading code, driven by a hypothesis of what the code does. Reviewers understand the big picture first before looking for details.

55
New cards

Shared Interfaces

A design principle for making systems that have interoperability, where you:

  1. List all data that needs to be exchanged

  2. Define an interface/data format that supports all data

  3. Implement serialization (convert internal data to shared format) and deserialization (read shared format back into its own representation)

56
New cards

REST APIs

Stateless protocol (no server-side session) to exchange data in client-server systems via HTTP / HTTPS. Common commands include:

  • POST - creates a resource

  • GET - reads a resource

  • PUT - updates a resource

  • DELETE - deletes a resource

URL naming conventions based on resource identifiers, like “/users/123”

57
New cards

RPC (Remote Procedure Call)

Calling a function on a remote server as if it were local. Can be stateful. Functions and actions beyond CRUD. Good for complex calculations. Can use multiple document formats.

58
New cards

SOAP (Simple Object Access Protocol)

Can be stateful. More complex. Sometimes slower. Has more security features. Has built-in error handling. Good for distributed enterprise environments. Uses XML.

59
New cards

GraphQL

Server-side schema defines types, enabling checking of data structure conformance. Good for large, complex, and interrelated data sources. Uses JSON.

60
New cards

Schema (XML, JSON, YAML)

File that describes the structure of a document. Lists attributes, possible values, complex types, etc. Validation of document against a schema can be done automatically to test compatability at run-time.

61
New cards

Syntactic Interoperability

Data must be in the right format—correct types, correct structure (e.g., force should be represented as a floating-point number).

<p>Data must be in the right format—correct types, correct structure (e.g., force should be represented as a floating-point number).</p>
62
New cards

Semantic Interoperability

Data means the same thing to both systems (e.g, one might measure force in Newtons, while another might measure force in customer units).

Describe things like:

  • Side effects

  • Usage restrictions

  • Error handling

  • Examples

<p>Data means the same thing to both systems (e.g, one might measure force in Newtons, while another might measure force in customer units).</p><p></p><p>Describe things like:</p><ul><li><p>Side effects</p></li><li><p>Usage restrictions</p></li><li><p>Error handling</p></li><li><p>Examples</p></li></ul><p></p>
63
New cards

Changeability

The ability of a system to evolve so that it meets user needs. The cost of changing shared interfaces grows with the number of systems using it, causing this principle to often conflicts with interoperability.

64
New cards

Implementation effort vs. variability

Simple interfaces are easy to adopt but break when requirements change. A hyper-flexible interface handles many cases, but is very difficult to implement.

65
New cards

Adapters

A design pattern for interoperability. We use them to connect interfaces.

If my system uses XML and another person’s uses JSON, we can use this component to translate between my system and their system.

66
New cards

Red-Green-Refactor

A three-step development cycle used in Test-Driven Development (TDD).

  • R: Write a new test for a desired behavior and run it. The test fails because the functionality has not been implemented yet.

  • G: Write the simplest possible code that makes the failing test pass.

  • R: Improve or reorganize the code without changing its behavior, ensuring all tests continue to pass.

67
New cards

Bus factor

The minimum number of people that must leave a project for it to fail.

68
New cards

Test oracle

A mechanism or source of truth used in software testing to determine whether a test case passes or fails. It provides the expected output or behavior for a given input, allowing the system's actual results to be evaluated.