Debugging, a lost art?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #16
    If you are planning on reusing your classes you would be well advised to run some sort of unit test on them to ensure their functionality.

    Remember a good test is written directly from the specification of what the class should do not from knowledge of what the class does do.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #17
      Hmm I find it best to test in small chunks.

      I don't like the idea of writing entire classes (that depend on other classes etc) without testing what I have done along the way.

      Unlike my coworker who will write 20 classes, not test anything, and then ask for help when it doesn't work...at which point it could be anything!

      -Frinny

      Comment

      • kiseitai2
        New Member
        • Jul 2007
        • 93

        #18
        I don't like to write big chunks of untested code, but I can't test until I have some minimal wrappers done. However, I'm gonna look into Banfa's suggestion. I don't know what unit tests are (I am a self-taught programmer and the only high school course I took was too basic for complex testing), but I will do some research and see how I can use them to clean my classes.

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #19
          Unit testing is pretty standard in this industry.

          Actually, I remember one course in college requiring us to write unit tests. So, while we weren't taught debugging, we were taught how to test our work :)

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #20
            If you had a system made of several processes each made of several modules each made of several classes then:

            Unit Test would be testing the smallest possible unit in the code that can be made to run separately, for example a single small class or even a single method on a large complex class.

            Module Test would be black box testing the module at the level of its interface or alternatively black box testing a whole process.

            Integration test would be testing each individual program to make sure it will integrate properly with the rest of the system.

            System Test would be testing the whole system to ensure it meets its requirements.

            Comment

            Working...