1 / 32

A style checker for JAVA and its application at HU

A style checker for JAVA and its application at HU. 25.08.05. Introduction How to use AssessStyle Experience at HU in WS 04 /05 and related work. Humboldt University Berlin 1st Semester. Introduction to object-oriented programming with Java: lectures: 64 hours

ollie
Download Presentation

A style checker for JAVA and its application at HU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Introduction • How to use AssessStyle • Experience at HU in WS 04 /05and related work Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  4. apply theprogram topreparedtest cases short manualinspection Javacompiler 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 programming style compilability correctness Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  5. apply theprogram topreparedtest cases short manualinspection Javacompiler ToolAssessStyle(since WS 04/05) Source:N. Rocca Diploma thesis, supervisor: K. Bothe Tool AssessStyle- assistance for correctors and students - Java program programming style compilability correctness Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  6. 48 criterias (check types) of good programming style, e. g. 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) Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  7. 48 criterias (checks) of good programming style in the fields, e. g. 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  8. How 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

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

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

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

  12. Example of AssessStyle (3) D Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  13. How 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  14. search algorithms are implemented; they are applied generally There are tree kinds of checks: • 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

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

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

  17. How 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  18. mark total number P 1 0 – 202 20 – 403 41 – 604 61 – 805 81 – 1006 > 100 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  19. Tool has found these mistakes Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  20. How 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  21. Tool 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

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

  23. you can configure all these with the tool you can configure all these whith the tool total number P mark 0 – 20 120 – 40 241 – 60 361 – 80 481 – 100 5> 100 6 Tool 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  24. Introduction • How to use AssessStyle • Experience at HU in WS 04 /05and related work Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  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  Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  26. a significant amount of students has a lot of style error points Programming style improved during the semester density (~students) style error points (P) Figure 1: first Java exercise Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  28. Program Operating system GUI File TypesAim of application 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  29. Program Operating system GUI File TypesAim of application 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, …) Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  30. Program Operating system GUI File TypesAim of application 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 Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  31. Program Operating system GUI File TypesAim of application 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, … Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

  32. Thank yu fr yur attentin!     Baile Herculane, 28.8. – 3.9.2005 U. Sacklowski, Dept. of Comp. Sc., HU-Berlin

More Related