<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE CAT [ <!ENTITY nbsp  "&#160;"> ]>
<CAT xmlns:cat="http://www.w3.org/TR/html4/" version="2.0"> 
<cat:title>Java Naming Convention Defining Features Matrix</cat:title>
<cat:author>Kate Deibel</cat:author>
<cat:date>March 30, 2004</cat:date>

<cat:technique>Defining Features Matrix</cat:technique>

<cat:purpose>
<p>
This exercise lets instructors see how well students can properly name methods, classes, and variables in Java.
</p>
</cat:purpose>
<cat:activity>
<p>
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.
</p>

<br></br>
<center>
<table border="1">
<tr>
<td>
&nbsp;
</td>
<td align="center">
Valid?
</td>
<td align="center">
Concise?
</td>
<td align="center">
Descriptive?
</td>
<td align="center">
Meets JNC?
</td>
</tr>
<tr>
<td>
EX. class CF_engine
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td>
1. Monkey mr_bananas
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
2. Double area()
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
3. class TouchSensor
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
4. Boolean switch
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
5. int numberOfYoungCanines
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
6. Integer SUM()
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
7. class Unit
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
8. class ProbablityCalculatorModule
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
9. constant int TOTAL__PUPPIES
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
10. double r
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
11. double LMultipliedByW()
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
12. int i (in a forloop)
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
13. boolean switchOn
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
14. class Funny_Monkey
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
<tr>
<td>
15. int 2ToTheN(int n)
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
<td align="center">
&nbsp;
</td>
</tr>
</table>
</center>
</cat:activity>
<cat:solution>
<br></br>
<center>
<table border="1">
<tr>
<td>

</td>
<td align="center">
Valid?
</td>
<td align="center">
Concise?
</td>
<td align="center">
Descriptive?
</td>
<td align="center">
Meets JNC?
</td>
</tr>
<tr>
<td>
EX. class CF_engine
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td>
1. Monkey mr_bananas
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td>
2. Double area()
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
3. class Touch-Sensor
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
n/a
</td>
</tr>
<tr>
<td>
4. Boolean switch
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
5. int numberOfYoungCanines
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
6. Integer SUM()
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td>
7. class Unit
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
8. class ProbablityCalculatorModule
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
9. constant int TOTAL__PUPPIES
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
10. double r
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
11. double LMultipliedByW()
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
<td align="center">
-
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
12. int i (in a for-loop)
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
13. boolean switchOn
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
</tr>
<tr>
<td>
14. class Funny_Monkey
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
+
</td>
<td align="center">
-
</td>
</tr>
<tr>
<td>
15. int 2ToTheN(int n)
</td>
<td align="center">
-
</td>
<td align="center">
n/a
</td>
<td align="center">
+
</td>
<td align="center">
n/a
</td>
</tr>
</table>
</center>
</cat:solution>
<cat:analysis>
<p>
The following must be done out of class:
</p>

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

<p>
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.
</p>
</cat:analysis>
<cat:variant_uses>
	<cat:variation>Have students write short explanations for their answers in the matrix.</cat:variation>
	<cat:variation>Have students correct any names that score a minus in any column.</cat:variation>
	<cat:variation>Have students work in groups to complete this activity.  The instructor may want to circulate throughout the groups to ensure that each group is making progress. After the groups have completed their matrix, the instructor can ask for volunteers for each item. Be sure to ask for explanations as to
 why they assigned a plus or minus to each column.</cat:variation>
	<cat:variation>Have students work individually on their problems and form a small group to discuss their answers.</cat:variation>
</cat:variant_uses>
<cat:classification>
<cat:assessment_goals>
	<cat:goal>Develop analytic skills</cat:goal>
	<cat:goal>Improve memory skills</cat:goal>
	<cat:goal>Learn terms and facts</cat:goal>
	<cat:goal>Learn concepts and theories</cat:goal>
</cat:assessment_goals>
<cat:topics>
	<cat:topic>Java Names and Naming Convention</cat:topic>
	<cat:topic>Syntax</cat:topic>
	<cat:topic>Variables</cat:topic>
	<cat:topic>Function identifiers</cat:topic>
	<cat:topic>Readability</cat:topic>
	<cat:topic>Design</cat:topic>
</cat:topics>
<cat:participation_level>
</cat:participation_level>
<cat:time>
	<cat:preparation_time>MEDIUM</cat:preparation_time>
	<cat:class_time>LOW</cat:class_time>
	<cat:in_class_analysis_time>LOW</cat:in_class_analysis_time>
	<cat:out_class_analysis_time>LOW</cat:out_class_analysis_time>
</cat:time>
<cat:instructor_response>
	<cat:response>Lecture</cat:response>
	<cat:response>Next Day Summary</cat:response>
	<cat:response>Class Discussion</cat:response>
	<cat:response>Small Group Discussions</cat:response>
	<cat:response>Homework</cat:response>
</cat:instructor_response>
<cat:device_enabled>Has Been Enabled</cat:device_enabled>
<cat:related_topics>
	<cat:topic>Variable Syntax</cat:topic>
	<cat:topic>Function Syntax</cat:topic>
	<cat:topic>Class Syntax</cat:topic>
	<cat:topic>Code Readability</cat:topic>
	<cat:topic>Program Design</cat:topic>
</cat:related_topics>
</cat:classification>
</CAT>