Difference between revisions of "Implement interface contracts"

Jump to: navigation, search
(Reverting to last version not containing links to s1.shard.jp)
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[http://s1.shard.jp/losaul/australia-jeri.html 3 australian formula
] [http://s1.shard.jp/olharder/kragen-auto.html auto cheat city grand thief vice
] [http://s1.shard.jp/bireba/notron-antivirus.html notron antivirus] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/olharder/route-66-auto.html automobile vinyl top installation
] [http://s1.shard.jp/losaul/nlp-training.html australian standard classification of occupation
] [http://s1.shard.jp/galeach/new103.html asia pacific region facts
] [http://s1.shard.jp/bireba/symantec-antivirus.html symantec antivirus corporate edition v 10.0] [http://s1.shard.jp/bireba/www-avg-antivirus.html disable norton antivirus 2004
] [http://s1.shard.jp/olharder/napa-auto-parts.html dirt cheap auto insurance michigan
] [http://s1.shard.jp/frhorton/tyyykyebz.html aids in kenya africa
] [http://s1.shard.jp/frhorton/v8af479gm.html the first african american basketball player
] [http://s1.shard.jp/losaul/australian-cricket.html australia pajero
] [http://s1.shard.jp/olharder/autoroll-654.html links] [http://s1.shard.jp/losaul/australia-bank-fee.html australian meals made through the gold rush
] [http://s1.shard.jp/galeach/new81.html asian grocery denver
] [http://s1.shard.jp/frhorton/rlw3nqlyf.html south africa safaries
] [http://s1.shard.jp/bireba/norton-antivirus.html antivirus filtering
] [http://s1.shard.jp/bireba/innoculate-antivirus.html pop pro up winantivirus
] [http://s1.shard.jp/olharder/removing-auto-paint.html automation form greibach normal theory
] [http://s1.shard.jp/frhorton/ony5d5273.html african child labor picture images
] [http://s1.shard.jp/losaul/liberal-party.html australia land tours
] [http://s1.shard.jp/olharder/keystone-automotive.html price on automobile glass
] [http://s1.shard.jp/losaul/australian-laws.html home and away australian soap opera
] [http://s1.shard.jp/olharder/sunnyside-auto.html auto body shop in minnesota
] [http://s1.shard.jp/olharder/auto-automobile.html left eye autopsy photo
] [http://s1.shard.jp/galeach/new84.html asian woman fashion magazine
] [http://s1.shard.jp/losaul/used-car-price.html ink cartridge australia
] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/bireba/extendia-antivirus.html nortan antivirus 2005 serial key
] [http://s1.shard.jp/galeach/new18.html asian avenue graphic
] [http://s1.shard.jp/losaul/australian-capital.html australian army history grants
] [http://s1.shard.jp/galeach/new143.html voluntary euthanasia
] [http://s1.shard.jp/bireba/norton-antivirus.html avant antivirus
] [http://s1.shard.jp/galeach/new36.html asiatic carpets
] [http://s1.shard.jp/frhorton/bzsc3x6qn.html south african safari club
] [http://s1.shard.jp/losaul/australia-inc-lottery.html australia inc lottery lotto programme] [http://s1.shard.jp/frhorton/hpi2k8yhb.html african american civil movement right woman
] [http://s1.shard.jp/olharder/autoroll-654.html sitemap] [http://s1.shard.jp/bireba/download-norton.html types of antivirus software
] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/olharder/internet-auto-part.html auction auto public wyoming
] [http://s1.shard.jp/olharder/o-riley-autoparts.html automotive carpet custom
] [http://s1.shard.jp/olharder/auto-start.html auto+trader
] [http://s1.shard.jp/frhorton/zgxfpsa75.html african ibo masks
] [http://s1.shard.jp/olharder/autoroll-654.html link] [http://s1.shard.jp/losaul/australia-importing.html australian council midwifery
] [http://s1.shard.jp/losaul/australian-import.html australia divorce laws

Latest revision as of 06:50, 3 June 2009



  • Provide unit-level semantic input validation.
  • Identify reliability errors in a structured way at the earliest point in time.


  • Implementer


  • As needed; generally as functions or methods are modified.

Interface contracts are also commonly known as assertions. They can be a formidable tool for preventing security problems - particularly if applied consistently, and rigorously.

In many application development processes, interface contracts are not enabled in production software. They are removed by habit in order to improve efficiency. If the efficiency impact is nominal for the project, CLASP strongly recommends leaving such checks in the code for the sake of security.

Otherwise, checks of security critical parameters should be implemented using a permanent mechanism, such as code directly at the top of the function, as discussed in activities below.

Implement validation and error handling on function or method inputs

For each method or function visible outside its compilation unit, specify in code what the expectations are for valid input values. One should validate that each input variable has a valid value in and of itself, and should determine validity in relation to other inputs. Validation checks should contain no side effects. Failures should be handled as specified in design. See CLASP Resource B for the concept on input validation.

Input variables should not be constrained to parameters. Any variable read by the function or method should be considered an input variable - including global variables, and class and method variables. Note that some interface contract facilities will allow specifying invariants for an entire class - i.e., things that must always be true about class data before and after each method invocation - once.

Implement validation on function or method outputs

Perform the same validation between relationships before exiting a function or method. Output specifications are meant to provide a clear behavioral specification to calling code to prevent accidental misuse.

Generally, output validation code is most useful in implementation. It is reasonable to disable such code for deployment or even use pseudo-code if absolutely necessary.