exer-student

# Exer-student - Introduction to Software Testing Paul Ammann and Jeff Offutt Solutions to Exercises Student Version Copyright Ammann& Offutt

This preview shows pages 1–6. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Software Testing Paul Ammann and Jeff Offutt Solutions to Exercises Student Version February 23, 2011 Copyright Ammann & Offutt, 2002-2009, all rights reserved. 2 Tell me and I may forget. Show me and I may remember. Involve me and I will understand – Chinese proverb Introductory Note As readers will undoubtedly note, as of February 23, 2011, a few problems still do not have complete solutions. Paul ([email protected]) and Jeff ([email protected]) welcome your help with new solutions and corrections to our errors. In fact, we hope this will be viewed as a community resource and welcome any kind of feedback. We distinguish between “student solutions” and “instructor only” for the convenience of both. Students can work homeworks then check their own answers. Instructors can assign homeworks with some confidence that students will do their own work instead of looking up the answer in the manual. 3 Exercises, Section 1.1 1. What are some of the factors that would help a development organization move from Beizer’s testing level 2 (testing is to show errors ) to testing level 4 (a mental discipline that increases quality )? Instructor Solution Only 2. The following exercise is intended to encourage you to think of testing in a more rigorous way than you may be used to. The exercise also hints at the strong relationship between specification clarity, faults, and test cases. (a) Write a Java method with the signature public static Vector union (Vector a, Vector b) The method should return a Vector of objects that are in either of the two argument Vectors. Instructor Solution Only 4 (b) Upon reflection, you may discover a variety of defects and ambiguities in the given assignment. In other words, ample opportunities for faults exist. Identify as many possible faults as you can. ( Note: Vector is a Java Collection class. If you are using another language, interpret Vector as a list. ) Instructor Solution Only (c) Create a set of test cases that you think would have a reasonable chance of revealing the faults you identified above. Document a rationale for each test in your test set. If possible, characterize all of your rationales in some concise summary. Run your tests against your implementation. Instructor Solution Only (d) Rewrite the method signature to be precise enough to clarify the defects and ambiguities identified earlier. You might wish to illustrate your specification with examples drawn from your test cases. Instructor Solution Only 5 Exercises, Section 1.2 1. For what do testers use automation? What are the limitations of automation? Solution: Automation can help in many areas, most often to relieve the tester from repetitive, me- chanical tasks. Checking of testing criteria can be automated through instrumentation, which allows a higher level of testing to be performed. Automation will always run into undecidable problems, such as infeasible paths, test case generation, internal variables, etc. Automation cannot help validate output or make creative decisions.cannot help validate output or make creative decisions....
View Full Document

## This note was uploaded on 01/17/2012 for the course SWE 637 taught by Professor Offutt,j during the Fall '08 term at George Mason.

### Page1 / 89

Exer-student - Introduction to Software Testing Paul Ammann and Jeff Offutt Solutions to Exercises Student Version Copyright Ammann& Offutt

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online