You are on page 1of 17

Read the instructions carefully before you start!

This is a closed-book, open-​page ​ exam with the following restrictions:

● Notes on both sides of a single sheet of letter-sized (8.5”x11”) paper is allowed. No other form
of notes is allowed.
● A simple calculator is allowed. Beyond that, no electronic devices, including cell phone, tablet,
or laptop computer, is allowed. All electronic devices must be turned off for the entire duration
of the exam. There will be no exceptions. Your exam will be voided, you will get 0 points, if any
violation is reported by the proctor.

Print your answers clearly in the space provided after each question. Attach extra sheets of paper if
additional space is needed. Illegible answers will be marked as incorrect. In your answers, you may
only use proper English words and acronyms defined in the lecture notes.

For question 10, if you need additional grid space, there are 2 extra pages of empty grid for this
purpose.

Please note that the sum of the question points in this exam is 90 points

Good luck!
Question 1​: Error vs. Defect vs. Failure (8 points)
1. A team was hired to build a software system for a new automobile. The customer stated that if
the oil temperature in the engine exceeds 275 degrees, a warning light should be shown on the
dashboard.
2. Sam, who is responsible for writing the requirements for the system wrote down the wrong
instruction.
3. When the requirements were published for inspection, the document said, “If the oil temperature
ever reaches 300 degrees, a warning light should be shown on the dashboard”.
4. During software construction, developers built functions and tests to support the written
specifications.
5. When the vehicle was actually stress tested on the road, it was discovered that the warning light
did not come on when the customer expected it to and in fact some test vehicles were damaged
during the tests.

1.a) List the errors committed in this scenario. Explain what makes the element an error.

1.b) List all the defects in this scenario. Explain what makes the element a defect.

1.c) List all the failures in this scenario. Explain what makes the element a failure.
1.d) What processes or practices might have allowed the team to find the oil temperature problem
earlier in the development process?

Question 2​: (8 points)


1. An online shopping application allows the customer to add items to a shopping cart.
2. It normally functions pretty well but if the customer adds more than 30 items to the cart, a
message box pops up that says something about “​ArrayIndexOutOfBoundsException”​ followed
by a stack trace that is meaningless to the customer.
3. The code that implements the shopping cart stores the potential purchases in a fixed length
array, which is 30 elements long.
4. The developer who implemented the feature assumed that no one would ever order more than
30 items.
5. The specifications contained no requirement to limit the number of items purchased.
6. The specifications did say that any server side errors (that is, not user input errors) should
produce a dialog that says “Oops, something went wrong on our end! Please try again. If the
problem persists, please contact technical support”.

2.a) List the errors committed in this scenario. Explain what makes the element an error.

2.b) List all the defects in this scenario. Explain what makes the element a defect.
2.c) List all the failures in this scenario. Explain what makes the element a failure.

2.d) How likely is it that the software was delivered with no one being aware of this problem? Explain
your answer.
Question 3. ​(12 points total, 2 points each question) For each of the following statements (3.1 – 3.6),
determine if it is ​true ​or ​false.​

3.1. The purpose of software testing is to demonstrate the absence of defects.


True False

3.2. Functional testing, i.e., black box testing, cannot start until the code is complete.
True False

3.3. Structural testing, i.e., white box testing, makes functional testing unnecessary.
True False

3.4. Beta testing is performed by test professionals following tightly controlled scripts.
True False

3.5. Exhaustive testing, with sufficient effort and tool support, is feasible for all software.
True False

3.6. ​Random ​testing is to test a software system without careful planning and without using any
particular methods or techniques.
True False
Question 4​: (12 points total, 2 points per question) Validation vs. Verification (A - F). Use this list of
test types for questions B, C, E and F.

Unit testing Usability testing


Beta testing Regression testing
System testing Alpha testing
Integration testing Performance testing

a. If you are attempting to test whether a software product truly meets the customer’s need, that
activity is called (pick one)

1. Validation
2. Verification

b. Select 2 tests from the list above to help you in this activity. List them below.

c. Select 1 test from (b) above and explain how it helps in this activity.

d. If you are attempting to test whether a software product meets its specifications, that activity is
called (pick one)

1. Validation
2. Verification

e. Select 2 tests from the list above to help you in this activity. List them below.

f. Select 1 test from (e) above and explain how it helps in this activity.
Question 5. ​(10 points total, 2 points each question) Consider the following scenario for
questions 5.1 – 5.5. Assume that you are operating an E-Commerce web site. On average, you
have 36 visits to your site per hour and the average duration of the visits is 5 minutes. Your site
goes down on average once every day and the average downtime is 10 minutes for each
occurrence. Assume a uniform distribution of the visits over the time. Answer the following
questions. For each, give the requested value and formula you used to arrive at the answer.
(Hint: there are 1440 minutes in a 24 hour day)

