







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








(1 pt. each) Read the following narrative. Fill in each blank with the single most specific or appropriate corresponding concept from the answer bank. (Each blank does have exactly one corresponding answer.) Each option can be used more than once. A. Alpha Testing B. Agile Development C. Beta Testing D. Build Automation E. Comparator F. Dataflow Analysis G. Development Process H. Dynamic Analysis I. Formal Code Inspection J. Invariant K. Integration Testing L. Maintainability M. Mocking N. Oracle O. Passaround Code Review P. Path Predicate Q. Perverse Incentive R. Quality Property S. Risk T. Requirements V. Software Metric W. Spiral Development X. Static Analysis Y. Threat to Validity Z. Waterfall Model
(a) The database company Debacle decides to adopt a procss where they deliver prototypes every three months. Each prototype phase, they gather any changing requirements, design and implement software that meet these new requirements, and deliver the next prototype.
(b) In class, we discussed pacemaker software that allowed attackers to kill patients by wirelessly disabling pacemakers. A company responsible for such software can consid- ering adopting various processes to help account for this aspect of project delivery. (c) The manager of the Sprightly Software Company decides to plan effort in two-week sprints, with daily stand-up meetings.
(d) The Obscure Song Identifier API allows you to upload audio files and returns a string containing the song’s title and artist. However, each invocation of this API costs $1.00. To save development costs, you hardcode the string “Qing Fei De Yi – Harlem Yu” every time your software tries to invoke that API. (e) The new intern uses this set of scripts to specify gcc-9 and pass -O2 to compile the company’s program on their computer. (f) Your teammate, Walter Melon, never documents any of their code. When your new intern joins during the summer, you have to spend several hours with the intern walking through and explaining the code. If only Mr. Melon had considered this aspect of software and code. (g) In an effort to reduce networking costs, the video streaming service YouKu compresses all videos, saving 50% on networking costs. However, users begin complaining of un- watchable, blurry videos. Even if the service works fine, YouKu may consider improving video quality to improve the end user’s experience.
(h) In an effort to improve the readability of your code, your teammate reduces its Hal- stead volume. He says that maintainable code must have a minimal Halstead volume. However, you point out that his most recent commit was an unreadable mess with a deceptively low Halstead volume. What does that say about the applicability of the Halstead volume?
Consider the following program. Statements of interest are labeled S 1 through S 5. 1 int amazing ( int x , int y , int z ) { 2 if ( ( x + y ) < 1 ) { 3 S_1 ; 4 if ( y != 2 ) { 5 S_2 ; 6 } else { 7 S_3 ; 8 } 9 } 10 if ( x > 0 || y == 0 || z < 2 ) { 11 S_4 ; 12 } else { 13 S_5 ; 14 } 15 }
(a) (1 pt. each row) In the table below, identify integer values for x, y, and z that result in the coverage specified in the table, or indicate that it is not possible.
Statements covered x y z Not possible
Next, consider the function below. Against, statements of interest are labelled S 1 through S 4. 1 int ShuaiDaiLe ( int x , int y , int z ) { 2 if ( y != 3 ) { 3 S_1 ; 4 if ( x > 0 && x != 3 ) { 5 S_2 ; 6 } else { 7 S_3 ; 8 } 9 } 10 if ( x <= 0 || y > 2 ) { 11 S_4 ; 12 } 13 }
(b) (2 pts. each row) In the table below, you are given values of x, y, and z. In the corresponding blanks, fill in the Path Coverage count for each test case (i.e., report how many unique paths are executed; do not report a percentage).
x y z Path coverage (count)
(c) (2 pts.) Identify any one path predicate from the program above that executes a unique path through the program.
(d) (1 pt.) What program was used to produce coverage in libpng?
(e) (1 pt.) Give one example of a tool used for code review.
(f) (1 pt.) In a few words, identify which phase of software development costs the most amount of money and resources?
(g) (3 pts.) A fresh startup called FaceBack has designed software that can identify the back of a person’s head given a picture of their face. Some team members support adopting an official company list restricting which programming languages can be used as the team grows. In three or fewer sentences, support or refute the use of such approved programming language lists in terms of risk management and process.
(h) (2 pts.) Suppose you are building a large C program that comes with a configure script. Further suppose that you want to use a custom version of gcc located in /usr/local/bin/481-gcc and pass the flags -O3 -Wall. Assuming you are working in the same directory as the configure script. Identify the command input to successfully configure this project.
(i) (3 pts.) Identify two risks associated with adopting dynamic analysis techniques at a company that currently does not use any. Identify a measurement that could be used to reduce each risk.
Consider the code snippet below: 1 int rose ( int a , int b ) { 2 int x = 0; 3 4 if ( a <= 0 || b <= 0 ) { 5 return -1; 6 } 7 if ( a > 6 || b > 6) { 8 return -1; 9 } 10 11 if ( a == 3 || a == 5) { 12 x += ( a - 1); 13 } 14 if ( b == 3 || b == 5) { 15 x += ( b - 1); 16 } 17 return x ; 18 }
(a) (3 pts. each row) In the table below, several candidate invariants are listed. For each candidate, EITHER (1) specify a test case in terms of a and b that falsifies the candidate, OR (2) identify a first-order mutant that leads you to retain the candidate. (Fill in the appropriate column).
Invariant Description a b Falsifying mutation (if needed)
rose <= 2b for all a and b On Line , change to
rose <= 2a for all a and b On Line , change to
rose <= a + b for all a and b On Line , change to
rose < 12 for all a and b On Line , change to
rose >= 0 for all a and b On Line , change to
Consider a live variable dataflow analysis for three variables, a, b and c. We associate with each variable a separate analysis fact: either the variable is possibly read on a later path before it is overwritten (live) or it is not (dead). We track the set of live variables at each point: for example, if a and b are alive but c is not, we write { a, b }. The special statement return reads, but does not write, its argument. (You must determine if this is a forward or backward analysis.)
(a) (18 pts.) Complete this live variable dataflow analysis for a, b and c by filling in each Live Vars. box with the set of live variables just before that point in the program.
START
if a < b
Live vars: (B1)
a = b * 2
Live vars: (B2)
b = b - 1
Live vars: (B3)
return a
Live vars: (B4)
b = a + 1
Live vars: (B5)
if a < 5
Live vars: (B6) (^) a = a - 1
Live vars: (B7)
while c < a
Live vars: (B8) c = c + 1
Live vars: (B9)
b = c - 1
Live vars: (B10)
return b
Live vars: (B11)
(b) (2 pts.) Support or refute the claim that a statement with no live variables can be removed without affecting the program’s correctness.
(a) (Feedback) What is your least favorite thing about this class?
(b) (Feedback) What is your most favorite thing about this class?
(c) (Pyschology) Provide an example of confirmation bias.
(d) (Psychology) Explain the McNamara fallacy in your own words.
(e) (Random) What is your favorite text editor?
(f) (Your Choice Reading) Identify any optional reading. Write a sentence about it that convinces us that you read it critically. (Our subjective judgment applies here!).
(g) (Your Choice Reading 2) Identify any different optional reading. Write a sentence about it that convinces us that you read it critically. (Our subjective judgment applies here!).