$Id: exam1-topics.txt,v 1.2 2009/10/04 16:27:05 cheon Exp $ CS3331: Exam 1 Topics This exam covers UML, applets, Java features, unit testing, and inheritance. REMINDERS This test is closed-notes and closed-book. However, you are allowed to bring 1 page (8.5 X 11) of notes (both sides). Your notes must be your own, they must be hand written, and they must be turned in with your test. This test is to be done individually, and you are not to exchange or share your notes with other students during the test. If you need more space, use the back of a page. Note when you do that on the front. This test is timed. Your test will not be graded if you try to take more than the time allowed. Therefore, before you begin, please take a moment to look over the entire test so that you can budget your time. For diagrams and programs, clarity is important; if your diagrams or programs are sloppy or hard to read, you will lose points. Correct syntax also makes some difference. TOPICS In the following, topics marked with + are more important than those marked with -. Topics marked with ++ are almost certain to be on the test, in one form or another. In general, skills needed to solve the test problems are more or less like those required for the homework. Object-Oriented Modeling Using UML + Understand concepts and terms such as objects, classes, fields, and methods. + Explain the differences, in Java, between a class and an interface. ++ Know the UML notation for describing classes, including field declarations and method declarations. + Explain what statements or expressions violate the visibility rules. That is, know such accessibility (visibility) rules as public, protected, package (default privacy), and private. - Know the UML notation for objects. + Understand important object-oriented design principles such as modularity, abstraction, encapsulation, and polymorphism. ++ Know how to model such relationships as inheritance, association, aggregate and composition among classes and interfaces. ++ Understand different kinds of inheritances such as extension of classes, extension of interfaces, and implementation of interfaces. - Know the UML notations for describing dynamic behaviors of systems, such as sequence diagrams and state diagrams. - Know the UML notation for describing requirements, i.e., use case diagrams. Java and Applets + What is the difference between applications and applets? + Write a simple applet, e.g., HelloWorldApplet. - Know how to include applets in HTML documents, i.e., know the applet tags and attributes. - Know how to compile and run applets. - Explain the facilities provided by Java to organize large-scale programs that include many classes. + How to declare the package for a class and how to use a class declared in another package? + Explain the connection between packages and directories. + What are the reasons someone would design a method that throws exceptions? + Explain the differences between checked exceptions and unchecked exceptions and give examples. + Write Java code that throws and catches exceptions. + Write a simple animation applet, similar to digital clock. ++ Describe life-cycle of applets and explain when applet methods such as init, start, stop, and destroy will be invoked. + Know how to use AWT classes such as Color and Font. Unit Testing - What is unit testing? + Why is unit testing so important? + Know how to do unit testing, e.g., by using the divide-and-conquer approach. - What are the benefits of using unit testing tools such as JUnit? ++ Know to write JUnit test methods and classes. + Be familiar with JUnit assertion methods such as assertEquals, etc. + Know (JUnit) testing terminology such as test case (or data), test fixture, test driver, and test oracle. + What are the roles of the framework methods such as setUp, tearDown, and suite? + Know to organize test methods and smaller suites into a bigger test suite. Classes and Inheritance + Explain the purpose of subclassing and inheritance. + Explain about constructor and method overloading by giving examples and discussing its resolution mechanism. + Understand how to write constructors in subclasses; e.g., constructors that use "super" to inherit behavior and "this" to call other constructors. + Explain the notion of types and subtypes. ++ When a type such as a built-in type, a classe, an interface, an array is a subtype of another type? ++ Explain the substitution property. + Know when to use narrowing (downcasting). ++ Explain method overriding, including its resolution mechanism. + Explain what is meant by (parametric or subtype) polymorphism. - Understand the hiding mechanism of Java, especially their resolution rules. + Compare overloading and overriding (and hiding). + Understand the type checking rules of Java in the presence of subtyping, overriding, and polymorphism. + Understand the parameter passing mechanism of applets (i.e., from HTML pages to applet classes). + Know how to use such AWT classes as Graphics and FontMetrics. + Understand the basic technique of animation, e.g., used in the scrolling banner example discussed in class. + Know how to use the animation idiom. ++ Understand the double-buffering technique for animation, and write applet code that use it. ++ Write applet code that uses subclassing to reuse code from superclasses; i.e., know to write minimal code by inheriting code from superclasses.