Software Construction 2009-2010

Version: $Id: sc0910.text 5437 2010-03-11 13:36:03Z storm $

Introduction

This documents aims to cover all information concerning the course Software Construction 2009-2010.

Schedule

Lectures and workshops will be from 9:00-11:00 on Mondays. Lectures will be given by Paul Klint, Jurgen Vinju and/or Tijs van der Storm.

Primary contact for this course is .

February (week 5 - 8)

  • Lecture Parsing
  • Workshop (2 topics, 4 teams)
  • Workshop (idem)
  • Workshop (idem)

March (week 9 - 12)

  • Workshop (idem)
  • Lecture Domain Specific Languages
  • (lecture has been canceled)
  • Lecture Debugging + Code reviewing workshop

How pass this course

Required skills:

  • Creating good low level designs
  • Produce clean, readable code
  • Reflect upon and argue for/against software construction techniques, patterns, guidelines etc.
  • Assess the quality of code

Required knowledge:

  • Understand basic principles of language implementation (parsing, AST, evaluation)
  • Understand the difference between computation and coordination

Pre conditions for getting a grade:

  • You have to pass all on-line Code Complete tests (see below).
  • You have to be present during all lecture and workshop sessions.
  • You have to be present during the Code Review Workshop

You will be graded on the following course assignments:

  • L: Lab assignment (practical course)
  • P: Presentation and participation during workshops

The grade is computed using the following formula: 0.7 * L + 0.3 * P. For all assignments a minimum grade of 5.5 is required to pass the course.

Code Review workshop

Date: 22nd of March, 13:00 - 17:00.

Location: lab room.

The goal of the code review workshop is to encourage critical thinking with respect to code quality and low level design. Important questions are: what is code quality? What are relevant quality attributes? How about code smells? How can you improve the design of existing code? Etc.

The structure of the workshop will be as follows:

NB Participation is mandatory!

Code Complete

During the course you will be tested on understanding the concepts and ideas of McConnell's Code Complete. Every week (6 weeks in a row) there will be an on-line test on Monday or Tuesday, according the following schedule:

Workshops

Each workshop, two topics will be presented by two teams each. The topics are centered around a thesis concerning the advantage or disadvantage of a certain technique or approach in the domain of software construction. The first team will argue for the thesis. Then, the second team acts as opposition and will give a presentation arguing against the thesis.

Each team consists of two members. Topics are to be selected from the list at the end of this document. The references listed there are required reading for EVERYONE. It is, moreover, required to find at least two other papers related to the position you are defending.

Guidelines for giving the presentation:

Presence during the workshops is required. The presentations will be graded by teachers present.

Workshop Schedule

08-2

  1. Christian Köppe and Niels Sijm: Prototype-based OO
  2. Chris Brouwer and David Walschots: Class-based OO
  3. Timon Snetselaar and Elephtera Hendriks: GOTOs are good
  4. audience

15-2

  1. Waruzjan Shahbazian and Steven Raemaekers: AOP is good
  2. Marvin Jacobsz and Gijs van Lammeren: AOP is bad

22-2

  1. Maarten Kieft and Rob Smit: Design by Contract is bad
  2. Davy Landsman and Willem Fibbe: Design by Contract is good
  3. Jouke Stoel and Niels Beekman: Pros of Fluent Interfaces
  4. Sjuul Jansen and Daan van Etten: Law of Demeter

01-3

  1. Dennis Bijlsma and Arseni Storojev: Maximizing reuse does NOT minimize use
  2. Davy Meers and Lars Coenegracht: Maximizing reuse does minimize use
  3. Jakob Furrer and Jelle Geelhoed: Pro Literate Programming
  4. Frank Versnel and Edwin van Manen: Against Literate Programming

Lab assignment: a Logo interpreter

The assignment to develop an interpreter for the programming language Logo. You are required to develop this interpreter in Java, and you are required to use Eclipse as IDE.

Logo is a language primarily known for its turtle graphics. See e.g., Logo for more information.

Requirements

Required user interface features:

  • A canvas window showing a turtle (cursor), initially centered in the middle of the canvas.
  • A command line text area for entering Logo commands, which are executed after acceptance. This area also shows (textual) output of Logo commands (if any).
  • A facility to load a text file containing a Logo program which is then executed.

Required Logo language features

  • Data values: words, lists, numbers
  • Variables: use of variables in expressions and the "make" command
  • Drawing commands: "showturtle", "hideturtle", "forward", "back", "right", "left", "clearscreen", "home", "pendown", "penup", "setpencolor"
  • Numeric expressions: <, <=, >=, >, +, -, *, /.
  • Output command: "print".
  • Control flow: "repeat", "if", "ifelse", "while", "output", "stop"
  • Procedure definition: "to".

As a reference for these commands and features, see the UCB Logo. You may implement more language features at will.

Required components

  • A parser, transforming Logo source text into trees data structures.
  • The tree structures produced by the parser should conform to a abstract syntax tree (AST) hierarchy.
  • The interpreter which processes ASTS

You are encouraged to use a parser generator for the parser component (e.g. ANTLR, JavaCup, JavaCC, Rats! etc.).

Amendments

Procedure calls as Expressions

You may assume that procedure calls with one or more arguments within infix expressions are surrounded by parentheses. E.g.:

f :x + 3 // ast = [f, +(x, 3)]
3 + f :x // ast = [+(3,f), f]
f :x :y :z + 3 // ast = [f, x, y, +(z, 3)]
3 + (f :x) // ast = +(3, f(x))

Procedure calls without arguments do not require parentheses:

3 + f // ast = +(3, f())

So, a list of arguments is a list of expressions and a procedure call with arguments is only an expression if surrounded by parentheses.

NB: don't forget that other (infix) expression can be nested without parentheses and that you have to think about operator associativity and precendence:

1 - 2 - 3 - 4 // ast = -(-(-(1, 2), 3), 4)

I.e. Subtraction is left associative.

Optional parameters

UCB Logo allows optional and rest arguments in procedure definitions; you do not have to support this.

Unparsed Lists

In Logo, instructions like "if", "ifelse" and "repeat" reparse the contents within brackets ([]) at runtime. You are allowed to parse these lists as code up-front.

What we look for

We take the principles laid down in Code Complete as guidelines when grading your solutions. More specifically, the following aspects of quality code will be our focus:

  • Functionality (e.g., are the requirements implemented)
  • Tests (e.g., presence of meaningful unit tests)
  • Simplicity (absence of code bloat and complexity; YAGNI)
  • Modularity (e.g., encapsulation, class dependencies, package structure)
  • Layout and style (indentation, comments, naming of variables etc.)
  • Sensible use of design patterns (e.g., Visitor)

In addition, you are yourself required to review someone else's implementation on exactly these matters. This code review will be performed on-line using Blackboard and will be graded (as indicated above).

NB: high performance and fancy GUIs will not contribute to your grade, so you are advised not to waste time on those aspects.

Deadline

The (tentative) deadline for the lab assignment is: 31st of March 2010.

IMPORTANT: You are required to complete the lab assignment individually.

Appendix: Workshop Topics

Structured programming with or without gotos?

State Transactional Memory

Internal vs external DSLs

Aspect-Oriented Programming

Literate Programming in the 21st Century

Prototype-based vs class-based object-orientation

Design by Contract

Fluent or Law-of-Demeter?

Maximizing reuse minimizes use

Design Patterns are Code Smells