Exploiting Automatic Testing
in BlueJ
Programming Process and Practical Lab Exam
Michael E. Caspersen
University of Aarhus
Denmark
[email protected]
User Talk
First BlueJ Day, 1 March 2006
Uses of BlueJ
• General IDE
– edit, compile, run, ...
• Exploring “the notional machine”
– debugger (flow of control, object model, object interaction, ...)
• Incremental program development
– automatic testing
• Model-driven programming
– UML support
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.2
Outline
• Programming Process
• Choice of Examination Form
• Practical Lab-Exam
• ”Conclusion”
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.3
Programming Process
The Missing Link...
tools
finished
concepts
language
constructs
Michael E. Caspersen
?
First BlueJ Day, 1 March 2006
programs
Practical Assessment.5
Strategies, Principles, and Techniques
... for the systematic development of programs
The Practice of Programming
• Describe strategies, principles, and techniques
of program development
• Demonstrate how to apply these in action
tools
• Develop programs instead of simply showcasing
them
finished
concepts
• Demonstrate that programming is a non-linear
process
• Demonstrate incremental development programs
language
• Demonstrate model-driven development
constructs
• Demonstrate test-driven development
• Demonstrate responsibility-driven development
• Demonstrate refactoring
• Demonstrate how to find and handle errors
• Demonstrate how to use online documentation
• Demonstrate, demonstrate, demonstrate ...
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.6
Example: Class Date
• Refinement of class Date
public class Date {
private int
d, // 1 <= d <= daysInMonth
m, // 1 <= m <= 12
y;
• Special cases
– systematic treatment of
special cases
– suppress implementation
details
– introduce private methods to
handle special cases
public Date(int dd, int mm, int yy) {
d = dd; m = mm; y = yy;
}
public void setToNextDate() {
d = d + 1;
}
public String toString() {
return d + "-" + m + "-" + y;
}
}
• The mañana principle
– introduce an abstraction
– worry about implementation
details ”tomorrow”
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.7
Refinement and Automatic Testing
R1: Naive implementation of class Date
R2: Add checkDayOverflow
R3: Add checkMonthOverflow
R4: 28, 30, or 31 days in month
R5: Partial leap year rule
R6: Complete leap year rule
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.8
Choice of Examination Form
Education as a Goal-Oriented Activity
1. Articulate aims and goals
– Short as well as long term
– Micro as well as macro level (assignment, lecture, course, degree)
2. Design assessment method
– such that a winning strategy with respect to assessment optimize
learning
3. Design teaching and (intended) learning process
– Progression, abstract vs. concrete, general vs. special, apprenticeship
approach, spiral approach, early bird, ...
4. Decide on dissemination methods
– Material (textbook, web, learning objects, videos, sample programs, ...)
– Teaching method (lecture, class, lab, student collaboration, project
work, supervision, ...)
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.10
Course and Exam Must Match
• The final exam must reflect the contents of the
course
– The spirit and style of student assessment defines de facto the
curriculum. — Rowntree, 1977
– The type of grading influences the student’s learning approach.
— Ramsden, 1992
– We find it mandatory to apply an evaluation form where the
students demonstrate their practical programming skills as well
as their understanding of the fundamental concepts and theories
from the curriculum of the course.
– In short: course contents and final exam must match.
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.11
Choice of Examination Form
• Test the students against expected competencies
– After the course the student will be able to use fundamental
elements in a modern programming language
– Use conceptual modelling for systematic development of simple
object-oriented programs
– Implement simple oo-models in a modern programming
language, and
– Use selected class libraries
Oral
Exam
Written
Exam
Multiple
Choice
Practical
Exam
– Weekly mandatory assignments prepare the students for the
exam but they don’t count in the final grading
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.12
Practical Lab Exam
Practical Lab Exam
• Staff
– Teacher, external examiner, 4-5 TAs
• Students
– 20 per group; 12 groups (200+ students)
• Time
– 30 minutes for the assignment, 60 minutes in total
• Assignment
– A new for each group (though similar)
– ~10 programming tasks; breakpoint after #2
– Pass point: task #6
• Evaluation
– Process as well as product (i.e. the students behaviour also counts in
the final grading
– If the lecturer and external examiner estimate so, an appropriate and
systematic programming process can compensate for minor flaws and
errors in the product and make a student pass
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.14
Sample Exam Assignment
1. Create a simple class Employee
with constructor, getSalary, and
toString method…
2. Create a class EmployeeTest...
3. Create a new class Department ...
4. Implement the methods addTrack,
removeTrack, and getHOD
5. Create a class DepartmentTest…
6. Implement getDepartmentSalary
7. Add a method to DepartmentTest
to test the getDepartmentSalary
method
8. Implement bestPaidEmployee
9. Add a method to DepartmentTest
to test the bestPaidEmployee
method
10. Let the Employee class implement
the Comparable interface…
Michael E. Caspersen
Employee
String name
int salary
int getSalary()
String toString()
1
hOD
*
employees
Department
String departmentName
void add(Employee e)
void remove(Employee e)
Employee getHOD()
int getDepartmentSalary()
Employee bestPaidEmployee ()
First BlueJ Day, 1 March 2006
Practical Assessment.15
Use of BlueJ
• Develop
• Test
• Submit
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.16
“Conclusion”
• General IDE
– edit, compile, run, ...
• Exploring “the notional machine”
– debugger
• Incremental program development
– automatic testing
• Model-driven programming
– UML support
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.17
References
Jens Bennedsen & Michael E. Caspersen,”Programming in Context – A Model-First Approach to
CS1”, Proceedings of the thirty-fifth SIGCSE Technical Symposium on Computer Science Education,
Norfolk, Virginia, USA, 2004, pp. 477-481.
Jens Bennedsen & Michael E. Caspersen,”Teaching Object-Oriented Programming – Towards
Teaching a Systematic Programming Process”, Proceedings of the Eighth Workshop on Pedagogies
and Tools for the Teaching and Learning of Object-Oriented Concepts, 18th European Conference on
Object-Oriented Programming, ECOOP 2004, Oslo, Norway, 2004.
Jens Bennedsen & Michael E. Caspersen,”Revealing the Programming Process”, Proceedings of the
thirty-sixth SIGCSE Technical Symposium on Computer Science Education, St. Louis, Missouri, USA,
2005, pp. 186-190.
Jens Bennedsen & Michael E. Caspersen,”Assessing Process and Product – A Practical Lab Exam
for an Introductory Programming Course”, Submitted for Frontiers in Education, FIE 2006, San Diego,
USA, October 2006.
Michael E. Caspersen, Teaching Object-Oriented Programming – Strategies, Principles, and
Techniques, Progress Report, Department of Computer Science, University of Aarhus, 18 April 2005.
(42 pages)
www.daimi.au.dk/~mec/papers/
[email protected]
Michael E. Caspersen
First BlueJ Day, 1 March 2006
Practical Assessment.18
Descargar

Programmering – fra instruktion til modellering