[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] / [CSE201] / 11
[Text Version] [Syllabus] [Schedule] [Glossary] [Labs] [Projects] [Resources] [Grading] [Contact] [Search ]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] <11> [12] [13] [14] [15] [16] [17] [18] [19] [20]
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10]
Mon May 7 12:47:01 PDT 2012

Contents


    cs201/11 --Case Study

      Previous 10 -- Advanced Functions

      [ 10.html ]

      Extra -- Refactoring a working program to reduce repetition

      [ sort3.cpp ] beomes [ sort3c.cpp ]

      4.10 Stepwise Refinement

      Old fashioned but effective for simple problems. Not so good for complex software which has many different purposes.

      Quality Tip 4.3 Keep Functions Short

      4.11 Case study

      [ intname.cpp ]

      4.12 Walkthroughs

      Tracing. Pretend to be the computer.

      DO IT.

      Productivity Hint 4.4 Commenting out a section of code

      Productivity Hint 4.5 Stubs

      A very useful texhnique that lets you grow code organically.

      4.13 Preconditions

      Syntax 4.6 Assertion

      This is found in
       	#include <cassert>
      and it is called like this
       		assert(condition);

      I believe assert to be a vital tool for developing software. We will use it in labs.

      Random Fact 4.2 The Therac-25 Incidence

      Why programming some programs takes a lot of care and attention to detail.

      4.14 Unit Testing

      Cool.

      This enable TDD or Test Driven Development where you write the tests first and then make the code satisfy the tests.

      Demo in class.... [ tdd1.cpp ] [ tdd2.cpp ] if time.

      You should try this in your projects.

      4.15 The Debugger

      Some people find this helpful. I don't.

      Random Fact 4.3 The First Bug

      Skip 4.15.1 Using a Debugger

      Skip 4.15.2 A Sample Debugging Session

      Skip 4.15.4 Inspecting Objects

      4.15.5 Debugging Strategies

      4 Chapter Summary

    What you need to know about Functions in CSCI201

    [ functions.html ]

    Review Questions

    R4.11 - R4.20

    Simplest Example of assert

    [ a.cpp ]

    Exercise on functions and assert

    [ assert.cpp ] [ foobar.cpp ] [ tdd3.cpp ] (R4.19).

    Lab 6 on functions

    [ lab06/ ]

    Project 5 Due next time

    [ projects.html#P5 ]

    Quiz 5 on loops next time

    Next 12 Classes

    [ 12.html ]

Abbreviations

  • Algorithm::=A precise description of a series of steps to attain a goal, [ Algorithm ] (Wikipedia).
  • Class::=A description of a type of object that includes the data it knows and the functions it can execute.
  • Function::programming=A selfcontained and named piece of program that knows how to do something.
  • Gnu::="Gnu's Not Unix", a long running open source project that supplies a very popular and free C++ compiler.
  • OOP::="Object-Oriented Programming", Current paradigm for programming.
  • Semantics::=Rules determining the meaning of correct statements in a language.
  • SP::="Structured Programming", a previous paradigm for programming.
  • Syntax::=The rules determining the correctness and structure of statements in a language, grammar.
  • Q::software="A program I wrote to make software easier to develop",
  • TBA::="To Be Announced", something I should do.
  • TBD::="To Be Done", something you have to do.
  • UML::="Unified Modeling Language", industry standard design and documentation diagrams.
  • void::C++Keyword="Indicates a function that has no return".

    End