Hi, I have a question on unit-testing.. The design for a complex application with a large number of classes has just been completed. Which of the following is the BEST approach for unit-testing the classes? (One answer) a)Use the package diagrams to group classes logically and perform unit-testing on a package-by-package basis. b)Use activity diagrams to identify parallel behavior and test classes that use threads. c)Use the interaction diagrams to step through the interactions between the classes and perform visual inspection of the code to identify discrepancies d)Use the class diagram to ensure that the classes have been correctly coded and perform unit-testing for each class association and for each class From 'UML distilled', I think the answer would be (a) - ie. on a package-by-package basis. But, I do have some doubts it could be (d) too. Please express your comments on this. Thanks.
MM Koppula<br />SCJP2<br />Object Oriented Analysis and Design with UML (IBM)
Initially, I thought it would be (c), but after reading the question carefully, it says the DESIGN has been completed for... I have few questions: Do we assume that, by "unit-testing" the classes, they mean preparing a unit test plan? Reason, being the coding has not been started yet, so how can one unit-test the classes? Please explain, if anyone differ in opinion regarding the above comment.. I think (a) is the best answer. Answer (d) is incorrect in my opinion since class diagrams represent Static modelling and may not capture the dynamic behaviour represented in the Interaction diagrams. If we consider that, the question specifically says "DESIGN" has been completed, not the coding, then we can rule out (c) & (d). ( I may be wrong on this one, please comment if anyone thinks otherwise..)