This is the material covered in this exercise:
Exception-Safe Generic Containers, which was published in the C++ Report journal as a follow-up article to the "False sense of security" article covered in class. | |
Automated Unit Testing & Coding Standard Enforcement as implemented in JTest |
The deadline for this exercise is Thursday, April 10th, 2003.
Read this paper first (it's a zipped RTF document), and answer the following questions:
1. Quote: "More generally, mutator functions should not return T objects by value". Explain why this is a problem. State a general rule of generic class design, that designers must follow to avoid this problem.
2. Explain why the three methods of StackImpl are both exception-neutral and exception-safe.
Read this paper first, and answer the following questions:
3. What are the design considerations for declaring a class as implementing Serializable, Externalizable, or none of them? Give an example for each case.
4. Is object serialization "shallow" - copies only the value fields of a given object - or "deep" - copies referenced objects recursively as well? How would you write a class that serializes and de-serializes itself using the behavior that is not the default one?
The Java Serialization Specification is also recommended reading, although not required for this exercise. In particular, it covers the subjects of versioning, the stream protocol and security in more detail. It's shorter and easier to read than most formal specifications, so give it a try :-)
Read this paper first (it's a zipped PDF document), which describes a commercial product called JTest that can automate different types of quality assurance tasks. Answer the following questions:
5. Define the terms "unit testing", "module testing", "white-box testing", "black-box testing", "regression testing", "coding standards" and "metrics".
6. Briefly answer the following questions:
Give an example of white-box testing that is not related to uncaught exceptions. | |
Why can't black-box testing be automated without relying on Design by Contract? | |
What is "coverage" in testing, and how is it measured? | |
Which of the kinds of tests from question 6 are considered static analysis? | |
Give two examples of metrics for which a very high value indicated a design problem. |
This exercise should be submitted electronically only. The file format can be either plain text or Word. Word files should be compatible with Word 2000, and can be in either Hebrew or English.
All six questions must be answered. Length is not officially limited, but do keep your answers to the point.
Good luck!