3 ms·
From the point of view of designing unit tests, I think class diagrams in UML are very helpful. For example, if I need a test suite in JUnit to cover classes A,
by Allocator2008 19y ago
From the point of view of designing unit tests, I think class diagrams in UML are very helpful. For example, if I need a test suite in JUnit to cover classes A,B, and C, then looking at the class diagrams for these, I can make sure I have a unit test for each public method in A,B,and C. Obviously one could just look at the code being tested as well, but when one has lots of classes, each with lots of unit tests associated with it, keeping track of these with some kind of diagram structure is helpful.
- dhimes 19y agoOK, so you find them more helpful as a system-overview tool after it's designed than you do in the actual design process? (I am inferring that you build a bit, then test, rather than the XP method of write a test--then build to the test.)
- Allocator2008 19y agoright - after the thing is built, then uml helps to write unit tests i find - i haven't worked anywhere where people actually do the write tests first approach - sounds good in theory but in the fast world of iterative development it probably is too slow/inflexible in some cases
- dhimes 19y agoI agree with you on the testing bit. I tried, and it seemed foolish to waste time writing simple tests for simple things.