Title: Java Naming Convention Defining Features Matrix

Author: Kate Deibel

Date: March 30, 2004

Technique: Defining Features Matrix

Before Class Preparation Time: MEDIUM

Class Completion Time: LOW

In-Class Analysis Time: LOW

Out-Of-Class Analysis Time: LOW

Assessment Goals:
Topics:
Purpose:

This exercise lets instructors see how well students can properly name methods, classes, and variables in Java.


Activity:

For each class, function, or variable, place a plus (+) or minus (-) in each column to indicate if it meets the requirement for that column. The first column asks if the name is valid in Java. The second asks if the name is concise. The third asks if the name is descriptive for its use. Finally, the fourth column asks if the name meets the Java Naming Convention. You may use a not applicable (n/a) where you deem appropriate.


  Valid? Concise? Descriptive? Meets JNC?
EX. class CF_engine + + - -
1. Monkey mr_bananas        
2. Double area()        
3. class TouchSensor        
4. Boolean switch        
5. int numberOfYoungCanines        
6. Integer SUM()        
7. class Unit        
8. class ProbablityCalculatorModule        
9. constant int TOTAL__PUPPIES        
10. double r        
11. double LMultipliedByW()        
12. int i (in a forloop)        
13. boolean switchOn        
14. class Funny_Monkey        
15. int 2ToTheN(int n)        

Solution:
Valid? Concise? Descriptive? Meets JNC?
EX. class CF_engine + + - -
1. Monkey mr_bananas + + + -
2. Double area() + + + +
3. class Touch-Sensor - + + n/a
4. Boolean switch - + - +
5. int numberOfYoungCanines + - + +
6. Integer SUM() + + - -
7. class Unit + + - +
8. class ProbablityCalculatorModule + - + +
9. constant int TOTAL__PUPPIES + + + +
10. double r + + - +
11. double LMultipliedByW() + - - +
12. int i (in a for-loop) + + + +
13. boolean switchOn + + + +
14. class Funny_Monkey + + + -
15. int 2ToTheN(int n) - n/a + n/a

Instructor Responses: Response Analysis:

The following must be done out of class:

  1. In a first pass, mark and count the number of incorrect answers. Also, mark any answers that you find surprising.
  2. For each question that has a significant (your judgement call) of incorrect answers, do the following:
    1. Look through the answers to these questions.
    2. Attempt to identify the nature of the most common errors that are made.
  3. Discuss these errors in class, using the common mistakes that you identified .

In-class feedback can be done by having students write their own answers, but caution must be taken to avoid embarassing or ridiculing a student for making mistakes. For some names, there might be debate over how concise or descriptive the names are. For example, double r could be descriptive if it's a member variable in class Circle.



Variant Uses of Activity:
Device-Enabled: Has Been Enabled

Related Topics: