Program Realisation 2 http://www.win.tue.nl/˜hemerik/2IP20/ Lecture 4 Kees Hemerik Tom Verhoeff Technische Universiteit Eindhoven Faculteit Wiskunde en Informatica Software Engineering & Technology Feedback to T.Verhoeff@TUE.NL
c 2007, T. Verhoeff @ TUE.NL 1 Program Realization 2: Lecture 4
Today’s Topics
- Unit testing, manual versus automated
- ADT relationships:
– Multiple implementations of the same ADT contract – Generalization, specialization, subtyping
- Inheritance
- Method binding (“polymorphism”)
- virtual, override, abstract , as, is, protected
c 2007, T. Verhoeff @ TUE.NL 2 Program Realization 2: Lecture 4
Quality of Submitted Bounded and Unbounded Queues Year 2005–2006 Assignment # Submissions # Incorrect % Incorrect Bounded Queue 52 ≥ 15 > 25% Unbounded Queue 48 ≥ 19 > 40% Year 2006–2007 Assignment # Submissions # Incorrect % Incorrect Bounded Queue 60 ≥ 9 15% Unbounded Queue 48 ≥ 18 > 35%
c 2007, T. Verhoeff @ TUE.NL 3 Program Realization 2: Lecture 4
Workflow for Development of ADT as Product
- 1. Describe and analyse requirements (informal)
- 2. Design class interface (public methods, parameters, incl. types)
- 3. Design contract (method pre/post, public invariants)
- 4. Design/implement unit tests (test driver)
- 5. Design internal representation (private fields, private invariants,
abstraction function)
- 6. Implement method bodies (incl. assertion checking)
- 7. Execute unit tests
c 2007, T. Verhoeff @ TUE.NL 4 Program Realization 2: Lecture 4