Complex conditionals

    The other day we dealt with code coverage and gnarly conditionals. I promised to offer a way to be able to test them properly. THERE IS NONE. Ha, what a bad joke. But the real answer might not be better, depending on your point of view. What you have to do is create a table. (A || B) && C This is our conditional. | m | A | B | C | RESULT | ---------------------- | 0 | T | T | T | T | | 1 | T | F | T | T | x | 2 | F | F | T | F | x | 3 | F | T | T | T | x | 4 | T | T | F | F | | 5 | T | F | F | F | x | 6 | F | T | F | F | | 7 | F | F | F | F | # m is the test case # A, B, C are the atomic parts of the conditional # RESULT is the result of the evaluation of the conditional For three terms in a conditional, you can have 8 different cases (2^3).

    Read More

    Code coverage can be misleading

    During the last week, I had two discussions about code coverage. Code coverage is the metric of how many lines of code are covered by your automated test suite. Many test frameworks have built-in ways to measure this. Other times you have to install another tool manually. When you run your tests you then see how many lines are not covered by a test. That means that no test was run where this line of code was evaluated or executed or interpreted.

    Read More