Lesson 08

(Please ignore this - these are notes for myself for the next iteration of this course)

Familiarizing Yourself With NUnit

Ideas for next time:

  • List out the features of a debugger, and for the 'learning the DB' exercise have them (1) do all three programs, and (2) fill in a table with examples of where they used each feature
NUnit materials:
  1. Starter project for the lesson 08 PCEs
  1. Watch the online videos for this lesson and demonstrate your knowledge
    You can download a .ZIP of all the videos for this lesson from Microsoft's OneDrive website by opening the folder (click this link to open the folder), then clicking on the "Folder Actions" menu, then clicking on the "Download Folder" menu item.

  2. Slides (used in the NUnit videos)

  3. VIDEO: Unit Testing Overview
  4. VIDEO: NUnit Intro
    Note that this video (at about the 3 minute mark) explains what you need to hand in - a .ZIP file with StudentAnswers.cs (and any other files you need/want to hand in).
  5. Familiarize yourself with NUnit-based 'autograded' exercises:
    Read this note: Tests to ignore

  6. VIDEO: Making the tests pass (by changing the tests - only to learn NUnit)
  7. Exercise: Make failing tests pass (Required) (You won't be able to 'hand in' this work because it's not in the Student_Answers.cs file)

  8. VIDEO: Running a console app (using Set as Startup Project) ; How to hand-in stuff
  9. VIDEO: Producing your own gradesheet
  10. VIDEO: Basic Unit Test
  11. Exercise: Making a basic unit test pass (Hand-In)

  12. VIDEO: Capturing Output From Your Code
  13. Exercise: Fixing broken output

  14. Exercise: Fahrenheit to Celsius (tested by NUnit) (Hand-In)

  15. VIDEO: Deciphering tests that use the [Values] attribute
  16. Exercise: Practicing with the [Values] Attribute : Testing the Dishwasher class (Sect 4.9, Sect. 9.6) (Hand-In)
    (This is a redo of PCE 05, Exercise #8 - Constructors ) 
  17. VIDEO: Deciphering tests that use the [TestCase] attribute
  18. Exercise: Practicing with the  [TestCase] Attribute: Passing arrays to functions (Sect. 8.7, 8.8)  (Hand-In)
    (This is a redo of PCE 04, Exercise #11  - Arrays as parameters - you may want to double-check any feedback you got for that lesson while working on this exercise)

  19. VIDEO: Deciphering tests that implicitly use the [SetUp] attribute

  20. PCE Feedback (optional)

  21. Web Hand-In for pre-class exercises and homework: The StudentTracker  web app
    StudentTracker limits the size of the files that you upload - this limt is typically 1 MB.  The NUnit support files are much larger than that.  Therefore, starting with this lesson, you should .ZIP ONLY the Student_Answers.cs file (along with any other files you wish to include, such as the feedback file).

    ALSO: You must submit a .ZIP file, and not a .RAR, nor a .7z, nor any other compressed file format.  The instructor's auto-grading script can't open anything other than a .ZIP, so you must submit your work as a .ZIP.  Submitting any other file format may result in a point penalty.  Thanks!

    Please submit a .ZIP (and ONLY a .ZIP - not a .RAR, .7z, etc) that contains the Student_Answers.cs file, the video outline/viewing quiz .DOCX (or .PDF), any other files you wish to include (such as the feedback file), and leaves out every thing else (as much as possible).

Add to slides:

•If you get a base (raw) score of 6+ on the PCEs, then you’ll get a 2 point ‘bonus’ • –You can’t go above 10 points – –This is to avoid problems where your code is 90% working, but 1 or 2 tests fail because of a relatively minor issue

TODO:

  • Fireworks (the class) is plural
  • Need to add the 'Rocket' thing to the spec
  • Spec: proofread the bit about how the game works (giving too much away?)

Items:

REMOVE: Implement the Rocket class

How to understand large code bases:

  1. http://programmers.stackexchange.com/questions/6395/how-do-you-dive-into-large-code-bases
    1. Walk through code in the debugger
    2. Talk to the programmer
    3. Use commenting to (temporarily) remove code, instead of deleting it
    4. "handle on what these are supposed to be and what they are used for. Follow data through the application and see where it goes and how it is changed. "
    5. "One of the problems I have with all this is motivation - it can be a real slog. It helps me to think of the whole business as a puzzle, and to celebrate the progress that I'm making, no matter how small."
  2. http://stackoverflow.com/questions/684251/understanding-a-large-undocumented-set-of-source-code
    1. Learn what the code is supposed to do
    2. Learn how it does them
    3. (crucially) Learn why it does them the way it does
    1. Using a debugger - basic skills establishment - COPY FROM 143!!!!
      1. Setting breakpoints
      2. Watch window / locals / auto
        1. There will be some variation here between Express & Pro
      3. Stepping through code, into code, out of code, continue
Feedback / Improvements on exericses:
(Please ignore this - these are notes for myself for the next iteration of this course)

Preview Videos:

  1. Viewing Quiz
    REDO: BubbleSort question #23 - the handout does not match the values used in the video
  2. Bubble Sort
    REDO: Copy and paste of array was difficult - redo this one?

The PCE for Fahreinheit to Celsius does NOT limit the output to 2 decimal places, even though it's supposed to

NUnit: Redo the videos so they're quicker.  Also, have a series of micro-videos about how to debug a test (showing step by step how such a thing is done)