When teaching Programming and Software Engineering in Bachelor’s
Degree programs, the emphasis on creating functional software
projects often overshadows the focus on software quality, a
trend consistent with ACM curricula recommendations. Dedicated
Software Engineering courses take typically plac...
When teaching Programming and Software Engineering in Bachelor’s
Degree programs, the emphasis on creating functional software
projects often overshadows the focus on software quality, a
trend consistent with ACM curricula recommendations. Dedicated
Software Engineering courses take typically place in the later stages
of the curriculum, and allocate only limited time to software quality,
leaving educators with the difficult task of deciding which quality
aspects to prioritize. To educate students on the importance of developing
high-quality code, it is important to introduce these skills
as part of the assessment criteria. To this end, we have implemented
a pipeline based on advanced frameworks such as ArchUnit and
SonarQube. It was successfully tested on a class of students engaged
in the Object Oriented Programming course, demonstrating its usefulness
as a resource for educators and providing some concrete
evidence of quality problems in student projects
Size: 2.02 MB
Language: en
Added: Jul 20, 2024
Slides: 24 pages
Slide Content
Automatic Assessment of Architectural Anti-patterns and Code Smells in Student Software Projects Marco De Luca, Sergio Di Meglio , Anna Rita Fasolino , Luigi Libero Lucio Starace , Porfirio Tramontana , University of Naples “Federico II” 2 nd Workshop on evaLuation and assEssment in softwARe eNgineers’ Education and tRaining LEARNER 2024 @ EASE 2024 Salerno, Italy, June 21 st , 2024.
Motivations A project-based approach for teaching object-oriented programming has many advantages: Provides an early introduction to software design concepts
Encourages students to work in groups, share information, understand the first concept of teamworking Integrates multidisciplinary knowledge, e.g. Software Engineering, Programming and Database
Allows students to observe and appreciate the concrete result of their work In our experience as teachers, the project-oriented approach also positively affects students' performance compared to an analytical approach LEARNER 2024, Salerno, June 21st, 2024
Problem LEARNER 2024, Salerno, June 21st, 2024
Typical Quality Issues in Student’s projects Architectural Issues Architectural patterns maintain higher the project quality but are often neglected by students in favour of easier programming solutions Code Issues Clean Code recommendations are often neglected many code smells can be found in student’s code LEARNER 2024, Salerno, June 21st, 2024
Our contribution : general idea We have started a long- term experimentation aiming at : Measuring the occurrence of quality issues in student’s projects Improving the teaching by early introducing quality concepts Measuring the improvement in quality LEARNER 2024, Salerno, June 21st, 2024
Current Contribution In this paper we will present a first pilot study aiming at measuring the occurrence of some common architectural and code issues in the projects realized by all the students of a Bachelor Degree programming course LEARNER 2024, Salerno, June 21st, 2024
Research questions LEARNER 2024, Salerno, June 21st, 2024
Context Object Oriented Programming course 2nd Year of Bachelor Degree in Computer Science @ University of Naples Federico II Students previously had a first programming course at 1st year The course is taken in parallel with a Database course 48 lecture hours (6 ECTS) Java language LEARNER 2024, Salerno, June 21st, 2024
Assessment LEARNER 2024, Salerno, June 21st, 2024 Students are divided in teams of 2 or 3 Different projects were assigned to each group Students has to upload and present their project after the end of the course Only after project presentation, the students can sustain an individual written exam, followed by an oral exam The completeness and correctness of the project were mainly considered Also the project quality influenced the teacher’s judgement
Architectural Issues During the course the teacher presented a specific architectural pattern explaining its benefits and drawbacks The students never had previous teaching about design patterns LEARNER 2024, Salerno, June 21st, 2024
The proposed Architectural Pattern Similar to a Boundary – Controller – Entity , with the introduction of a DAO pattern 4 allowed interactions G C CD CM 8 unallowed interactions GD GM DC MC DM LEARNER 2024, Salerno, June 21st, 2024
Measuring Architectural Pattern Violations ArchUnit is an open source project able to define architectural pattern violations in form of JUnit Test Cases Two of the authors implemented ArchTest cases by substituting the name of the packages used by students in a set of predefined test cases LEARNER 2024, Salerno, June 21st, 2024
Code Quality Assessment The most popular tool for measuring code quality issues is SonarQube 677 Java rules Issues are categorized : By type ( Bug , Vulnerability and Code Smell ) By severity ( Critical , Major , Minor , Info ) LEARNER 2024, Salerno, June 21st, 2024
Case study LEARNER 2024, Salerno, June 21st, 2024
Results : RQ1 Number and percentage of projects presenting at least one disallowed interaction LEARNER 2024, Salerno, June 21st, 2024
Results : RQ1 Number and percentage of projects presenting at least one disallowed interaction LEARNER 2024, Salerno, June 21st, 2024 The direct access to model classes was a shortcut for students but implies inestricable coupling for the project
Results : RQ1 Number and percentage of projects presenting at least one disallowed interaction LEARNER 2024, Salerno, June 21st, 2024 GUI and Data Access Objects should remain independent between them
Results : RQ2 More common code issues found by SonarQube ( number and percentage presenting at least one occurrence of the issue ) LEARNER 2024, Salerno, June 21st, 2024
Results : RQ2 LEARNER 2024, Salerno, June 21st, 2024 Open resources can cause performance problems
Results : RQ2 LEARNER 2024, Salerno, June 21st, 2024 Duplicated string literals can cause incoherences during code maintenance They should have been substituted by constant resources , also to ease localization High Cognitive complexity makes maintenance more difficult
Results : RQ2 LEARNER 2024, Salerno, June 21st, 2024 Log messages should be redirected to log files with an appropriate formatting Unused assignments and imports and equal branches are symptoms of code smells due to lack of code review
Results : RQ2 LEARNER 2024, Salerno, June 21st, 2024 Naming conventions are useful to improve code understandability
Conclusions LEARNER 2024, Salerno, June 21st, 2024
Future Works LEARNER 2024, Salerno, June 21st, 2024 To extend the experimentation to different courses and different editions of the same course To measure whether more teaching about code and architecture quality can reduce the occurrence of issues