Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

testability of a design

Tags:

testing

Much has been written about testing of code. But how do we ensure that our design is functionally correct in the first place? Just as we have JUnit for testing Java code, are there some tools that can be used, say, to test a UML based design, where the tests are expressed in form of functional requirements?

These are some vague thoughts, but wanted to know if there's a methodical, automatable approach to testing the design first. In other words, can we also have 'Test Driven Design'?

like image 202
shrini1000 Avatar asked Oct 25 '22 07:10

shrini1000


2 Answers

are there some tools that can be used to test a UML based design, where the tests are expressed in form of functional requirements?

You cannot test a design based on functional requirements because the satisfaction of functional requirements depends on the implementation, not on the design.

In other words, you can follow a bad design (any one of the infinite possible designs) and still meet that set of functional requirements if you implement the required behavior.

like image 63
Mr.Eddart Avatar answered Oct 27 '22 11:10

Mr.Eddart


Interesting topic!

Firstly, no software architects in my personal network use UML as the only way to design their systems, and I also know of no software architects who create UML at the level of detail required to execute a mechanical test.

Secondly, I personally have a deep dislike of the UML modeling tools. If such a formal verification method is implemented, it's likely to be in something like Rational Rose - I swore long ago I'd never go anywhere near that again.

However, having said all that - in formal software shops, it's common to have requirements tracability, typically implemented as a matrix which shows business requirements on one axis, and design artifacts on the other. This way, you can see whether any requirements are not matched with a corresponding solution, or if there are elements in the solution which do not meet a specific business requirement.

Keeping this matrix updated is a pain, so it's not often used in agile teams, but if you're building softwware for a bank or the space shuttle, it is a valuable technique.

This tells you whether your design is complete - though not whether it's "right".

There's no way I know of to tell whether a design is "right" without either building it and testing, or relying on human experience and knowledge.

like image 35
Neville Kuyt Avatar answered Oct 27 '22 10:10

Neville Kuyt