A style checker for JAVA and - PowerPoint PPT Presentation

About This Presentation
Title:

A style checker for JAVA and

Description:

Title: XCTL-System Author: sacklows Last modified by: Uli Sacklowski Created Date: 8/15/2001 8:43:31 AM Document presentation format: Bildschirmpr sentation – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 33
Provided by: sack151
Category:

less

Transcript and Presenter's Notes

Title: A style checker for JAVA and


1
  • A style checker for JAVA and
  • its application at HU

25.08.05
2
  1. Introduction
  2. How to use AssessStyle
  3. Experience at HU in WS 04 /05and related work

3
Humboldt 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
4
Assessment of Java programs at HU by correctors-
assistance for correctors and students final
grading -
Java program
programming style
compilability
correctness
5
Tool AssessStyle- assistance for correctors and
students -
Java program
programming style
compilability
correctness
6
Tool 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)
7
Tool 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
8
How to use AssessStyle
  1. Introduction
  2. How to use AssessStyle
  3. Load Java program into the tool
  4. Tool automatically checks for style guides
  5. Some criteria are checked semi-automaticallyand
    some manually
  6. Tool automatically computes a metric and a
    markaccording to conformance to style guidelines
  7. Tool configuration
  8. Experience at HU in WS 04 /05and related work

9
User interface of AssessStyle
Set of mistake types
bad name
D
10
Example of AssessStyle (1)
Set of mistake types
D
bad name
D
11
Example of AssessStyle (2)
D
bad name
D
12
Example of AssessStyle (3)
D
13
How to use AssessStyle
  1. Introduction
  2. How to use AssessStyle
  3. Load Java program into the tool
  4. Tool automatically checks for style guides
  5. Some criteria are checked semi-automaticallyand
    some manually
  6. Tool automatically computes a metric and a
    markaccording to conformance to style guidelines
  7. Tool configuration
  8. Experience at HU in WS 04 /05and related work

14
There 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
15
Example of AssessStyle - manual (1)
bad comment
K
bad name
16
Example of AssessStyle - manual (2)
bad comment
K
bad name
17
How to use AssessStyle
  1. Introduction
  2. How to use AssessStyle
  3. Load Java program into the tool
  4. Tool automatically checks for style guides
  5. Some criteria are checked semi-automaticallyand
    some manually
  6. Tool automatically computes a metric and a
    markaccording to conformance to style guidelines
  7. Tool configuration
  8. Experience at HU in WS 04 /05and related work

18
Tool 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
19
Tool has found these mistakes
20
How to use AssessStyle
  1. Introduction
  2. How to use AssessStyle
  3. Load Java program into the tool
  4. Tool automatically checks for style guides
  5. Some criteria are checked semi-automaticallyand
    some manually
  6. Tool automatically computes a metric and a
    markaccording to conformance to style guidelines
  7. Tool configuration
  8. Experience at HU in WS 04 /05and related work

21
Tool configuration
  1. Selection and configuration of a proper set of
    style errors for the lab (mistake types and
    detailed checks)
  2. Weight of particular mistake types
  3. Define the mark depending on the value of P

22
Tool configuration (1)
Set of mistake types
you can configure all these with the tool
23
Tool configuration (2, 3)
  1. Selection and configuration of a proper set of
    style errors for the lab (mistake types and
    detail checks)
  2. Weight of particular mistake types, e. g.
    missing commend 4 missing empty line
    2 bad indentation 1 file too
    long 9
  3. Define the mark depending on the value of P

24
  1. Introduction
  2. How to use AssessStyle
  3. Experience at HU in WS 04 /05and related work

25
Experience 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

?
26
Programming 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
27
Programming 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
28
Related 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
29
Related 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, )

30
Related 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

31
Related 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,
32
Thank y u f r y ur attenti n!
? ? ? ?
Write a Comment
User Comments (0)
About PowerShow.com