#header-inner {background-position: right !important; width: 100% !important;}

7/8/14

Conditions, Security Harness, Software Complexity.

(EN) precondition = (PL) warunek wstępny.
(EN) postcondition = (PL) warunek końcowy.
(EN) invariant (it can be modified) = (PL) niezmiennik (jakby co można go zmienić).


--
condition: a precondition, a postcondition, or an invariant is a quality of software that does or does not hold at a certain moments in time.

example 1: did user type '3' in a box? we can include this as a precondition for letting certain things to happen via software's execution (we do not have to).

but we do not know for example if it's the user or someone else, who pretends... many times.

example 2: is user provided image green enough according to our standards?

there can be other conditions as well.


--
when preconditions cease to hold, software parts cease to work properly anymore, depending on a perspective.

when invariants are modified, software loses certain qualities perhaps... gaining others perhaps, and so on...

when code part is executed (after all preconditions are met), after execution we can check if desired postconditions are met (to check if interferences such as hacking or programming errors caused this to fail). we can also react, for example by reporting this to software's user(s).

it's part of formal thinking about software, security harness of formal mathematical proofs (which are often too expensive to use), but also of automated unit testing / test cases that help Software Devs to 'tackle the Software Complexity' ... to write more complex applications faster, cheaper, without so many errors.

--
For the formal mathematical proof details, see also: [4], [19], perhaps more.
Example of Tools used for Testing are: JUnit, Easymock. (for Java, perhaps more).

See also, if You wish: Design by Contract, Conditional Software Tiering.

3 comments:

  1. (EN) 'precondition still holds'. = (PL) 'warunek wstępny wciąż utrzymuje się w mocy'.

    ...

    ReplyDelete
  2. (EN) 'condition ceases to hold'. = (PL) 'warunek przestaje utrzymywać się w mocy'.

    ...

    ReplyDelete
  3. (EN) 'this precondition cease is an event ... this event's occurance can result in a proper code part(s) execution'. = (PL) 'zaprzestanie utrzymywania się w mocy tego warunku wstępnego jest zdarzeniem ... wystąpienie tego zdarzenia może być przyczyną odpowiedniego wykonania odpowiedniej(ich) częsci kodu'.

    ReplyDelete