Mihai Balint 2009

Weekly labs held on Friday from 08-10 and 10-12 in room B426. For questions email mihai*cs.upt.ro

Important announcements

Usefull stuff

Week 12 (22.May). Build systems. Ant.

  • Ant tutorials and documentation
  • Assignment 6 (due 29.May): Write an Ant script for your projects. Required targets:
init - performs a clean and creates a folder called build
compile - should depend on init and should compile the actual project source files using external libraries (if applicable) contained in "lib", into the folder named "build"
deploy (default target) - creates a folder called "deploy" into which it creates a jar containing the compiled classes under "build". Should depend on compile.
run - should run the compiled project
clean - restores the project to the initial state (deletes everything except the source code and data files).

Week 11 (15.May) Final Deadline for Assignment 4

  • UnitTesting with JUnit
JUnit on sourceforge http://junit.sourceforge.net/
JUnit CookBook (updated for JUnit 4) http://junit.sourceforge.net/doc/cookbook/cookbook.htm
TestInfected - about testing (exemple code written using JUnit 3) http://junit.sourceforge.net/doc/testinfected/testing.htm
  • Assignment 5 (due 22.May) - The following code contains classes used to represent a date from the calendar and a few tests for those classes. Write additional tests as instructed in the comments from the files: TestDateArithmetic.java and TestDateComparison.java.

Week 10 (08.May) Deadline for Assignment 4 (extended 1w).

  • Updated requrements: Managers also receive commissions and salaries (either monthly flat salary or hourly rate salary). All submitted sales receipts are added as company income. Employees are paid only if the company has sufficient funds for salaries. Salaries are paid from company funds.

Week 9 (01.May) - International Labor day

Week 8 (17.Apr) - IDEs (Eclipse)

  • Eclipse IDE (creating projects, perspectives, views, SVN, refactorings). Example sources.
  • Documentation

Assignment 4 - Using your favorite Object-Orinted Language and IDE (with support for refactoring, subversion and which runs on the lab computers), implement a working version of the The Payroll System documented in the previous assignment. Consider this (incomplete) list of use cases as objectives that must be implemented for the interim Milestone (next lab - should have been May 1st). The complete, working system is due before the Deadline (May 08). Since there was no interim milestone, a few bugs will be accepted.

Week 7 (10.Apr) - CRC Cards

Documentation: CRC Intro

Last lab for final year students. 4th year guys, please prepare the following:
  • Missing assignments (A1, A2 and A3)
  • Unit Testing. Black-box testing. White/Glass box testing. More info: lecture slides - Software testing, slides 43-57,
  • Implementing unit tests using JUnit. JUnit CookBook (updated for JUnit 4). TestInfected - testing practice (code is for JUnit 3). JUnit at SourceForge. JUnit java doc API

Week 6 (03.Apr) - Buffer lab, no new sutff, assignment reviews only

Week 5 (27.Mar) - UML Use-Case Diagrams

  • Documentation
M. Fowler - UML Distilled, Chapter 9
K. Beck - Extreme Programming Explained, Chapter 15
  • Assignment 3 (due 03.Apr) - Draw a use-case diagram and asociated story cards using the following requirements:
The Payroll System. Our company has grown very large recently and we need software to automate our payroll. The software must pay each employee the correct amount, on time, by the method they specify. Some employees work by the hour and are paid an hourly rate. They submit time cards that record the date and the number of hours worked. If they work more than 8 houts per day, they are paid 1.5 times their rate for the extra hours. They are paid on Friday.
Other employees are paid a flat salary on the last working day of the month.
Some employees are also paid a comission based on their sales. They submit receipts that record the date and amount of the sale. Their commission rate is negotiated and can be changed. They are paid every other Friday.
Employees can select their method of payment. They may have their paycheck mailed to a postal adress of choice, or have their paychecks deposited in a bank account of their choice or they may have have their paychecks held for personal pickup by the girl in accounting.
The software should allow us to manage employees, it will support adding or firing of employees and it will support switching an employee from hourly rate to salary and back. Also we need the system to generate a report showing the detailed payment data of any employee.

