Keirsey-Bates
Temperament
Scorer
The
Keirsey-Bates
Temperament Survey is a personality inventory
instrument. To get
an idea of what it is like, you may want to complete
the
online Keirsey-Bates
Temperament Scorer. Plan to take about 20
minutes. When you finish the survey, you will be shown
a results page with an interpretation of your temperament.
OVERVIEW
You
are to write a program that will assist in analyzing responses
to the
70 question Keirsey-Bates
Temperament Survey. It scores the responses and produces a
personality "type" according to the scoring formula in the
Keirsey-Bates textbook.
INPUT
via parameter
A 70 character string representing a response to each
item in
the survey instrument. Each character is 'A' or 'B', a
response
to
one of the survey questions. Note: it's assumed that the
responses
are in the same order as the 70 questions on the survey.
OUTPUT
via return value
A 4
character string, containing one of the Keirsey-Bates types,
or
"ERR!" if there was invalid input.
FUNCTIONS
Use the Keirsey-Bates
scoring directions.
ERROR
HANDLING
Return
"ERR!"
if the Responses input is not 'A' or 'B' or if there
are not exactly 70 characters.
IMPLEMENTATION CONSTRAINTS
Your Java class must be
named KeirseyScorer. The scoring function must be a
static method
with the following signature:
public static String
evaluateSurvey(String responses)
TESTING
You must provide your own JUnit tests that cause 100% branch
coverage. (Obviously, the tests must pass.)
Here's an example:
public void testTwo()
{
String data1 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
assertEquals("ESTJ",KeirseyScorer.evaluateSurvey(data1));
}
COLLABORATION OKAY
On this project you may consult with other students or work together
to
design a solution. Each student must submit their own individual
work. If you are feeling out of practice with Java programming,
you may want to work in the lab with a peer to cooperatively resolve
problems that arise.
SUBMISSION
Submit a zip file containing your source code and JUnit tests
to the Web-CAT grader. Make sure you provide a correct @author
javadoc tag in every file you submit. The grader will run your unit
tests, run the instructor's tests,
and check for conformance to the class coding standard.
GRADING
Updated 1/9/15
90% of the grade is the Web-CAT score,
10% of the grade is instructor evaluation of the algorithm design.
Web-CAT
The "Correctness/Testing" portion of the score must be 80/80.
You can earn 20 additional points for the
"Style/Coding" portion of the score by
and conforming to the class coding standard.
You are allowed 20 submissions to Web-CAT.
Design
You should use the project as a chance to refresh your
Java programming skills and practice writing modular, maintainable
code.
Consult the
algorithm design guidelines.
Since this is a class on data structures, you should strive to find
a solution that uses a data structure that helps you reduce the amount
of logic in your algorithm.
If there is any redundant code in your solution you will
earn a zero for the design part of the grade.
For reference, you should aim for a solution that contains less than
100 logical
lines of code. Proficient students have achieved solutions
containing less than 50 LOC. Check the course resources page to download the
instructor's
LOC counting tool.