CSCI 1300
Lecture Notes


8/28/97

History of Computing
  • Hardware
  • Software
  • Software Development
  • Problem Analysis and Specification
  • Design
  • Code
  • Verification
  • Modification


  • History of Computing

    I'm not going to go into great detail. I expect everyone to read and understand the section.

    Simple math is slow and error-prone for humans. Many devices have been developed throughout history to deal with these problems.


    Hardware

    Initially, the solutions were simple mechanical devices - abacus, Napier's bones, knotted string, and the slide rule.

    Later solutions involved clever and finely crafted machinery. Some included the idea of a stored program - Jacquard Loom and Babbage's Analytical Engine (often considered the first real computer). The programs were punch cards. Delicate, inflexible, but stored programs nonetheless.

    1940s - First electrical computers. Huge machines using vacuum tubes. Giant, hot, slow. People walked around inside them. They had their own cooling systems. Some programmed by rewiring (ENIAC) others used punchcards. No real "stored" programs internal to the machine.

    1950s and 60s - First transistorized computers. Smaller, less heat, faster. IBM. Minicomputers.

    1960s - Integrated circuits (chips). Smaller, less heat, faster yet. IBM

    1970s and 80s - microcomputers, personal computers. IBM. More powerful than the first computers.

    1980s and 90s - VLSI chips. Much smaller, much faster. Workstations.

    2000?


    Software

    Stored program concept - John Von Neumann. Program resides in the computer rather than on tape, punchcards, etc.

    System software - tools to facilitate using the system. Example: File System rather than directly accessing disk blocks.

    Operating system - collection of these tools that manage and abstract system resources.

    GUIs - graphical interfaces to computers.

    Languages:
    Wires - ENIAC

    Machine language - literally bits that specify the list of instructions to execute. Sometimes entered via switches. Lights showed the values.

    Assembly language - mnemonics for the instructions. Assembler turns these mnemonics into bits and bytes.

    High-level languages - abstractions of basic programming constructs. More natural to the user. Facilitate programming and eliminate redundancy in the code. Translated into assembly language and machine language by a compiler.

    Object-Oriented - higher-level abstractions intended to further facilitate programming. Increase modularity, reusability, security, etc.

    Examples: Fortran, Cobol, Snobol, Algol, Basic, LISP, Pascal, Ada, C, C++, Modula-2, Java, Eiffel, etc.



    Software Development

    There are 5 main parts to any software development effort

    1. Problem Analysis and Specification - What to do.
    2. Design - How to do it.
    3. Coding - Just do it.
    4. Verification - Does it do what it is supposed to. Does it not do what it isn't supposed to.
    5. Maintenance - Change what it does (usually by repeating 1-4). Bug fixes and modifications.
    This is known as the software life cycle.

    Whether or not you formally do each part of the software life cycle, it is important to consider each aspect.
  • They are all important.
  • Often problems can be found earlier, saving time.
  • Proper emphasis on each stage makes later stages easier and faster.

  • Each of these steps may be done by the same person, or by several different people.

    These steps may be done for an operating system, a program, a subsystem (part of a program), and an individual function.


    Problem analysis and specification
    Can't begin without knowing what needs to be done

    What it does:
  • Clearly defines problem - what is and is not being solved
  • Refines imprecise problem to one that is solvable given existing constraints
  • Constitutes an agreement on what is to be done
  • May discover problems
  • Inconsistency
  • Vagueness
  • Impossibility (remember problems with exponential growth)
  • Often leads the way to the solution
  • May contain desirable and optional items
  • Should be specific enough to be testable, so you know if/when the problem has been solved
  • Often done inadequately
  • What it doesn't do
  • Specify how to solve the problem.
  • Example:
    No: Should be fast.
    Yes: Should run in less than 10 seconds.
    No: Should use quicksort

    Important parts of a problem specification
  • A list of inputs
  • A list of constants
  • A list of outputs
  • For the programming assignments, I will provide a problem specification.
    This specification may be incomplete.
    It is your job to analyze and understand this specification and refine it as necessary to solve the problem.

    Example: Write a program that, given diameter of a circle, computes the area and circumference.

    Description: Compute and output the area and circumference of a circle given the diameter.
    Inputs: Diameter of the circle
    Outputs: Area and Circumference of the circle

    And perhaps:
    Constants: Pi (formulas for area and circumference)

    Problem Specification also called Requirements Specification or Document


    Design
    Once we have a clear idea of what needs to be done, we can work out how to do it. This is the design phase of the software development process.

    A Software Design:
  • Clearly specifies how the problem will be solved
  • Allows developers to determine what resources will be needed to solve the problem
  • Hopefully solves all problems that could arise in the development of the software component.
  • Is used as a recipe for doing the actual coding
  • A design is not code and does not contain any code.

    A design is not specific to any language, although it usually is specific to a type of language (procedural (Pascal or C), OO (C++ or Java), etc.)

    A software design typically has 3 parts:
    1. Identification of the attributes of the data objects that are required to solve the problem.
    2. Kind (numeric, alphabetic)
    3. Type (integer, real, ...)
    4. Name
    5. etc.
    6. Identification of the operations that must be applied to the data objects in order to solve the problem.
    7. Construction of a detailed sequence of steps (called an algorithm) that specifies how the operations can be applied to the data objects to solve the problem.
    Each of these parts may be large ones that are further refined in other design documents.

    Example:
    Data objects:
        Variables:
            Real: Diameter, Circumference, Area, Radius (derived for convenience)
        Constants:
            Real: Pi

    Operations:
        Radius = Diameter / 2
        Circumference = 2 * Pi * Radius
        Area = Pi * Radius2

    Algorithm:
    1. Get Diameter from user
    2. Calculate Radius
    3. Calculate Circumference
    4. Calculate Area
    5. Print out values of Circumference and Area


    Code
    Once a design is complete, coding can begin. Given a good design, this should be very straightforward. All hard problems should have been worked out in the design stage. New hard problems should send the project (temporarily) back to the design stage.

    Implement the design.

    This will be the subject of much of the rest of the course.

    Good code should be
  • Correct
  • Readable and Understandable
  • Modifiable
  • reusable
  • Programs should be:
    1. Well structured
    2. Break programs into meaningful parts
    3. Strive for simplicity and clarity
    4. Well documented (commented))
    5. Good comments before each program and/or function
    6. Good comments before each important part of a program/function
    7. Use meaningful identifiers (function and variable names)
    8. Aeshetic
    9. Space things out
    10. Use blank lines between logical blocks
    11. Use alignment and indentation to emphasize relationships.

    Example:Compute area and circumference of a circle


    Verification
    Does the problem do all and only what it is supposed to do.

    Each program/function should be tested against it's requirements to see that it does what it is supposed to do.

    Programs should also be tested to make sure that they don't do what they are not supposed to do.

    Tests should include correct and incorrect inputs, as well as nonsense inputs.

    Regression tests.

    Example:
        Run the above program with:
  • No input (shouldn't be allowed)
  • Negative input (shouldn't be allowed)
  • Positive input (should work)
  • Fractional input (should work)
  • Very large input (should work)

  • Maintenance

  • Bugs are found that need to be fixed
  • Requirements change
  • Components are reused
  • Enhancements are made More than half of all software development effort is maintenance.

    Generally accomplished by some abbreviated version of the first four steps above.