







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An exam for the course EECS 481 - Software Engineering, held in Spring 2020. The exam consists of seven questions with multiple parts, and it is open book, notes, and internet. The exam will be graded on correctness and clarity, and it must be completed within two hours. The exam-answers.txt file must be submitted to the course website. a narrative with blanks that must be filled with the most appropriate corresponding concept from the answer bank.
Typology: Exams
1 / 13
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) A developer decides to use gdb to debug a segmentation fault at runtime.
(b) The manager of the Sprightly Software Company decides to plan effort in two-week sprints, with daily stand-up meetings. (c) The leadership of a software company decides to provide bonuses to developers based on the average number of bugs fixed per 1,000 lines of code.
(d) 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. (e) 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. (f) While inspecting a program with many sequential if statements, you carefully design a test input that causes a specific set of if statements to be taken. (g) 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?
(h) Visual Studio embeds a numerical computation for approximating the complexity of code. (i) The company Repo Men writes software for prosthetic hearts. They should consider adopting a process for thoroughly discovering defects. One manager proposes gathering a team of five engineers to prepare comments and evaluate checklists with respect to source code. (j) A function Circumference accepts a single floating point parameter, radius, always returns the value 2PIradius.
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 > 0 ) { 3 S_1 ; 4 if ( z < 3 ) { 5 S_2 ; 6 } else { 7 S_3 ; 8 } 9 } 10 if ( x != -1 || y == 0 && z > (2 * y ) ) { 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 ( x != 1 ) { 3 S_1 ; 4 if ( y > 3 && z < 0 ) { 5 S_2 ; 6 } else { 7 S_3 ; 8 } 9 } 10 if ( x > 1 && y == x ) { 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) (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.
(e) (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.
(f) (2 pts.) Consider a program with five sequential if statements that accepts five boolean inputs. Assuming each condition evaluates a single unique input, what is the minimum number of test cases required to achieve 100% Path coverage? Condition coverage?
(g) (3 pts.) In three or fewer sentences, support or refute the claim that Microsoft’s Maintainability Index helps identify difficult-to-read code.
(h) (1 pt.) Give one example of a tool used for code review.
(i) (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.
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 is nonnegative and even for all a and b On Line , change to
rose is even for all a and b On Line , change to
rose <= a + b for odd a and b On Line , change to
rose < 12 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 c < 5
Live vars: (B1) c = c - 1
Live vars: (B2)
while c < a
Live vars: (B3) (^) c = c + 1
Live vars: (B4)
a = c + 1
Live vars: (B5)
c = a - 1
Live vars: (B6)
if b < c
Live vars: (B7)
b = c * 2
Live vars: (B8)
c = c - 1
Live vars: (B9)
return b
Live vars: (B10)
return c
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!).