• It is cl ss or p ck ge emph sizes bstr ction over concrete v lue 0 to 1: • For p ck ges, It is the r tio of bstr ct cl sses or interf ces to the tot l number of cl sses within p ck ge. • For cl sses, It is 0 for concrete cl ss nd 1 for n interf ce or bstr ct cl sses a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 4
m inly used by others (st ble – h rd to ch nge); or (b) it m inly depends on other items (in-st ble – ch nge ble). • It is v lue between 0 nd 1: • 0 only incoming dependencies to • 1 (only outgoing dependencies). a a a a a a a a a a a a a 5
of the number of linearly independent paths. • P ths occur when "while,” "for,” "if,” "c se," nd "goto" keywords ppe r within the function. • If the source code cont ined no control low st tements (condition ls or decision points), the complexity would be 1 • If the code h d one single-condition IF st tement, there would be two p ths through the code: one where the IF st tement ev lu tes to TRUE nd nother one where it considers to be FALSE. • Two nested single-condition IFs, or one block with two conditions, would produce complexity of 3. a a a a a a a a a a f a a a a a a a 13
written code High Testability Cost and Effort is less 10-20 Complex Code Medium Testability Cost and effort is Medium 20-40 Very complex Code Low Testability Cost and Effort are high >40 Not at all testable Very high Cost and Effort
Copyright. These slides may be used only as study material for CSC 5100 within the California State University system. They may not be distributed or used for any other purpose.