Requirement Updates

  • Are timecards submitted every day, containing the number of work hours? Can there be exceptions to this behavior? (ex: submit only 1 punch card Friday, detailing each week day's worked hours)
Each hourly-rate employee submits timecards at the end of his/hers working day, they submit timecards only in the days they work.
  • There are different employee actors. For the sake of simplicity, they could all enter a generic punch card, which states their names, date and hours worked, flat salary, or date and amount of sale (each category fills in only the fields relevant to him, either way, fields that do not correspond to his category will be ignored). This way all different employee actors will be substituted with a time card actor. The differentiation between employees is made by querying the employee "database" (a collection of abstract Employee)
No, this approach is not possible because of the extra costs required to train all employees and verify the correctness of each timecard.
  • With whom is the commission rate negotiated (person X)? Can the employee suggest rates on his time cards, which stack up and will be revised at a later date by X who could login, revise and maybe update the employee's profile, or does the employee negotiate live with X, without entering his desired rate in the system, and after the "live" negotiation, X logs in and updates that employee's commission rate?
Every six months all employees undergo an evaluation process, during this process commission rates are renegotiated and the system is updated with the new rates.
  • Also we need the system to generate a report showing the detailed payment data of any employee. Does this refer to a complete history of that employee's payments?
Usually we need to release reports with the payment history for the last three months, six months or one year. We also have a strict data-access policy, so if an three month report is required, it contains only three months of data.

  • [NEW] When an employee selects a certain method of payment(i.e. By the hour or Flat salary) should the system verify that he is indeed paid in that particular way(by the hour or flat salary) ??
"Method of payment" refers to having the paycheck mailed, deposited in the employee's account or held for personal pickup. The type of salary (hourly rate or flat) is decided when an employee is hired and may be changed at the time of an employee's re-evaluation.
  • [NEW] Should the system contain a database of employees and their respective status of payment or if they are truly managers/accountants and verfiy this fact or are the cards manufactured in such a way that the card reader can discern this fact the moment the employees' card is read ??
The system should pay each employee the correct amount and on time. Time cards should be checked for obvious errors (like reporting more than 24 working hours in one day). The system should allow management to change the amount of money an employee receives if they identify that the employee is not doing their job, but reporting the hours.

Week 4 (20.Mar) - UML Sequence Diagrams

  • Documentation
Martin Fowler's UML Distilled book, Chapter 4.
  • Assignment 2 (due 27.Mar) - A UML Sequence diagram and and an updated version of the java files from the first assignment are available in this archive. Once again the assignment consists of two parts:

Part 1: A sequence diagram is provided; the implementation of that sequence is required. The modeled system is an upgrade of the one you had to implement for A1 P1. If you still have the source files from A1 P1 you may reuse them. A class diagram (with changes highlighted) is also provided for those that do not have A1 P1 available.

Part 2: A newer version (with bug-fixes) of the code from A1 P2 is provided. You must draw a UML sequence diagram considering the two calls (specs() and prices() marked in the main method) from ComputerStore.java as found messages. Consider starting you sequence like in the figure to the right.

As with all assignment results, you are required to upload them to your subversion repositories. (.uml source file for the diagram, .jpg picture of diagram, source files)

Week 3 (13.Mar) - UML Class Diagrams

  • Tutorials and documentation
Object Mentor (led by Robert Martin of Software Craftsmanship)
Martin Fowler's UML Distilled book, Chapters 3 and 5.
  • UML Tools
StarUML modeling tool (recommended).
A comprehensive comparison of modeling tools. is available from oose.de (en/de)
  • Assignment 1 (due 20.Mar) - A UML class diagram and a few Java source files are provided in this archive. This assignment consists of two parts:
Part 1: From class diagram to source code. Read and understand the design provided in the .jpg file from the archive and implement it in an object oriented language of your choice. Upload the resulting source code file to your subversion repository (https://hoare.cs.upt.ro/mihai/svn/YOUR_REPO_NAME/trunk)
Part 2: From source code to class diagram. Reengineer the Java source code provided in the zip archive and create the class diagram of that system. Export your diagram as a .jpg image (StarUML: File->Export Diagram) and upload it and your UML document (project or whatever - depending on the tool you used) to your subversion repository.

Week 2 (06.Mar) Code versioning systems - Subversion Recommended Subversion documentation/reading:

  • Simple SVN windows tutorial - emphasis on Using Subversion. The getting started section covers repository creation and configuration - topics not presented during lab classes (and not required but important if you plan to host your own repositories or understand SVN concepts, function and structure).
  • SVN book - suggested reading: first chapters (minimum 1 and 2)
  • SVN distributions for various OSes

Week 1 (27.Feb)

  • Introduction or "Did you know they use Eclipse to design hardware?"