Lab 8 Function Testing and Debugging
- Reminder: Be a good partner
- Function Testing
- Use CyberDuck to SFTP into one of your accounts on the
- On the server, navigate to the
- Download the
lab08folder to your Desktop (by dragging and dropping it from the CyberDuck window)
- Open Canopy and load the
lab08folder in the Canopy File Browser pane
Pair Programming Tips
1. Recognize that pairing is hard
Pairing is an intense relationship, summoning all your powers of ingenuity, communication, humour, and code. If you find it hard, or even just tiring, it's because it is hard and tiring sometimes. It takes effort to be kind, patient and to help steer someone in the right direction. Respect your partner and be kind. Your job is to help each other learn.
2. Be mindful of your body language
Is your back to your partner? Is your computer screen angled away? Do you make eye contact? You want to create an atmosphere of inclusion so your pair feels respected and encouraged to comment.
3. Is it too quiet between you and your partner?
If there is a lot of silence, that is often a sign that someone feels left behind. Did you take over the keyboard and write a bunch of lines in silence? Yikes! Explain what you type to your partner. Or perhaps you are confused but feel uncomfortable speaking up. Try: "I don't understand this line, can you explain what it does?"
[some content from https://www.fiddlerscode.com/blog/10-tips-for-great-pair-programming]
Table of Contents
- How much extra time does it take to write tests for your code?
Show AnswerThis is a trick question! If you write your tests after writing your code, for most CS 111 problems, it should take no more than 15-30 minutes to write a few tests and run them to make sure your code is working. However, if you write tests *before* you write your code, the same 15-30 minutes spent writing tests is likely to save you at least 30 minutes to an hour of development time for two reasons: you will have a clearer understanding of the problem when you start coding, and when you have a version that you think is working, you can immediately test it to see if it is, and your tests will help tell you what isn't working.
- What do you think are the two most important debugging techniques?
- Commenting out code to see what changes. Along with