Construction
-
Create a test suite that will test every branch of the
calculate()
method in the
following Utility
class. Note: Do not use
JUnit. Just list the value of x
and
y
and the expected return value for each test case.
Hint: Recall that we distinguished between branch
coverage, condition coverage and multiple condition
coverage. This question is about branch coverage.
public class Utility
{
public static int calculate(int x, int y)
{
int a, b;
do
{
a = 1; // S1
if (x > y) // S2
{
a = 2; // S3
}
x++; // S4
b = x * a; // S5
}
while (b <= 0); // S6
return b; // S7
}
}
-
Suppose
S2
above was changed to
if ((x > y) && (x < 100))
, how many branches
would need to be covered (for 100% branch coverage)?
-
How many branches would need to be covered (for 100% branch coverage)
in the following statement:
if ((i < 0) || (i > 10))
?
-
How many conditions would need to be covered (for 100%
condition coverage) in the following statement:
if ((i < 0) || (i > 10))
? Hint: This question is
about what we call condition coverage (i.e., what EclEmma/JaCoCo
mistakenly calls branch coverage).
-
Briefly, but carefully, define each of the following terms:
Debugging
|
|
|
Regression Testing
|
|
|
Static Analysis
|
|
|
Test Case (or Test Point)
|
|
|
Trigger Condition
|
|
|
-
Compare and contrast two different kinds of code review.
-
Define the term "Test Driven Development".
-
List three different kinds of conventions that are often included
in style guides.
-
Order the following debugging actions (which are currently in
alphabetical order) based on when they would be performed in the
normal work cycle. You may use an action more than once.
- Correction
- Globalization
- Localization
- Stabilization
- Verification
-
Carefully explain how tools can be used to make alpha testing more efficient.
You must think about the problem both from the perspective of the tester and
the programmer.
-
Explain how "assert methods" are used in JUnit testing.
-
For this question you must create a simple Java class
and a JUnit test suite for it.
-
Create a
Money
class that satisfies all of
the following specifications.
- It must have a
dollars
attribute.
- It must have a
cents
attribute.
- The
cents
attribute must never be greater than
or equal to 100. If a call to any method would result in such
a value, that method must adjust both the cents
and
dollars
attributes appropriately.
- It must have a default constructor that creates a
Money
object with 0 dollars
and 0 cents
.
- It must have an explicit value constructor that is passed
in the initial value for
dollars
and
cents
.
- If the explicit value constructor is passed a negative value
for either
dollars
or cents
both attributes must be initialized to 0.
- It must have an
increaseBy()
method that is
passed another Money
object and increases the
owning object accordingly.
- It must have a
toString()
method that returns
a string representation of the owning object formatted
appropriately (i.e., with a leading '$', a '.' between the
dollars
and cents
, and exactly
two digits for the cents
.
-
Create a JUnit test suite that could be
used to test the
Money
class in the previous
question. Your test suite must have 100% statement and branch coverage,
and must use appropriate value heuristics.
-
Given the obvious implementation (without any validation of parameters)
of the
Coin
class in the following UML diagram:
-
Write a suite of JUnit tests that covers every method, statement,
and branch in the
Coin
class.
-
Given the information you have available to you, why could you not
write such a JUnit test suite for the
Metal
class, even
though it only has one method?
Deployment, Support, and Maintenance
-
Briefly, but carefully, define each of the following terms:
Preventive Maintenance
|
|
|
Response Time (as it is used in Maintenance)
|
|
|
Physical Architecture
|
|
|
-
Carefully explain the difference between the following two physical
architectures: mainframe and cloud.
-
The following UML Deployment Diagram describes the way in which
the (fictitious) company Nearby deploys their product named
DogGone, a GPS-equipped dog collar monitoring system.
-
Is the DogGoneTracker "permanently" installed on the user's
smartphone or is it installed each time it is used?
-
Is the DogGoneReporter "permanently" installed on the DogGoneCollar
or is it installed each time it is used?
-
What maintenance issues arise as a result of your answers to
the previous two questions?
-
On which device is the correspondence between pets and owners
determined.
-
How much data bandwidth (in a qualitative sense) is required
by this deployment? Explain.
-
Explain the difference between synchronous support and asynchronous support.
Which is provided by the JMU Help Desk?
Project Management
-
Describe two (we discussed four) different management activities. In Scrum,
which participants are responsible for each of these activities?
-
The following questions are all concerned with burn-up charts.
- In a burn-up chart, earned value can be measured
in a variety of different ways, one of which is
story points. Provide a concise definition of story points.
-
Describe the shape of the plot of the planned value (in a burn-up
chart) when story points are used.
-
In a burn-up chart with the business value measure in dollars
on the vertical axis and the sprint number on the horizontal axis,
how do you find the schedule variance measured in dollars at the end
of a particular sprint?
-
In a burn-up chart with the business value measure in dollars
on the vertical axis and the sprint number on the horizontal axis,
how do you find the schedule variance measured in weeks at the end
of a particular sprint?
-
Using regression analysis and industry-wide data about effort, \(E\)
(measured in person-months), and output measured in thousands of lines
of code, \(L\) or measured in function points, \(F\),
Basili and Freburger (1981) estimated the following relationship:
\[
E = 1.38 L^{0.93}
\]
whereas Kemerer (1987) estimated the following relationship:
\[
E = -37.0 + 0.96 F
\]
-
Using the Basili and Freburger model, about how much effort
is required to produce 2000 lines of code?
-
Current estimates are that, in languages like C++, Java and
JavaScript, every function point corresponds to about 50 lines
of code. Using this correspondence and the Kemerer model,
about how much effort is required to produce 2000 lines of
code?
-
In bottom-up integration testing, after the modules are
unit-tested they are iteratively combined into subsystems and
tested. This means that the larger subsystems can't be tested
until after the smaller subsystems are.
Suppose for a given product the testing dependencies and testing
times (in days) are as follows:
Subsystem
|
Earlier
|
Optimistic
|
Likely
|
Pessimistic
|
to Test
|
Subsystems
|
Time
|
Time
|
Time
|
1 |
|
1 |
3 |
5 |
2 |
1 |
4 |
5 |
12 |
3 |
1 |
2 |
3 |
4 |
4 |
1 |
3 |
5 |
7 |
5 |
2 |
2 |
3 |
10 |
6 |
3,4 |
2 |
5 |
20 |
7 |
4 |
4 |
5 |
12 |
8 |
2,5,6 |
2 |
4 |
12 |
9 |
6,7 |
1 |
3 |
5 |
10 |
8,9 |
2 |
4 |
18 |
where the optimistic time is denoted by \(t_o\), the (most) likely
time is denoted by \(t_m\), and the pessimistic time is denoted
by \(t_p\).
-
Assuming the expected time to test each subsystem is given by
\(
E[t] = \frac{1}{3}\left[ 2 t_m + \frac{1}{2} (t_o + t_p) \right]
\),
calculate the expected time to test each subsystem.
-
Construct a dependency graph for this test plan using the
expected times as the task times.
-
Using the algorithm we discussed in lecture, find the
critical path. Show your work on the dependency graph.
-
How much can the testing of subsystem 6 slip without changing the
total time required to test?
-
How much can the testing of subsystem 3 slip without changing the
total time required to test?
-
The Harrisonburg Kennel Club has become very interested in using a
customized version of DogGone, a GPS-equipped dog collar
monitoring system, at their events starting next year (for a
period of 10 years). Nearby (the company that
developed DogGone) has told them that it will cost
$100,000 to develop the custom version (with payment required up
front). Alternatively, the Harrisonburg Kennel Club can license a
competitor's existing product for $10,000 for the first 5 years and for
$15,000 for the next 5 years (with payment required at the start
of each year).
Given that the Harrisonburg Kennel Club can borrow money at an
interest rate of 4%, that they must enter into a 10 year contract,
and that they will use the software for exactly 10 years, should
they buy the system from Nearby or license the competitive
product? In other words, calculate the present value of the lease
and compare it to the up-front cost of the purchase. Show all of
your work.
Comprehensive Questions
-
Indicate the best match for each of the following:
_____
|
A visualization used for performance tracking |
_____
|
A visualization used for scheduling |
_____
|
A visualization of a physical architecture |
|
- A Gantt Chart
- A Burn-Up Chart
- A UML Deployment Diagram
|
-
Indicate the best match for each of the following:
_____
|
Talking to a user to improve their experience |
_____
|
Performing unit tests |
_____
|
Keeping the product usable in a changing environment |
_____
|
Installing the software on the physical architecture |
_____
|
Acquiring necessary resources |
|
- As Part of Project Management
- During Implementation/Construction
- During Deployment
- While Providing Support
- During Maintenance
|
Tools
-
Indicate the best match for each of the following:
_____
|
A testing framework |
_____
|
A dynamic analysis tool |
_____
|
A Java documentation tool |
_____
|
A static analysis tool |
_____
|
A code management tool |
|
- JUnit
- Git
- EclEmma/JaCoCo
- Checkstyle
|