Um Ihnen einen Vergleich zwischen Dirty- und Clean-Code zu demonstrieren, haben wir ein kleines Coding-Dojo erarbeitet.
Anwendung (exemplarisch):
Die Teilnehmer werden in zwei Gruppen (Clean oder Dirty) aufgeteilt; jeder Teilnehmer arbeitet zunächst allein. Zu Beginn des Dojos bekommt jeder Teilnehmer etwa zur gleichen Zeit (per E-Mail) das jeweilige Zip (s.u.) zugeschickt. In dem Zip steckt ein kleines Java-Maven-Projekt, das in einer IDE importiert werden kann. Es enthält eine Klasse, die einen einfachen Parser implementiert, und eine entsprechende Test-Klasse. Ziel ist es, eine kleine Anpassung vorzunehmen (s. auch Aufgabenstellung.pdf), so dass alle Tests „grün werden“.
Sobald ein Teilnehmer mit der Aufgabe fertig ist, schickt er eine Erfolgsmeldung per E-Mail an den Veranstalter zurück. Anhand der E-Mail-Sendezeiten kann die Dauer für jeden Teilnehmer und anschließend die durchschnittliche Dauer pro Gruppe ausgewertet werden.
Downloads:
- Aufgabenstellung.pdf : Aufgabenstellung.pdf
- CSVParserClean.zip : CSVParserClean.zip
- CSVParserDirty.zip : CSVParserDirty.zip
Optionale Hilfsmittel für die Clean-Variante:
- FinateStateMachine.pdf : FinateStateMachine.pdf
- Transductor.zip : Transductor.zip
We have created a little coding dojo to demonstrate you the difference between a clean and a dirty implementation of the same task.
The procedure (exemplary):
The participants are divided into two groups, a clean and a dirty one. Initially, everyone works on his own way. At the beginning of the dojo every participant gets a zipped file via eMail at the same time. The zip consists of a Maven project containing a main class (implementing a little parser) and one belonging test class. The goal is to accomplish a marginal requirements change.
When the task has been done what can be verified by running the test class (all test „are green“) the developer sends a message back to the organizer. After this session the response times can be calculated and compared together per group.
Downloads:
- CSVParserClean.zip : CSVParserClean.zip
- CSVParserDirty.zip : CSVParserDirty.zip
Optional resources for the clean version:
- FinateStateMachine.pdf : FinateStateMachine.pdf
- Transductor.zip : Transductor.zip