Lecture 12 - Quality, Strings, Generics Flashcards
External Quality
External Quality (User Perspective) - No crashes, good performance.
Internal Quality
Internal Quality (Developer Perspective) - Code is understandable, code is testable, code is easy to update.
Don’t duplicate code
It leads to late propagation. It is a bug caused because you forgot to make changes in all locations that you copied the code to/from.
Cyclomatic Complexity and Testing
It is the number of linearly independent paths in the program. 0-5 Perfect. 6-10 Difficult to test and understand. >30 Extremely complex.
If your method has a CC of 6, you need at least 6 methods to cover all the paths.
Java Generics
Java will automatically wrap and unwrap primitive types. This is autoboxing.
Generic Arugments
Generic Arguments are compile time only. Run-time does not know about the type specialization. We can place type constraints on generic type arguments.