Development Flashcards
What are some key concerns for a software developer?
- Following code convensions
- Following techniques for coding in a team
What is the aim of code conventions?
- Defines good practice
- Code looks like it was written by one singular person rather than n people
- Improves the maintainability of code
What are some examples of code conventions?
- Write name variables like this
- Write comments like this
- Organise contents of a class like this
-Name files like this
What are some good practices for writing code?
- Check validity of inputs
- Check array bounds
- Name all constants that represent real world values
- No code duplication
- Functions do one thing
What are the two different strategies for coding in a team?
Test driven development
Comment driven development
What is test driven development?
Before you write code, write tests. Code is finished when it passes test
What is comment driven development?
Before you write code, write comments. This allows for designing code before building and leads to properly commented code
Give different methods of debugging
Use of breakpoints
Variable inspection
Trace tables
Print statements
What are some strategies to overcome bug fixing?
- Be systematic
- Keep a log of what you’ve executed
- Find ways to exclude possible causes
Name some strategies to overcome bug fixing
Binary search
Code changes
Hypothesis testing
Walk away
Explain binary search in terms of bug fixing strategy
Start in the middle of code, is the problem before or after?
Code changes
DANGEROUS -> Comment out sections of code (leads to shotgun debugging)
What is shotgun debugging?
Randomly changing code
What is hypthesis testing in the context of debugging strategies?
List hypothesis about what the problem could be
What is paired programming?
- One person thinks/checks while the other person codes
- Take it in turns to write functions and change pairs for different tasks