5.1. What is the availability of the system?

5.2. What is the mean time between failures (MTBF) of the system?

5.3 Give an estimate of sessions each day if there is no downtime.

5.4. Give an estimate of the number of customers impacted each day due to the downtime of
the system.

5.5. Consider each visit (or session) as a unit of function, give an estimate of the reliability of the
system.
Question 6. ​(10 points total, 2 points each question) Consider each of the following
requirements (6.1 – 6.5). Identify the software quality each requirement is ​primarily ​concerned
with. Choose one only.
a)​ ​Efficiency
b)​ ​Performance
c)​ ​Reliability
d)​ ​Usability
e)​ ​Maintainability
f)​ ​Portability
g)​ ​Interoperability
h)​ ​Safety
i)​ ​Security
j)​ ​Scalability
k)​ ​None of the above (explain)

6.1. The system must not send or receive any passwords in plain text (they must be encrypted).

____ (answer)

6.2. The application must monitor its own disk usage and delete old log files to save space.

____ (answer)

6.3. The application shall fail no more than once in every 1,000,000 requests.

____ (answer)

6.4. The source code of the system must meet the Google Java Style guidelines.

____ (answer)

6.5. The response time for each request shall not be longer than 0.5 second.

____ (answer)
Question 7​: (10 points, 2 points each) for each test below decide whether the result of the test
will be a pass, fail or error.

The class being tested is simply:

public class App


{
public void show(int value) {
if (value > 1000) {
throw new IllegalArgumentException("Value is too high");
} else {
System.out.println(value);
}
}

public double addIfSmallEnough(double a, double b) {


if ((a + b) < 1000) {
return a + b;
} else {
return a;
}
}

public double divide(int a, int b) {


return a / b;
}
}

7.1
@Test
​void​ test1() {
App myApp = ​new​ App();
assertThrows(IllegalArgumentException.class, () -> myApp.show(10));
}

Pass, Fail or Error? Explain your answer.


7.2
@Test
​void​ test2() {
App myApp = ​new​ App();
assertThrows(IllegalArgumentException.class, () -> myApp.show(5000));
}

Pass, Fail or Error? Explain your answer.

7.3
@Test
void test3() {
App myApp = ​new​ App();
double​ result = myApp.addIfSmallEnough(600.39, 500.0);
assertEquals(1100.39, result);
}

Pass, Fail or Error? Explain your answer.

7.4
@Test
void​ test4() {
App myApp = ​new​ App();
double​ result = myApp.addIfSmallEnough(600.39, 500.0);
if​ (result < 1000) {
fail("unexpected result");
}
}

Pass, Fail or Error? Explain your answer.


7.5
@Test
void​ test5() {
App myApp = ​new​ App();
​double​ result = myApp.divide(10, 0);
fail("divide by zero should not work");
}

Pass, Fail or Error? Explain your answer.

Question 8​ (2 points)
What sort of testing problems work well Parameterized tests? Give an example (not code, just
describe the test scenario)

Question 9​ (2 points)
Describe the test activities that can take place before there is an actual application available for
testing. List each activity and briefly describe each one.
Question 10. ​(16 points total) Functional testing. ​DO NOT ASSUME YOU MUST FILL ALL ROWS​.
Consider the following specification of a program.
The program calculates the weekly cost of a movie streaming service, that bases its charges on the
following rules:
● The regular charge is $3 per movie for up to 7 movies per week
● More than 7 movies per week costs $2.50 per movie.
● There is a maximum number of movie downloads per customer per week, of 20 movies
● There is a student discount of 10% for both rates
● There is a senior citizen discount of 7% for both rates
● The input to the program is the number of movies downloaded in the week and the type of user
● Assume the single defect assumption applies to this scenario
● Assume there is just 1 invalid user type

10.1. (4 points) Identify the valid and invalid equivalence classes for each input parameter and give
their representative value.

Movies User Type


10.2. (8 points) Identify test suites with the minimum number of test cases that would satisfy each of the
following coverage of equivalence class.
Each test case is represented by the values you choose for the two input values:
● Movies: the count of movies downloaded in a given week
● User Type: type of person who downloaded the movies
● Expected Value: calculate when a column is provided for it

a) Weak normal test suite

Movies User Type Expected Value

b) Strong normal test suite

Movies User Type Expected Value


c) Weak robustness test suite

Movies User Type Expected value

d) Strong robustness test suite

Movies User Type Expected value


10.3. (2 points) Add test cases using normal boundary value analysis. ​ Show only the new cases.

Movies User Type Expected value

10.4. (2 points) Add cases using robustness boundary value analysis. ​Show only the new cases.

Movies User Type Expected value


Extra tables for question 10. If you need this for multiple parts, be sure to indicate where one ends and
another starts.

You might also like