COMP 5970/6970 Homework Assignment 1 Flashcards

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

1/23

flashcard set

Earn XP

Description and Tags

Flashcards generated from the multiple-choice questions and answers in Homework Assignment 1.

Last updated 8:33 PM on 9/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

24 Terms

1
New cards

What is identified as a popular approach to mitigating bugs in software engineering in Question 1.1.1?

Static analysis.

2
New cards

According to Question 1.1.2, what statements are true regarding the definition of a bug?

A bug is a static defect in the code (e.g., a typo in writing a variable name), refers to the erroneous state due to a typo in the code, and faults, errors, and failures are collectively known as bugs.

3
New cards

Which criterion is NOT used to identify a leader statement when constructing basic blocks for a Control-Flow Graph (CFG)?

The last statement executed inside a loop body before the loop repeats.

4
New cards

What is the correct relationship between the project phase and the cost of finding and fixing a software fault?

Finding and fixing a fault is cheapest early in the project, and the relative cost rises rapidly the later the fault is discovered.

5
New cards

In the Java class C, why is there a fault in the loop for (int i = 1; i < args.length; i++) when attempting to print command-line arguments?

Arrays in Java are 0-based, so the loop should start from index 0 rather than index 1 to process all command-line arguments.

6
New cards

Why is manual code review considered problematic in software engineering?

Manual code review is subject to bias, programmers can miss faults, and it is hard to measure progress.

7
New cards

Why do software faults, unlike hardware faults, NOT "reappear" due to aging?

Software does not physically degrade over time, so its faults originate from programmer mistakes rather than the aging of parts.

8
New cards

In the numZero function where the loop incorrectly starts at index 1 instead of 0, what are the resulting error and failure on input [0, 2, 7] (expected output 1, actual output 0)?

The error is that i starts at 1 instead of 0, so index 0 is never checked. The failure is that count is 0 instead of 1 at the return statement.

9
New cards

How do validation and verification differ as goals of software testing?

Validation evaluates software at the end of development to ensure compliance with intended usage, while verification determines whether the products of a given phase fulfill the requirements established during the previous phase.

10
New cards

Which category of static analysis is capable of being sound, meaning it produces no false negatives?

Abstract interpretation-based static analysis.

11
New cards

According to the assignment notes, why does software often come with bugs?

Useful software systems are complex, and in order to remain useful, software systems must evolve to the changing requirements of the users. Building and changing a complex system is inherently error prone.

12
New cards

What are the distinct trade-offs/limitations associated with verification and static analysis?

Verification has a high learning curve and poor scalability, whereas static analysis has limited applicability and produces false positives/negatives.

13
New cards

What is the accurate historical facts regarding the origin of the term "bug"?

Thomas Edison used the term "bug" to describe design difficulties decades before Grace Hopper's team documented an actual moth causing a relay malfunction in 1947.

14
New cards

What real-world consequences were caused by the NASA Mars lander fault and the THERAC-25 incident?

NASA's Mars lander crashed due to a unit's integration fault, and the THERAC-25 radiation machine's poorly tested safety-critical software resulted in patient deaths.

15
New cards

What primary limitation is shared by automated testing techniques such as property-based testing, fuzzing, and feedback-directed random testing?

In most cases they cannot cover all possible executions and need a test oracle.

16
New cards

What is the definition of a basic block in a control-flow graph (CFG)?

A maximal sequence of statements that can be entered only at the first statement and exited only from the last statement.

17
New cards

How many basic blocks are in the control-flow graph of the fib(int m) routine provided in Question 1.1.17?

6 basic blocks.

18
New cards

Given a CFG G=N,EG = \langle N, E \rangle, what condition does NOT justify the existence of an edge from basic block i to basic block j?

Blocks i and j declaring variables of the same data type is NOT a valid condition for an edge.

19
New cards

What branch coverage is achieved on testMe by a test suite consisting of testMe(0, true, false) and testMe(0, false, true)?

100% branch coverage.

20
New cards

If a test suite achieves 100% path coverage on a program, what statement coverage and branch coverage does it guarantee?

It guarantees both 100% branch coverage and 100% statement coverage due to subsumption.

21
New cards

Why is 100% path coverage generally considered impractical for a routine containing a single unbounded while loop?

The number of distinct paths through the loop can be infinite, making 100% path coverage infeasible to achieve or even enumerate.

22
New cards

What type of mutation operator transforms if (a && b) into if (true), and how does it compare to replacing a && b with a || b?

Both are Conditional Operator Replacement (COR) mutations; the first replaces the whole condition with a constant while the second swaps one logical operator for another.

23
New cards

What is weak mutation testing, and what is its main drawback?

Weak mutation testing kills a mutant as soon as its execution causes a change in internal program state without checking whether that change actually propagates to the observable output. Its drawback is imprecision because some mutants marked as killed may not actually be killed under the stricter (strong) definition.

24
New cards

How does software testing compare overall to code review, static analysis, and verification?

Testing is more reliable than code review, has fewer false positives and is more broadly applicable than static analysis, and has virtually no learning curve compared to verification.