1/27
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is test-driven code?
Code that relies on tests to ensure its validity
What are the two main test modules?
Unittest and pytest
What is unittest?
A built in testing module that can be imported to test code
What is pytest?
A installable (not built-in) testing module
What is a vector?
A mathematical value that has magnitude and direction
What is running time?
How long it takes a code to run input.
As input bits increase, what happens to running time usually?
It increases
What is efficiency?
decreased running time with increased or maintained performance
What is adaptability?
The ability to change runtime to maintain efficiency from device to device
What determines the trend of growth in runing time?
Asymptomatic order of growth
What is asymptomatic notation?
the running time of an algorithm with a given input, n
What are the atomic operations?
Arithmetic and boolean operations, variable assignment, branching, calling a function, and returning a function
What is the red in Red-Green-Refactor process?
Red - write a test that fails before writing your code
What is the green in Red-Green-Refactor process?
Green - writing code that passes the test you wrote
What is the refactor in Red-Green-Refactor process?
Refactoring - checking the code for duplicates/finding where to condense
What line runs all the tests when using unittest?
unittest.main()
T/F You can’t begin method names with “test” in a unittest subclass
False, all of the methods must be named with “test” or they will not run
What is the parent class format used after importing unittest?
unittest.TestCase
What methods are used as testers?
assert(Equal, Value, etc)
What is the Big O?
A way to express running times as functions
Big O notation: Constant functions
O(1)
Big O notation: Log functions
Olog(n)
Big O notation: Linear functions
O(n)
Big O notation: nlog functions
O(nlogn)
Big O notation: Quadratic functions
O(n²)
Big O notation: Polynomial functions
O(nk) for a constant, k
Big O notation: Exponential functions
O(2n)
Big O notation: Factorial functions
O(n!)