8 Problems for Midterm Exam - Software Testing | SWE 637, Exams of Engineering

Material Type: Exam; Class: Software Testing; Subject: Software Engineering; University: George Mason University; Term: Unknown 1989;

Typology: Exams

2019/2020

Uploaded on 11/25/2020

koofers-user-z9c
koofers-user-z9c 🇺🇸

5

(1)

10 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
George Mason University
Information and Software Engineering
SWE 637 Software Testing and Quality Assurance Y. Wu
Fall 2000
Mid Term Exam
October 23, 2000
This exam is closed book and notes. Be sure to print your name on the test. Allocate your
time according to the points assigned for each question. Please show all work on the test.
You should be able to answer all questions using the pages provided; please answer on
this paper if you can. If you do need extra pages, staple them into the exam. If I cannot
read your answer, I will mark it wrong.
You have until 6:00pm.
PROBLEM SCORE POINTS
1 25
2 30
3 10
4 10
5 10
6 10
7 10
8 3
TOTAL 108
NAME (please print):
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download 8 Problems for Midterm Exam - Software Testing | SWE 637 and more Exams Engineering in PDF only on Docsity!

George Mason University Information and Software Engineering

SWE 637 Software Testing and Quality Assurance Y. Wu Fall 2000 Mid Term Exam October 23, 2000

This exam is closed book and notes. Be sure to print your name on the test. Allocate your time according to the points assigned for each question. Please show all work on the test.

You should be able to answer all questions using the pages provided; please answer on this paper if you can. If you do need extra pages, staple them into the exam. If I cannot read your answer, I will mark it wrong.

You have until 6:00pm.

PROBLEM SCORE POINTS

TOTAL 108

NAME (please print):

  1. (25 points) Answer the following 5 questions briefly and concisely. Use the space provided.

1.i. Provide at least four types of testing, which are usually performed during system testing, but not in integration testing.

1.ii. As a manager of a project, what type of role should you acting in terms of testing?

1.iii. Give an example of traditional testing technique that can be applied to the object-oriented software and one is not adequate to test object- oriented software.

  1. (30 points) The procedure JUNK is attached as the last page of the exam. Use JUNK to answer parts a through g. You may remove the page with JUNK on it.

(a) Draw the control flow graph for the program JUNK. Draw the graph using the format and definition for basic blocks that we used in class. Annotate the graph edges with the appropriate predicates.

Give minimal test data sets to satisfy the following three criteria for the program JUNK. (A minimal test set that satisfies a criterion is not the smallest possible test set, but a test set such that if we remove any of the test cases then the set will no longer satisfy the criterion. The purpose of asking for a minimal set is so that listing all the tests is NOT a correct answer.) Choose all your test cases from the following set (I will disregard any test cases that do not come from this set): ( 1, 1) (11, -1) (11, 1) (-1, 1) ( 1, -1) ( 0, 0) (-1, -1)

(b) Give a minimal test data set to satisfy the statement coverage criterion.

(c) Give a minimal test data set to satisfy the branch coverage criterion.

(d) Give a minimal test data set to satisfy the MC/DC criterion.

  1. (10 points) Three sets of test case values, T1, T2 and T3 have been constructed for a program P. Test set T1 satisfies the statement coverage criterion. Test set T satisfies the branch coverage criterion. Test set T3 satisfies the all paths criterion.

Make each statement below as either True or False and with a short justification. (Justification worth half the credit).

  1. Every test case in T2 must also appear in T3.

  2. T3 satisfies the statement coverage criterion.

  3. T1 satisfies the branch coverage criterion.

  4. If P is incorrect, then T2 reveals any fault in P that T1 reveals.

  5. If P has no loops, then T2 satisfies the all paths criterion.

  1. (10 points) Three sets of test case values, T1, T2 and T3 have been constructed for a program P. Test set T1 satisfies the all-defs criterion. Test set T2 satisfies the all-uses criterion. Test set T3 satisfies the all-du-paths criterion.

Make each statement below as either True or False and with a short justification. (Justification worth half the credit).

  1. T1 satisfies the all-uses criterion.

  2. If P has no loops, then T3 satisfies the all-paths criterion.

  3. T3 satisfies the all-defs criterion.

  4. If P is incorrect, then T3 reveals any fault in P that T2 reveals.

  5. Every test case in T2 must also appear in T3.

  1. (10 points) Given the following procedure specification, suggest categories and choices to test the program (do not supply test frames or test cases).

The procedure will accept three non-negative integer parameters, representing a month, day and year, and return an integer between 1 and 366, indicating the day of the year. If either month, day, or year is invalid (1 ≤ month ≤ 12, 1 ≤ day ≤ month_length, 1990 ≤ year ≤ 1999), the procedure will return 0. (month_length is the number of days in the current month.)

  1. (10 points) Identify all data flow anomalies and there types in the following function.

void f(int m, n) { int x,y,t,s,a,i;

x = m + 3 * n; If (m > n) { x = 4 * m; y = 7 * n; } t = x / (y + 14); s = m + n; for(i=s;i<=t;i++) a = i * 4; printf(“a = %d\n”,a); }

For use in question 2:

JUNK (int x,y) { int a, b;

a = 0; if (x > 0) { a = 4; }

if (x <= 10 && y >0) { b = 3 * a; } else { b = 4 * a; } printf(“b = %d\n”, b); }