Pieter has posted 1 posts at DZone. You can read more from them at their website. View Full User Profile

Pieter van den Hombergh: Why NetBeans IDE is Great for Teaching Java

12.19.2013
| 3526 views |
  • submit to reddit
After meeting Michiel Noback from Hanze University of Applied Sciences, in Groningen, the Netherlands and Zoran Sevarac from the University of Belgrade in Serbia, let's visit another teacher using NetBeans IDE in the classroom. Let's visit Venlo in the Netherlands, in particular... Pieter van den Hombergh, Richard van den Ham, and Ferd van Odenhoven, the Java team of the software engineering and business informatics department of the Fontys University of Applied Sciences in Venlo, the Netherlands! -- NetBeans Team

The primary programming language we teach in our department of software engineering and business informatics in Venlo is Java. We feel that once you have a sound understanding of object orientation in Java, you can apply that understanding easily to other languages and even paradigms. This is proven over and over again when our students take an internship or do their final project.

Speaking for software engineering, we use Java as a teaching language in all semesters for various programming and design concepts. In the first semester we start with BlueJ, to keep the students from any of the distractions of a luxurious IDE and let them handle object more directly. For the semesters 2, 3, 4, and 7 which are the in-house semesters, we teach Java using NetBeans IDE.

NetBeans IDE

Students pick up the usage of NetBeans IDE really quickly and it provides everything we need in our teaching, either out of the box or using a plugin, of which there are many. One of the nice aspects of NetBeans IDE is that providing plugins is quite easy, as we have seen recently in a workshop with Geertjan Wielenga.

For example, below you see the TikiOne JaCoCoverage plugin in action. Though the code is maybe a bad example, it serves to illustrate the useful annotations provided by the plugin:

Open Source, Open Standards

What we have learned to love is the fact that NetBeans IDE is not only open source, but also uses open standards for its internal infrastructure. For instance, the default build system is Ant based, meaning you don't need to tweak your build scripts to build your project on a build server or from the command line. Not only is Ant a first class citizen in the NetBeans IDE world: Maven is that too.

Personally I have always been a bit reluctant to use Maven because of the phenomenon of what I call "Mavenitis". In other words, start Maven and your machine gets a real download addiction! But because NetBeans IDE has such great Maven support with text and dependency completion, it is a joy to use this combination, given a healthy portion of patience when you first start with Maven or have a Maven project with problematic dependencies.

What is also nice is that NetBeans IDE is not a one trick pony! NetBeans IDE, for instance, supports many web standards and is very capable of creating modern HTML 5 websites, with almost any framework you would want to use, including any JavaScript library you care to name. And the PHP support is so nice that it lured me away from my previous IDE for that task.

In our courses, we use NetBeans IDE for the following features:

  • Programming in Java 2: Swing development, JSF, and testing
  • Software engineering 1: testing: unit tests, coverage measurement (via the plugin shown above) and continuous building
  • Algorithms and data structures: coding, testing
  • Programming in Java 3: Java concurrency, coding, testing and performance monitoring.
  • Java Enterprise Edition and architecture: coding, Java EE server integration

NetBeans Exam Sandbox

Not only is NetBeans IDE great for teaching, it is also great as an environment for exams, both for preparation and taking of exams. Since almost 8 years now, we let our students use NetBeans IDE during a type of exam that we refer to as "performance assessment".

Because it is trivial to set up NetBeans IDE, we are able to provide students with a live Ubuntu USB stick during performance assessment. On this stick they have a complete NetBeans IDE, including a Glassfish installation, and a version control system. Currently that is Subversion. The students boot their own laptops from that stick and are then able to use everything they need during the assessment. In other words, they have a closed environment for testing. In particular, they cannot access the hard disk or other storage on their machine, and they can only access the network servers that we provide. This is what we call the "exam sandbox".

We prepare the exam using NetBeans IDE and adapt the builds of the exam project in such a way that we can derive the exam tasks from a known and correct implementation of an exam application.

By using an Ant extension called "codestripper", we can remove all parts that make up the student's tasks during the exam and from that create the initial project the students work with. Every students gets a personal exam repository, which we seed with the prepared exam project. Then students check out this project during the assessment session and hand in their solution by committing their work to our exam server. After the assessment, we export all student repositories into a correction sandbox and start correcting from there.

NetBeans Study Example

NetBeans IDE is not only a great tool for studying, teaching, and examining but it is also a very nice study subject in itself. Since the NetBeans Platform is open source, you can inspect it, in every nook and cranny. The documentation is also really complete and easy to use.

In a workshop, our 7th semester students were quickly on par to create simple plugins with actions, on which we built our correctors workbench. There is also a quite interesting book by Jaroslav Tulach called “Practical API Design: Confessions of a Java Framework Architect“ in which the principal architect shares confessions on the evolution of the NetBeans Platform. Very interesting read if you want some insight and study material on the evolution of a complete platform!

Anyway, for our teaching practice we are playing with NetBeans IDE plugins.

To ease and minimize the risk of making errors during the preparation of the initial assessment projects, we are currently working on a small plugin we call the "correctors workbench".

Using the NetBeans IDE plugin project templates, and after doing some studying, this appears to be a doable task. The final goal of the plugin is to use it during correction of the exams as well. We consider it very helpful to use the IDE itself to correct students work because that is the same view that the students have during the assessment. At the moment of writing, one part of the plugin, called "ExamMarker", is more or less usable to select parts of source code and and mark those parts as tasks or solutions.

http://plugins.netbeans.org/plugin/52276/cwb-exammarker

Think of the task as the context of something to be done and the solution as something to be stripped from the initial student project. We use it for Java in both NetBeans IDE and BlueJ exams and in SQL exams of a similar style too.

The source code to the plug in can be found at git://github.com/homberghp/correctorsworkbench/. Feel free to clone/fork and maybe send some interesting push requests!

Here's the exam marker in action:

Published at DZone with permission of its author, Pieter Van den Hombergh.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)