CSE503: Software Engineering
David Notkin
Question from an interested student:
So, something that has been bugging me recently is the need for specification of implementation in the specification of an ADT (or some such).
Take for an example a list/vector like data structure that supports indexing and insertion/deletion of arbitrary elements. So the question is, did does the structure have O(1) inserts/deletions and O(n) indexing, or O(n) insertions/deletions and O(1) inserts. Is it implemented over a linked list or an array? When I use a data structure out of the box, this is something I really want to know.
Examining two classes in the Java Hierarchy, java.util.Vector and java.util.Stack. It appears that the Stack (a subclass of Vector) uses the same implementation as Vector. I would also assume, although it is not specified (but it should be!!) that the Vector class is implemented over an array. This means that the insertion operations are costly and the indexing operations are not. Now, the Stack object is implemented as a subclass of Vector, so I would assume it has the same implementation. This means that doing N push operations on an initially empty stack costs me a runtime of order N log N, assuming that the Vector is implemented to double its size when ever needs more space than its capacity. However, in my opinion, any structure claiming to be a "stack" implemented on a system that supports dynamic allocation should have a runtime of order N for N push operations.
So, the only thing I know about this is that it doesn't seem like the typical way of specifying ADTs is good enough. Is an ADT being slower than is necessary a failure that people care about? Or is that something pushed under the carpet that the implementers don't tell their supervisors? Why is it acceptable to leave this sort of stuff out of specification?
Notkins Top 10 Observations
A very basic overview of software engineering
Bar code scanners 10-50KLOC
4-speed transmissions 20KLOC
GNU Emacs 120KLOC
ATC ground system 130KLOC
GCC 280KLOC
Teller machine 600KLOC
Call router 2.1MLOC
B-2 Stealth bomber 3.5MLOC
Seawolf submarine combat 3.6MLOC
Space shuttle 26MLOC+1MLOC/flight
NT5.0 60MLOC
Code Size Discipline
103 Mathematics
104 Science
105 Engineering
106 Social Science
107 Politics
108 ??