T
The Directive
How do you make your code bulletproof? For example, I make my function
bulletproof by validating every argument passed to the function. I
ensure the arguments are within the expected ranges. This causes
multiple validation at different levels and so there's a slight
decrease in performance (since these checks ship with release code). I
could turn off these checks (asserts) for release code but it would
not protect the code from unexpected conditions since it's impossible
to test every possible condition. My professor says that this is bad
design. He says I should design according to specs and not include so
much validation. What do you think? How do you make your code solid?
How do you test your code and ensure quality? Any advice or ideas are
appreciated.
bulletproof by validating every argument passed to the function. I
ensure the arguments are within the expected ranges. This causes
multiple validation at different levels and so there's a slight
decrease in performance (since these checks ship with release code). I
could turn off these checks (asserts) for release code but it would
not protect the code from unexpected conditions since it's impossible
to test every possible condition. My professor says that this is bad
design. He says I should design according to specs and not include so
much validation. What do you think? How do you make your code solid?
How do you test your code and ensure quality? Any advice or ideas are
appreciated.