CR plan: Testing 2024 March

Necessary prep:

  • Conda environment with pytest

Q: from learner to guide as starting point
A: what the guide might s

Schedule:

  • 9:00 Motivation
    • Try to be quick
    • Q: "Before you learned automated testing, how did you normally test?"
      • A: "Well, I'd try running it, see waht happened. Run until I got what I was expecting, for a case I could predict"
    • C: "And then you don't do that again. How do you know it didn't change later and break? That's what automatic testing is all about"
    • Do first sections
    • Discussion
    • Then jump to "what should you do", don't go into details.
  • 9:10 Testing locally
    • Get straight to the example Discuss it and go into terminal.
    • Q: "How do you automate testing? Is it hard?"
  • 9:35 Automatic testing
    • Q: "How do you avoid forgetting to run the tests?"
  • 9:55 Discussion
  • 10:00 Break
  • 10:10 (continue automatic testing if needed)
  • 10:10 Test design
    • Spend lots of time here.
    • Q: "What everyone wants to know is, is it hard to write tests? What if you really don't know the correct answer?"
    • Q: "I guess we'll see this later, but: can you give one example of one of these tests where the result is stochastic, so that there is no one right answer?"
    • Give the introducion
    • Ask for what is hard to test
    • Start writing tests for what we see here.
  • 10:45 Discussion
  • 11:00 End

Modular Code Development

  • 12:00 Motivation and introduction to the problem
  • 12:10 In notebook
  • 12:15 Add axis labels
  • ​​​​​​​  Multiple plots
    
  • ​​​​​​​  Plotting function
    
  • 12:30 Separate more functions
  • ​​​​​​​  Reduce side effects
    
  • ​​​​​​​  Move to a script
    
  • ​​​​​​​  Add tests
    
  • 13:00 Break
  • 13:10 Command line interface
  • 13:15 Multiple files / modules
  • 14:25 Wrap up
  • 14:30 end
Select a repo