Learning about good practices at INSA

This article was written for Frédéric Baucher, a teacher at INSA (Institut National de Sciences Appliquées). He shares with us his feelings and his feedback on the use of Promyze in the context of teaching.

Context and course content

The INSA group brings together 7 schools, including 6 in France and 1 in Fez (Morocco) with the Euromedschool. It is in this school that the experimentation took place. After a first experiment in the autumn of 2019 with students at Master 2 level (5th year engineer), a new opportunity to measure the interest of Promyze in IT teaching at INSA presented itself with the confinement linked to Covid19. Scheduled for mid-March in the classroom, the organisation of teaching “ Database (BD) – Interaction with a Database” had to be rethought in a few days for a remote context.

The ”  Databases  ” course is given to students at L2 level (2nd year engineering) and is based on theoretical acquisition (database modelling and design), and implementation at source code level is approached in the Java language. The notion of good practices is introduced with some implementation patterns from the book “Patterns of Enterprise Application Architecture” in which Martin Fowler participated in particular. These are implemented in a project carried out by teams of 3 to 4 students.

Given the maturity of the students (and the length of time they have been of the exercise: 6 weeks), the project (in the FilRouge format) aims to teach the main activities of a development cycle without insisting on their positioning in a given type of cycle.  (in cascade : V, W, Y / agile : SCRUM, KANBAN, …). To avoid dispersion, the development chain is imposed to groups of students, and the list of deliverables is clearly defined. Particular attention is paid to ensure that the quality of the deliverables is included in the process and equipped (in an automated way or to accompany a manual intervention).

Why choose Promyze?

A catalog of needs to be met by the development chain has been established. While Github and Jenkins were chosen for code storage and continuous integration, code analysis, evolution of code coverage or the possibility of code reviews were also criteria for the decision. Other criteria were also considered :

  • Support for Java, SQL (and incidentally JavaScript and HTML) languages
  • Availability in SaaS
  • Openness to collaborative use: data sharing between all the students of a team, possible access to the teacher for annotation
  • Consistency between the tools used
  • A limited mental load by avoiding the multiplication of different tools

If a tool like SonarQube was one of the candidates, Promyze brought an additional answer on 2 points in our pedagogical context :

  • The “Workshop Craft” feature that facilitates the illustration and implementation of good practices, especially those we present in the courses.
  • An evolution on code qualityand code coverage rate, with an individualized approach per developer, more conducive to student awareness and support.

Nevertheless, we can point out that a greater experience acquired during previous educational projects as well as the support of the Promyze team also contributed to the selection of their solution (especially in the timingimposed by Covid19). In the rest of this article, the study of the 2 main functionalities of Promyze will show its contribution to FilRouge type projects.

Asset #1: A reusable code review thanks to Craft Workshops

The Atelier Craft feature has been identified as a good experiment for organizing code review sessions. These activities were often practiced, until this episode, in an informal way, in the lab room, through a close exchange, by means of finger pointing on the screen of the commented code pieces !

ThePromyze Craft Workshops are designed to facilitate the implementation of good practices. The objective is to organize collective code reviewsessions to bring out and document the good practices to be applied, challenge them and make them evolve. A human assessment will be necessary here, we are not talking about code smells identifiable by qualimetry tools. These regular sessions will allow each person to annotate the code to identify areas for improvement or to highlight the implementation of good practices.

In our pedagogical framework, the Craft Workshop is used to assess the students’ skill acquisition. The source code is only a trace of the application (correct or not) of good practices. A session therefore corresponds to the evaluation of projects at a milestone of the pedagogical activity. In our context, a Craft Workshop will gather all the files of a certain type, which will be found within each project. The objective is to highlight certain implementations, to explain again certain concepts that have not been followed, and to make evolve if need be our repository of good practices.

The Craft Workshop makes it possible to work both downstream, in a proactive way (by documenting the good practices a priori) and upstream, in a reactive way, by documenting, at the sight of the students’ behaviors, the possible good practices whose highlighting had not been anticipated.

The Atelier Craft presents interesting characteristics on 2 levels   :

  • Semantics: The example or good application of the good practice (the positive) or the counter-example, the absence or misapplication of a good practice (the negative) are both good ways to convey this type of knowledge.  : the code review in a Craft Workshop allows to type the semantics of the link between a code extract and a good practice (for an example, annotation in green, for a counter-example, annotation in orange).
  • Productivity: When a good practice is identified in a file, the corresponding code can be added for illustration by clicking the Sample button on the annotation bar. When a counter-example is identified in a file, a correction can be proposed to show how to apply the good practice to the annotated case by clicking the Propose Correction button on the annotation bar.

Overview of a workshop with here 2 proposed areas of improvement

In the capture above, we observe that 2 good practices have been proposed, one of which recommends annotating the methods to be implemented with a comment “//TODO”.

Some “tags” can be commented on, as shown below with a suggestion to define a naming convention :

Comment put a tag

It should be noted that other practices, applicable to more traditional code review tools, have already been documented   But they do not make it possible to achieve either productivity for the author or ergonomics for the developer, as Promyze allows in the same context.

Moreover, the sedimentation of knowledge in good practice allows it to be reusedand to evolve from Atelier Craft to Atelier Craft.

Asset #2: Awareness of code analysis tools

To raise awareness of the concept of ”  quality  ” as a whole, the centralization of information within the same interface avoids dispersion in the tools and contributes to forging the coherence of the concept among students. The availability on a single portal, on a single page, of the evolution of test coverage and static analysis results on the project code gives an overall awareness of the team’s actions.

One of Promyze’s strong points consists in individualizing the contribution to the technical debt. In his cockpit, the student can appreciate his personal contribution where all the actions, evaluated as healthy, restorative and harmful, are traced back to him, with a link to the annotated code to locate the source of each evaluation. These are calculated according to the source analysis tools (linter). For convenience, an embedded linter in Promyze has been enabled (Java – Checkstyle) and configured for a subset of rules set by editing a configuration file from Promyze. This individualization of the data is part of a process of continuous improvement and awareness raising.

Conclusion and Outlook

This article reports on the use of Promyze in the context of L2 level teaching. Beyond its use as a unifying portal around code quality, one of the innovative contributions of the tool lies in the notion of “quality of code”. Craft workshop. Prior to the experiment described in this article, code annotation was rather filled by code review tools (or even by on-screen proofreading sessions in a PT session). Putting these tools into perspective allows a better understanding of the purposes that can be expected from one or the other :

  • On a classic code review tool, a piece of code is reread before it is added to the global code of an application, to check certain conventions and improve the code before merging.
  • With Ateliers Craft, the work consists in defining, disseminating and continuously improving a repository of good practices, in order to share and capitalize more easily on knowledge. It is easy to understand why the Atelier Craft is a natural part of a pedagogical framework to help students improve their skills and accompany their progress.

While the health context was exceptional, L2 students were able to continue to improve their skills by using Promyze in the Craft Workshops. Although their role was limited to that of observer, they were able to analyze the quality of their code individually and collectively. This allowed them to learn directly about good practices and improvements to be made from their own work. A practical workshop that the students enjoyed and that we will repeat with the M1s at the start of the 2020 academic year. We also plan to change the role of the students to make them more actors and facilitators of the approach.

See you at the beginning of 2021 for a new feedback on these uses!

Start connecting developers' knowledge with Promyze

Best coding practices shared from IDEs & Code reviews

Promyze, the collaborative platform dedicated to improve developers’ skills through best practices sharing and definition.

Crafted from Bordeaux, France.

©2023 Promyze – Legal notice