2 Replies - 890 Views - Last Post: 21 November 2011 - 01:43 PM

Topic Sponsor:

#1 Ap0C552  Icon User is offline

  • D.I.C Head

Reputation: -3
  • View blog
  • Posts: 202
  • Joined: 08-December 10

Invariant test and validate functions

Posted 21 November 2011 - 12:50 PM

I have no clue what these are! this is what I get for skipping class.

I have an assignment and at the bottom it says "include invariant tests" to which the prof said "usually include validate functions.

There really is no course text, and I can not find any really clear explanations on the internet. Does anyone know exactly what is meant by these two terms?
Is This A Good Question/Topic? 0
  • +

Replies To: Invariant test and validate functions

#2 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1811
  • View blog
  • Posts: 4,890
  • Joined: 27-December 05

Re: Invariant test and validate functions

Posted 21 November 2011 - 01:39 PM

A little more context might be helpful.

In general, an invariant is something that doesn't change. In programming contexts this usually appears as a loop invariant, which is a condition that is true immediately before and immediately after every iteration of a loop and is used in a formal proof of a program's correctness.

Sorry I can't really say anything useful about "validate functions" unless you can provide more info to illustrate what the prof is referring to.
Was This Post Helpful? 0
  • +
  • -

#3 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 529
  • View blog
  • Posts: 1,274
  • Joined: 30-January 11

Re: Invariant test and validate functions

Posted 21 November 2011 - 01:43 PM

I would assume that 'validate functions' merely take some kind of input and check whether its inside of some predefined bounds. For example if you are taking in an integer that had to be less than 15, you would take in the integer and use a validation function to check if its valid/below 15/in the range.

That's just my interpretation anyways.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1