Week 2 Flashcards
When looking at integration testing, what do we look at?
Incremental and non-incremental.
When looking at performance testing, what do we look at.
Scalability, stability, speed and memory.
What do we look for in algorithms?
We seek algorithms that are correct (ideally a proof) , efficient, and easy to implement.
Will iterative cases always be faster than recursive, or the other way around?
No, it is not always the case that one will be faster than the other purely based on whether they are iterative or recursive.
How do we determine if an application is too slow?
The application is too slow if it doesn’t meet your project’s stated performance requirements.
What are some internal factors that could affect an algorithm performance analysis?
Runtime and memory requirement.
What are some external factors which affect an algorithm performance analysis?
Input size, computer specs, compiler quality.
How is complexity analysis computed?
There are three.
- Time complexity (The time required)
- Computational complexity (The number of steps or arithmetic operations)
- Space complexity (The amount of memory required)
What are the issues with python’s time module? Why is timeit better?
The time module records the start and end. However, it can be effected by alot of outside factors and is considered quite noisy.
The timeit module is better since it helps eliminate non-functional, non-essential time consuming tasks. It is generally more accurate.
What is profiling.
Profiling is measuring relative system statistics.
It tells us, where most of the time is being spent. (classical profiling)
Which method takes the most time, and which is called the most.
Profiling is not the same as benchmarking or optimizing.
What is optimization? Why do we warn not to optimize too quickly?
Optimizing is refactoring and enhancing to speed up the code. Optimizing too quickly can lead to code that is barely used being unnecessarily optimized.
In general only optimize if you have a clear idea of what is actually slowing down your code.
What is the Pareto Principle?
80% of a program’s execution occurs within 20% of its code.
What is Big-O Notation? What is it used to specify?
Big-O is used to specify an upper bound on a function.
For a bound, choose the smallest simplest function that satisfies the inequality. Choose the inequality.
True or false, Big-O ignores the constant in analysis, so g(n) is identical to g(n) = 2n.
Yes, Big-O ignores the constant. g(n) and g(n) = 2n are identical.
What are the types of Algorithms?
Constant
Logarithmic
Linear
N-Log-N
Quadratic
Cubic
Exponential