Presentation is loading. Please wait.

Presentation is loading. Please wait.

Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin1 A style checker for JAVA and its application at.

Similar presentations


Presentation on theme: "Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin1 A style checker for JAVA and its application at."— Presentation transcript:

1 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin1 A style checker for JAVA and its application at HU 25.08.05

2 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin2 1.Introduction 2.How to use AssessStyle 3.Experience at HU in WS 04 /05 and related work

3 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin3 Humboldt University Berlin 1st 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin4 Students final grading covers correctness and programming style Assessment of Java programs at HU by correctors - assistance for correctors and students final grading - Java program compilability correctness programming style Java compiler apply the program to prepared test cases short manual inspection

5 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin5 Tool AssessStyle - assistance for correctors and students - Java program compilability correctness programming style Java compiler apply the program to prepared test cases short manual inspection Tool AssessStyle (since WS 04/05) Source: N. Rocca Diploma thesis, supervisor: K. Bothe

6 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin6 missing empty line missing white space wrong indentation switch without ‘default‘ method too long missing comment too short identifiers... Tool ‘AssessStyle‘: Style guide checks 48 criterias (check types) of good programming style, e. g. criterias (check types)

7 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin7 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 Tool ‘AssessStyle‘: Style guide checks 48 criterias (checks) of good programming style in the fields, e. g. in additional, you can group criterias to mistake types

8 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin8 How to use AssessStyle 1.Introduction 2.How to use AssessStyle 1.Load Java program into the tool 2.Tool automatically checks for style guides 3.Some criteria are checked semi-automatically and some manually 4.Tool automatically computes a metric and a mark according to conformance to style guidelines 5.Tool configuration 3.Experience at HU in WS 04 /05 and related work

9 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin9 User interface of AssessStyle Set of mistake types bad name D

10 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin10 Example of AssessStyle (1) Set of mistake types bad name D D

11 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin11 Example of AssessStyle (2) bad name D D

12 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin12 Example of AssessStyle (3) D

13 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin13 How to use AssessStyle 1.Introduction 2.How to use AssessStyle 1.Load Java program into the tool 2.Tool automatically checks for style guides 3.Some criteria are checked semi-automatically and some manually 4.Tool automatically computes a metric and a mark according to conformance to style guidelines 5.Tool configuration 3.Experience at HU in WS 04 /05 and related work

14 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin14 There are tree kinds of checks:  automatic  semi automatic  manual search algorithms are implemented; they are applied generally search algorithms are implemented; the user decides on their application search algorithms are not implemented; the user can mark mistakes manually

15 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin15 Example of AssessStyle - manual (1) bad name bad comment K

16 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin16 Example of AssessStyle - manual (2) bad name bad comment K K drag & drop

17 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin17 How to use AssessStyle 1.Introduction 2.How to use AssessStyle 1.Load Java program into the tool 2.Tool automatically checks for style guides 3.Some criteria are checked semi-automatically and some manually 4.Tool automatically computes a metric and a mark according to conformance to style guidelines 5.Tool configuration 3.Experience at HU in WS 04 /05 and related work

18 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin18 Tool computes a metric P and a mark Parameters are: 1.The weight of particular mistake-types, e. g. missing comment 4 missing empty line 2 bad indentation 1 file too long 9 2.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 mark total number P 10 – 20 220 – 40 341 – 60 461 – 80 581 – 100 6> 100

19 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin19 Tool has found these mistakes

20 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin20 How to use AssessStyle 1.Introduction 2.How to use AssessStyle 1.Load Java program into the tool 2.Tool automatically checks for style guides 3.Some criteria are checked semi-automatically and some manually 4.Tool automatically computes a metric and a mark according to conformance to style guidelines 5.Tool configuration 3.Experience at HU in WS 04 /05 and related work

21 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin21 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 Tool configuration

22 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin22 Tool configuration (1) Set of mistake types you can configure all these with the tool

23 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin23 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 Tool configuration (2, 3) total number P mark 0 – 201 20 – 402 41 – 603 61 – 804 81 – 1005 > 1006 you can configure all these whith the tool you can configure all these with the tool

24 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin24 1.Introduction 2.How to use AssessStyle 3.Experience at HU in WS 04 /05 and related work

25 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin25 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin26 Programming style improved during the semester Figure 1: first Java exercise style error points (P) a significant amount of students has a lot of style error points density (~students)

27 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin27 Programming style improved during the semester Figure 2: third Java exercise style error points (P) now, almost all students have very few error points density (~students)

28 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin28 Related work: style check and style assessment Program Operating system GUI File Types Aim of application 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin29 Related work: style check and style assessment Program Operating system GUI File Types Aim of application 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin30 Related work: style check and style assessment Program Operating system GUI File Types Aim of application 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin31 Related work: style check and style assessment Program Operating system GUI File Types Aim of application 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 Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin32 Thank y u f r y ur attenti n!


Download ppt "Style checker for JAVA Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin1 A style checker for JAVA and its application at."

Similar presentations


Ads by Google