History of TestingSuites
Version 3
TestingSuites
Created by: Stephan Borg, Last modification: 21 Aug 2004 (23:57 UTC) by Stephan Borg
Under the kernel/test/ directory, you will find an attempt at our first testing suite.
This is supposed to be a quick explanation on how it works.
A lot of this based on the ideas of Object Orientation or 'black box' design, which basically means each class is designed so you only need to know what goes into it and what should come out of it. Here is a simple PHP object to explain how this works:
{CODE(colors=>php)}
class MyClass {
// internal variable - should never be accessed
// externally.
var mText;
// initialisation - set default text to "not-set"
function MyClass() {
$this->mText = "not-set";
}
// set the text using this function
function setText($x) {
$this->mText = $x;
}
// get the text using this function
function getText() {
return $this->mText;
}
}{CODE}
It is recommended that you (almost) never access internal variables and hence will never need to know the internals of the class. Secondly, if everything goes through functions, you can check it going in to make sure its not going to break things.
This is supposed to be a quick explanation on how it works.
A lot of this based on the ideas of Object Orientation or 'black box' design, which basically means each class is designed so you only need to know what goes into it and what should come out of it. Here is a simple PHP object to explain how this works:
{CODE(colors=>php)}
class MyClass {
// internal variable - should never be accessed
// externally.
var mText;
// initialisation - set default text to "not-set"
function MyClass() {
$this->mText = "not-set";
}
// set the text using this function
function setText($x) {
$this->mText = $x;
}
// get the text using this function
function getText() {
return $this->mText;
}
}{CODE}
It is recommended that you (almost) never access internal variables and hence will never need to know the internals of the class. Secondly, if everything goes through functions, you can check it going in to make sure its not going to break things.