Title: A style checker for JAVA and
1- A style checker for JAVA and
- its application at HU
25.08.05
2- Introduction
- How to use AssessStyle
- Experience at HU in WS 04 /05and related work
3Humboldt University Berlin1st Semester
- Introduction to object-oriented programming
- with Java
- lectures 64 hours
- exercises on paper 32 hours
- lab work Java programs
about 200 students involved,3 students work as
correctors
4Assessment of Java programs at HU by correctors-
assistance for correctors and students final
grading -
Java program
programming style
compilability
correctness
5Tool AssessStyle- assistance for correctors and
students -
Java program
programming style
compilability
correctness
6Tool AssessStyle Style guide checks
- missing empty line
- missing white space
- wrong indentation
- switch without default
- method too long
- missing comment
- too short identifiers
- . . .
criterias(check types)
7Tool AssessStyle Style guide checks
- White spaces and other optical aspects,
e.g. missing empty line missing white
space wrong indentation - Statements, e. g. switch without default
- Size, length, complexity, e. g. method too long
- Comments, e. g. missing comment
- Names and declarations, e. g. too short
identifiers
in additional, you can group criterias tomistake
types
8How to use AssessStyle
- Introduction
- How to use AssessStyle
- Load Java program into the tool
- Tool automatically checks for style guides
- Some criteria are checked semi-automaticallyand
some manually - Tool automatically computes a metric and a
markaccording to conformance to style guidelines - Tool configuration
- Experience at HU in WS 04 /05and related work
9User interface of AssessStyle
Set of mistake types
bad name
D
10Example of AssessStyle (1)
Set of mistake types
D
bad name
D
11Example of AssessStyle (2)
D
bad name
D
12Example of AssessStyle (3)
D
13How to use AssessStyle
- Introduction
- How to use AssessStyle
- Load Java program into the tool
- Tool automatically checks for style guides
- Some criteria are checked semi-automaticallyand
some manually - Tool automatically computes a metric and a
markaccording to conformance to style guidelines - Tool configuration
- Experience at HU in WS 04 /05and related work
14There are tree kinds of checks
search algorithms are implemented they are
applied generally
- automatic
- semi automatic
- manual
search algorithms are implemented the user
decides on their application
search algorithms are not implemented the user
can mark mistakes manually
15Example of AssessStyle - manual (1)
bad comment
K
bad name
16Example of AssessStyle - manual (2)
bad comment
K
bad name
17How to use AssessStyle
- Introduction
- How to use AssessStyle
- Load Java program into the tool
- Tool automatically checks for style guides
- Some criteria are checked semi-automaticallyand
some manually - Tool automatically computes a metric and a
markaccording to conformance to style guidelines - Tool configuration
- Experience at HU in WS 04 /05and related work
18Tool computes a metric P and a mark
- Parameters are
- The weight of particular mistake-types, e. g.
missing comment 4 missing empty line
2 bad indentation 1 file too
long 9 - The relation between the mark and the values of P
P h(f) g(f)
f
F
weight of error f
number of errors f in 100 LOC
Set of all mistake-types
19Tool has found these mistakes
20How to use AssessStyle
- Introduction
- How to use AssessStyle
- Load Java program into the tool
- Tool automatically checks for style guides
- Some criteria are checked semi-automaticallyand
some manually - Tool automatically computes a metric and a
markaccording to conformance to style guidelines - Tool configuration
- Experience at HU in WS 04 /05and related work
21Tool configuration
- Selection and configuration of a proper set of
style errors for the lab (mistake types and
detailed checks) - Weight of particular mistake types
- Define the mark depending on the value of P
22Tool configuration (1)
Set of mistake types
you can configure all these with the tool
23Tool configuration (2, 3)
- Selection and configuration of a proper set of
style errors for the lab (mistake types and
detail checks) - Weight of particular mistake types, e. g.
missing commend 4 missing empty line
2 bad indentation 1 file too
long 9 - Define the mark depending on the value of P
24- Introduction
- How to use AssessStyle
- Experience at HU in WS 04 /05and related work
25Experience at HU in WS 04 / 05
- used by correctors without too much effort
- used by students as a pre-check of their
solutions - accepted by correctors and students
- programming style improved during the semester
?
26Programming style improved during the semester
a significant amount of students has a lot of
style error points
density (students)
style error points (P)
Figure 1 first Java exercise
27Programming style improved during the semester
now, almost all students have very few error
points
density (students)
style error points (P)
Figure 2 third Java exercise
28Related work style check and style assessment
AssessStyle independent yes
Java display of style
errors,
assessment of style Checkstyle
independent no Java
display of style errors Artistic Style
independent no C, C,
new formatting
C, Java JStyle windows
yes Java
display of style errors,
metrics Praktomat web-interface
web- Java, function tests
and display
interface C u. a.
of style errors, manuell
assisted
assessment Jalote-Prog. ?
? C
assessment of style
29Related work style check and style assessment
AssessStyle independent yes
Java display of style
errors,
assessment of style Checkstyle
independent no Java
display of style errors Artistic Style
independent no C, C,
new formatting
C, Java JStyle windows
yes Java
display of style errors,
metrics Praktomat web-interface
web- Java, function tests
and display
interface C u. a.
of style errors, manuell
assisted
assessment Jalote-Prog. ?
? C
assessment of style
- Very good, but
- commercial (1000 dollar / licence)
- no assessment
- metrics (e. g. Halstead, )
30Related work style check and style assessment
AssessStyle independent yes
Java display of style
errors,
assessment of style Checkstyle
independent no Java
display of style errors Artistic Style
independent no C, C,
new formatting
C, Java JStyle windows
yes Java
display of style errors,
metrics Praktomat web-interface
web- Java, function tests
and display
interface C u. a.
of style errors, manuell
assisted
assessment Jalote-Prog. ?
? C
assessment of style
- It checks very many programming style criterias
and - it is open source, but
- no GUI
- no assessment
31Related work style check and style assessment
AssessStyle independent yes
Java display of style
errors,
assessment of style Checkstyle
independent no Java
display of style errors Artistic Style
independent no C, C,
new formatting
C, Java JStyle windows
yes Java
display of style errors,
metrics Praktomat web-interface
web- Java, function tests
and display
interface C u. a.
of style errors, manuell
assisted
assessment Jalote-Prog. ?
? C
assessment of style
AssessStyle is an enhancement from Checkstyle!
GUI assessment manual checks statistics,
32Thank y u f r y ur attenti n!
? ? ? ?