chapyer 9 static checking

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

1/44

encourage image

There are no tags or description

Looks like no tags are added yet.

45 Terms

1
New cards

Static checking

Finding problems by examining the software without executing it

2
New cards

Why can’t i just write tests instead?

Static checking finds defects earlier, defects that cannot be found by tests, and transfers knowledge to engineers.

3
New cards

Architecture review

Structured examination of a systems design-major components, their responsibilities, and connections. Architectural mistakes are the most expensive kind.

4
New cards

How to conduct an architecture review

Review against concrete scenarios, started should not run the room but explain and listen, focus on hard to change and costly decisions, and end with recourses decisions, assigned owners, and follow up actions.

5
New cards

The purpose of architecture reviews is to

Review risks and assumptions

6
New cards

Discovery review

Happens early when design still forming, Map problem space, name major components, identify big risks, validity no requirements are forgotten, exploratory and generative.

7
New cards

Deep-dive review

Happens when a shape is setttled but a specific area carries outsized risk.

8
New cards

Retrospective review

Happens after system is built and running, “did the architecture actually deliver what we had hoped?”

9
New cards

Software inspection

Examines concrete work product-source code

10
New cards

Fagan inspection

Planning, overview, preparation, meeting, rework, follow-up

11
New cards

Inspections are about fixing or confirming that a defect needs to be fixed?

Confirming a defect needs to be fixed

12
New cards

Planning

Author and moderator decide what will be inspected. Choose participants, keep chunk small

13
New cards

Preparation

Each reviewer examines work individually and in advance

14
New cards

Meeting

Reader walks through material, reviewers raise issues found during prep, scribe records each defect, finds and records defects

15
New cards

Rework

Author takes logged list and fixes each item.

16
New cards

Follow up

Moderator verified every logged defect was addressed.

17
New cards

Preparation rate

Lines of code each reviewer read per hour before meeting

18
New cards

Defect density

Defects found per lines of code

19
New cards

Author

The person who wrote the work product, job is to listen

20
New cards

Reviewer

Person who finds defects. Do prep work beforehand. Raise issues in meeting.

21
New cards

Reader

Paraphrase the material aloud during the meeting, restating what each prove of code does in their own words

22
New cards

Moderator

Facilitator who enforces find dont fix, watching pace.

23
New cards

Scribe

Person who logs each defect with location, description, severity,

24
New cards

Code review

Before a change is merged, at least one engineer other than the author reads and approves it.

25
New cards

Intent

Does this change do what the author meant it to do? Is what they meant actually the right thing to do?

26
New cards

Trust

Code review is how a team collectively takes responsibility for its codebase. A change approved is everyone’s code, not just the authors

27
New cards

Repository stewardship

Does this change make the repository healthier over time.

28
New cards

Invested expert reviewer

Knows the history of why code is slides this way, and should be the one reviewing the code

29
New cards

Code ownership

Files have designated owners whose approval is required for changes there to guarantee an invested expert sees every change

30
New cards

Review latency

Teams should respond within hours, not days.

31
New cards

Automated static analysis

The use of tools that examine source code without running it and report likely defects.

32
New cards

Type checkers

Verify that operations are applied to compatible types of data. Don’t add a number to a string, call a method that doesnt exist, etc.

33
New cards

Linters

Catch stylistic issues like missing break in a switch, comparison that is always true, unused variables

34
New cards

Formatters

Rewrite the file into one simple layout of indentation, line breaks, and spacing

35
New cards

Data flow analyzers

Trace how values move through a program to find defect that span multiple lines, a variable used before it’s assigned, a resource on one path but not closed on another.

36
New cards

Big finders

Encode a catalog of known-bad code shapes and scan for them

37
New cards

Precision

The fraction of tools alarms that are real. How much was an actual defect, Real bugs/total flagged

38
New cards

Low precision

Many false positives

39
New cards

Recall

Caught bugs/Real Bugs

40
New cards

False positive rate

FP/(FP+TN)

41
New cards

30% false positive rate means

30% of warnings are false alarms

42
New cards

False discovery rate

1-precision

43
New cards

Static-analysis tools choose precision over recall or recall over precision

Precision

44
New cards
45
New cards