"A Hum byte code instruction has two bytes -- one for operation and one for operand."
test120OpCode000IsHalt
"An opCode of 000 is a halt instruction. (operand is ignored)"
test130Operand000IsNone
"An operand index of zero is treated as None.
test210MeasureLoad
"Load measure into measure-arithmetic register."
test220MeasureAdd
"Add measure into measure-arithmetic register."
"First load a measure into the register."
"Add another measure into the register."
test230MeasureMinus
"Add measure into measure-arithmetic register."
"First load a measure into the register."
"Subtract another measure from the register."
Hum-Tests -- HumCalculatorTests
test110substringAfter
"Test helper method that finds a substring between two given substrings."
test115substringBefore
"Test helper method that finds a substring between two given substrings."
test120substringBetween
"Test helper method that finds a substring between two given substrings."
test130substringBetweenBrackets
"Test helper method that finds a substring between a pair of brackets or similar pairs."
test210templateFill
***21 lines of code ***
test305parse
"Test the simple parser."
"Parse produces a collection of tuples: { token. type. start. stop. }"
test310parse
"calc parse: s - recognizes quoted strings as single tokens."
test311parse
"What if string ends with quoted text?"
test312parse
"Test parse with quote within string."
test313parse
"calc parse: s - recognizes quoted strings as single tokens."
test314parse
"Test parse with quote within string."
"TODO: Think about following convention where doubled quote within a string is treated as embedded quote."
"TODO: Think about following convention where special characters are preceded with back-slash (\)."
test510measurePlusSameUnits
"Measures may be added if same units."
test520measureMinusSameUnits
"Measures may be added if same units."
test540CommonUnits
"Test that these do not crash"
"Transcript cr; show: 'test540CommonUnits d = '; show: d asString."
***21 lines of code ***
test542UnitsShouldCancel
"Test that these do not crash"
***22 lines of code ***
test545Conversions
"Test that these do not crash"
***31 lines of code ***
test546ConvertVolumeMeasures
test550CasualMeasures
"Work with non-KMS measures. Develop HumMeasure2"
***29 lines of code ***
test552CasualMeasuresAdd
"Work with non-KMS measures. Develop HumMeasure2"
test553CasualMeasuresSubtract
"Work with non-KMS measures. Develop HumMeasure2"
test554AsPercent
"Work with non-KMS measures. Develop HumMeasure2"
test555CasualMeasuresAsString
"Test asString"
"check ' per '"
"Check square"
"Check cubic"
***25 lines of code ***
test556CasualMeasuresSquares
"Test asString"
test557CasualMeasuresCubics
"Test asString"
test560coefficientOfExpansion
"Sometimes the exponents are all negative."
"coefficient of expansion for aluminum
test570CreateMeasureFromString
"Create a measure from a sting of the form: -999 units"
test580exampleBussardRamJet
"Is relatvity relevant at this speed?"
"The interstellar medium within the Local Bubble has a density of about 0.07 atoms/cm3"
"How much power does the CNO fusion provide?"
"Seems way too small to power, let alone move, a structure 1 km in radius."
***26 lines of code ***
test581megaWattToAcceleration
"What kind of acceleration does a megaWatt per tonne give?"
"kinetic energy KE = mass * v * v / 2.
"
"1 kilowatt per kilogram ==> high acceleration (assuming perfect energy conversion)"
test582exampleBussardRamJet
"Is relatvity relevant at this speed?"
"The interstellar medium within the Local Bubble has a density of about 0.07 atoms/cm3"
"density = HumMeasure( 70000 HydrogenAtom per cubic meter )"
"How much power does the CNO fusion provide?"
"Still seems way too small to power, let alone move, a structure 1 km in radius."
***27 lines of code ***
test582megaWattToAcceleration
"What level of acceleration does a megaWatt give to 100 tonnes of ship mass?"
"kinetic energy KE = mass * v * v / 2.
"
"Lower limit for one megawatt of energy production and conversion is probably about 10 tonne.
test590examples
"Class-side examples should not fail"
testV110VectorCrossProduct
"Check the vector cross product"
testV111VectorCrossProduct
"Check the vector cross product"
testV112VectorCrossProduct
"Check the vector cross product"
testV113VectorCrossProduct
"Check the vector cross product"
testV115VectorCrossProduct
"Check the vector cross product"
testV117VectorCrossProduct
"Check the vector cross product"
testV210IdentityVector
"Creat a identity vector I * V = V.
"
"Multiplication by unit vector should return same."
"Dot product should produce sum of elements."
"Crossed with itself."
"Dot with itself."
***23 lines of code ***
ztest530measureTimesPercent
"Percent times percent produces percent"
Hum-Tests -- HumCodeBaseTests
test110MyPackages
test120MyClasses
test130GetPackageClassTuples
"packageClassTree inspect."
test140GetPackageClassMethodTuples
test146CountTestModules
test147CountLongModules
"1 --- Twenty lines is roughly the maximum amount of code
***24 lines of code ***
test148CountLongModules
"Count modules whose listing will exceed one page. "
test150gatherSources
test160LinesOfCode
test161LinesOfCodePerModule
test170FindToDoLines
test171FindCommentLines
test175FindAssertLines
test180listOnHTML
test182listOnHTML2Lines
test183listOnHTMLcomments
Hum-Tests -- HumFuzzyTests
testF100FuzzyArithmeticReadMe
"
"
***23 lines of code ***
testF110CreateFuzzyWithDistribution
"Create a fuzzy quantity from a given distribution."
"A distribution is a Dictionary of f->p points
testF112CheckEdgeCases
"Create a fuzzy quantity from a given distribution."
"A distribution is a Dictionary of f->p points
testF120Interpolation
"Create a fuzzy quantity from a given distribution."
"A distribution is a Dictionary of p->f points
"Should be able to return given point value."
"Force interpolation"
***27 lines of code ***
testF125Mean
"Create a fuzzy quantity from a given distribution."
"A distribution is a Dictionary of p->f points
"Calculate mean"
"the mean will be higher than the median because of long tail"
***26 lines of code ***
testF130Plus
"Add fuzzy distributions.
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
"Examine expectedMean"
"Expect some difference due to long tail."
"The difference is typically about 3 to 4%; but is occasionally greater than 5%."
"Transcript cr; show: 'testF130Plus diffMean = ', ( diffMean asString)."
***42 lines of code ***
testF140Op
"Test op:with:"
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
***30 lines of code ***
testF150MinusOp
"Subtract fuzzy distributions."
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
***36 lines of code ***
testF155Minus
"Subtract fuzzy distributions."
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
"NOTE: Following will fail occasionally."
"Examine expectedMean"
"The difference will typically be on the order of 5-15%"
"It could be close to zero, but that will be a rare event."
***46 lines of code ***
testF160Division
"Divide fuzzy distributions."
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
"NOTE: Following will fail occasionally."
"Examine expectedMean"
"The difference will typically be on the order of 5-15%"
"It could be close to zero, but that will be a rare event."
***42 lines of code ***
testF170Product
"Multiply fuzzy distributions."
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" But, because there is a long tail . . . "
"NOTE: Following will fail occasionally."
"Examine expectedMean"
"The difference will typically be less than 3%"
"It could be close to zero, but that will be a rare event."
***45 lines of code ***
testF210PlusOrMinus
"A measure stated as plus-or-minus
"Use Float #closeto: "
"Note: Following will fail occasionally."
testF230Plus
"Add fuzzy distributions."
"A distribution is a Dictionary of p->f points
" Niave median is just . . . "
" In this case, the tail is not long. "
"Examine expectedMean"
"The difference is typically less than 1% "
"Transcript cr; show: 'testF230Plus diffMean = ', ( diffMean asString)."
***29 lines of code ***
testF310Mode
"Estimate the mode of a distribution by calculating expected value."
testF410Plot
"Estimate the mode of a distribution by calculating expected value."
testF430PlotPlus
"Add fuzzy distributions.
"A distribution is a Dictionary of p->f points
***27 lines of code ***
testF431PlotPlus
"Add fuzzy distributions.
"A distribution is a Dictionary of p->f points
***27 lines of code ***
ztestF410LearnToPlot
"Estimate the mode of a distribution by calculating expected value."
"verticle grid"
"horizontal grid"
"Should we display the canvas?"
"You can delete morph by double-clicking it."
***46 lines of code ***
Hum-Tests -- HumOntologyTests
test001newOntology
"create a new Ontology"
test100nounTypes
"An entity noun will have attributes."
"A category noun will have categories."
"An entity noun may have supertypes and/or subtypes."
"A plural noun indicates a list or set or bag collection. By default, it indicates a set."
"A noun may have a synonym. "
test102addOneNoun
"Add one noun to current set."
test103addTwoNouns
"Add two nouns to current set."
"Add first noun."
"Add second noun."
"Make sure we did not overlay original"
test104addArrayOfNouns
"Add array of nouns to current set."
"Add one noun."
"Add from array."
"Add from set."
***22 lines of code ***
test110addEntityAttribute
"Add an entity-attribute relation."
"Add noun."
"Add entity-attribute relation."
"Test"
"Add a second entity-attribute relation."
"Test"
***21 lines of code ***
test111getAllAttributesOfNoun
"Add an is-A relation."
"Define a few relations."
"The attrbutes include both the supertypes and the attributes of the supertypes."
"THINK -- Is this what we want? What will we do with the supertypes?"
"
"
***27 lines of code ***
test120addSubtype
"Add an is-A relation."
"Add noun."
"Add is-A relation."
"Test isKindOf"
"Test subtypes"
test121automaticSubtype
"Add an is-A relation."
"Add noun."
"Add an automatic subtype."
"Test isKindOf"
"Test subtypes"
test122getAllSubtypesOfNoun
"Get all subtypes of a noun -- Use at run-time for polymorphism."
"Add a few subtype-supertype relations."
"Party has two subtypes (person, organization)."
"Party has 8 subtypes in the whole subtype tree. "
"Transcript show: allSubtypes asSortedCollection; cr."
***31 lines of code ***
test123getImmediateSupertypesOfNoun
"Get immediate super types of a noun -- Use when translating to another language ."
"Add a few subtype-supertype relations."
"Vendor has one immediate supertype: Vendor is an organization."
"Supplier has one immediate supertype: Supplier is a vendor."
"Employee has one immediate supertype: Employee is a worker.."
"Worker has one immediate supertype: Worker is a party."
"Party has two subtypes (person, organization)."
"Party has no supertypes in this ontology."
"Self-employed-constulant has two immediate supertypes:
***54 lines of code ***
test124getAllSupertypesOfNoun
"Get immediate super types of a noun -- Use when translating to another language ."
"Add a few subtype-supertype relations."
"Vendor has one immediate supertype: Vendor is an organization."
"Supplier has one immediate supertype: Supplier is a vendor."
"Employee has one immediate supertype: Employee is a worker.."
"Worker has one immediate supertype: Worker is a party."
"Party has two subtypes (person, organization)."
"Party has no supertypes in this ontology."
"Self-employed-constulant has two immediate supertypes:
"consultant > worker > person > party; also: consultant > vendor > organization > party"
***58 lines of code ***
test130getSingularFormOfPluralNoun
"Return the singular form of a plural noun."
"If the plural is the same as the singular form, there is no problem - We luck out."
"Currently there is no way to declare irregular nouns in Hum."
"Special cases that currently fail:"
***35 lines of code ***
test220addOneRole
"Add one role to current set."
test230addTwoRoles
"Add two roles to current set."
"Add first role."
"Add second role."
"Make sure we did not overlay original"
test310statementTokens
"A statement is made up of tokens."
"Make a statement and get its tokens."
"Tokens are in an ordered collection (array-like)."
"Tokens are converted to lower case."
"Tokens include punctuation."
test320statementEndsWithPeriodOrColon
"A statement must end with a period or a colon."
"A statement ending in a period should not raise an error."
"A statement ending in a colon should not raise an error."
"A statement not ending in a colon or period should raise an error."
"Transcript show: statement errors; cr."
test330statementHasNouns
"A statement has nouns."
"The nouns might be defined after the statement is defined. "
"(Nouns are not completely bound until compile time.)"
***21 lines of code ***
test340statementParsing
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."
"The nouns might be defined after the statement is defined. "
"(Nouns are not completely bound until compile time.)"
"Get tokenTypes."
"Check nouns."
"Check keywords."
"Check punctuation."
"Add is only another word. -- Verbs are not special."
"The word 'to' is only another word. -- Prepositions are not special."
***35 lines of code ***
test342statementParsingConsolidatesStrings
"A string is delimited by double quotes."
test350frameLineSeparateLabelStatementCommentAnnotation
"Generic frameline = ( indent ) ( label : ) ( statement '.' ) ( '(' comment ')' ) ( '[' annotation ']' )
"
test351frameLineParsingRemovesComments
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."
test353frameLineParsingSeparatesAnnotation
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."
test360statementMatchesPatternForEach
"Test HumStatement>>onMatch: aPattern do: aBlock "
"Match for each"
test361statementMatchesPatternForEachInThe
"Test HumStatement>>onMatch: aPattern do: aBlock "
"Match for each"
"Preset 'No match' -- to fail fast if the pattern match does not work as expected.'"
"Fail fast if the result was not reset."
"This is the result we are expecting."
test362statementMatchesPatternIsA
"Test HumStatement>>onMatch: aPattern do: aBlock "
"Match ___ is a ___"
"Preset 'No match' -- to fail fast if the pattern match does not work as expected.'"
"Fail fast if the result was not reset."
"This is the result we are expecting."
test363statementMatchesElse
"Test HumStatement>>onMatch: aPattern do: aBlock "
"Match 'Else:'"
"Fail fast if there is no match."
"The following will fail if the parser thinks there are nouns."
"Test for no match."
"This is the result we are expecting."
test364statementMatchesCategories
"Test HumStatement>>onMatch: aPattern do: aBlock "
". . . categories include blah, blah, blah."
test365statementMatchesCategoriesAnd
"Test HumStatement>>onMatch: aPattern do: aBlock "
". . . categories include blah, blah, AND blah.'"
"The word 'and' should be allowed in a list without confusion."
test366statementMatchesAttributes
"Test HumStatement>>onMatch: aPattern do: aBlock "
". . . attributes include blah, blah, blah."
test367statementMatchesAttributesAnd
"Test HumStatement>>onMatch: aPattern do: aBlock "
". . . attributes include . . . blah, blah, AND blah "
test410addOneAction
"An action belongs to a role."
"Set up"
"Add role."
"An action is identified by a statement."
"Add action to the role's set of actions."
test420actionInstructions
"An action statement is defined by a sequence of instructions."
"Set up"
"Add action to the role's set of actions."
"Create an instruction."
" -- Instructions elements are all optional and include role, statement, comment, annotaion, translation."
"Append instruction to sequence of instructions."
"test"
"Create another instruction."
"Append second instruction to sequence of instructions."
"test"
***38 lines of code ***
test430createInstructionsInline
"Create instructions in-line using Class methods"
"Set up"
"Add action to the role's set of actions."
"Append first instruction to sequence of instructions."
"Append second instruction."
***24 lines of code ***
test440getRoleActionStatement
"An action belongs to a role."
"Set up"
"Add action to the role's set of actions."
"Get back the action statement. "
"It should, of course, match."
test441matchActionStatementAgainstCandidate
"Retrieve statement object from ontology when given a similar string."
"Set up"
"Add action to the role's set of actions."
"Check that String>>sameAs: means what we expect."
"Should be able to retrieve with string that matches our source."
"Get back the action statement. "
"Candidate should match when it is word for word the same."
"Candidate should also match if the articles are dropped or different."
***31 lines of code ***
test442matchActionStatementPolymorphic
"Retrieve appropriate statement with supertype
"Set up"
"Define subtypes"
"Add action to the role's set of actions."
"Check that String>>sameAs: means what we expect."
"Should be able to retrieve with string that matches our source."
"Get back the action statement. "
"Candidate should match when it is word for word the same."
"Candidate should also match if the articles are dropped or different."
"Now prove polymorphism works."
"But cookie-batch is not defined as a subtype in this ontology.
***48 lines of code ***
test450instructionNounAntecedents
"Nouns in instructions should have antecedants in the action statement.
"Set up"
"Add action to the role's set of actions."
"Append first instruction to sequence of instructions."
"Append second instruction."
"In the given instruction sequence, the nouns 'oven' and 'batter' were not seen in the action statement."
***31 lines of code ***
test461Frame4ActionCrossReferences
"Given: An action instruction delegates to another role (or same role).
"
"Initialize for an Action Frame."
"Frames must be compiled if nouns are to be flagged"
"When: The action frame is compiled."
"Then: The ontology tracks where (which role-action frame) the action statement is invoked."
"*** Look under the covers to check expectations. TODO: REFACTOR THIS. *** "
***45 lines of code ***
test510CreatePlanFrame
"Make one plan frame. (TDD to drive basic parts)"
"A plan frame has a goal. (post condition)"
"A plan frame has a collection of preconditions."
"A plan frame has a set of zero or more actions
***34 lines of code ***
test520CheckPlanFrame
"A plan frame SHOULD have a goal and at least two preconditions.
"
"Fix that problem."
"A plan frame SHOULD have at least two preconditions."
"If there is only one, the business process should be stated as a procedure."
"Half fix that problem."
"Fully fix that problem."
***36 lines of code ***
test530AddPlanFrame
"Make one plan frame. (TDD to drive basic parts)"
"A plan frame should have a goal and at least two preconditions."
"===
"
***26 lines of code ***
test540GetPlanTree
"Make several plan frames. Get the resulting plan tree."
"A plan frame must have a goal and at should have at least two preconditions."
"TODO: The plan tree is incomplete at this point
"ontology showPlanTree: planTree."
"TODO: IS THIS CORRECT? THIS TEST DOES NOT COUNT THE GOAL AT THE ROOT AS PART OF THE PLAN TREE."
***41 lines of code ***
test545DrawPlanTree
"Make several plan frames. Get the resulting plan tree."
"A plan frame must have a goal and at should have at least two preconditions."
"TODO: The plan tree is incomplete at this point
"Transcript cr; show: 'test545DrawPlanTree'; show: planTreeView; cr."
***34 lines of code ***
test550CheckPlanTree
"Check for an incomplete plan."
"A plan frame must have a goal and should have at least two preconditions."
"
"
***36 lines of code ***
test610renderStatementAsHTML
"In the HTML rendering, statement nouns are enclosed in <n>...</n> to enable style sheet rendering."
"The nouns might be defined after the statement is defined. "
test611renderInstructionLines
"Create instructions in-line using Class methods"
"Set up"
"Add action to the role's set of actions."
"Append first instruction to sequence of instructions."
"Append second instruction."
"Initialize for a Dictionary Frame."
"Frames must be compiled before rendering if nouns are to be flagged."
***33 lines of code ***
test620renderFrame4PlanAsHTML
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a Plan Frame."
"Frames must be compiled before rendering if nouns are to be flagged."
"Test: Is the goal-statement included in the HTML ?"
"Test: Are each of the preconditions included ?"
"Test: Is the action instruction role and statment included ?"
"HTML should include a 'Preconditions' subheading."
"HTML should include a 'Actions' subheading."
"HTML should include nouns flags"
"Preconditions should have nouns marked"
"Actions should have nouns marked."
"Goal should have nouns marked."
***44 lines of code ***
test625renderPlanTreeAsHTML
"Make several plan frames. Get the resulting plan tree."
"A plan frame must have a goal and at should have at least two preconditions."
"Create a Dictionary Frame."
***57 lines of code ***
test626renderNounTreeAsHTML
"Define a dictionary with more than one level. Render as a noun tree."
"Create a Dictionary Frame."
"TODO: HumCalculator translates <> to < >"
***47 lines of code ***
test630renderFrame4ActionAsHTML
"Given: The frame editor contains a role-action frame.
"
"Initialize for an Action Frame."
"Frames must be compiled if nouns are to be flagged"
"Test: Title line is rendered."
"First instruction is rendered."
"2nd instruction is rendered."
"3rd instruction is rendered."
"4th inststruction statement is rendered"
"Comment is rendered"
"Role is rendered."
"HTML should include 'Action:' label."
"Avoid double-space bug"
"html inspect."
***53 lines of code ***
test640renderFrame4ViewAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a View Frame."
"Test that labels are present in the rendering."
"Title line"
"1st markup line"
"2nd markup line"
"3rd markup line"
"4th (last) marup line"
"Test that widgets are present in the rendering."
"1st markup line"
"2nd markup line -- TODO: Should be multi-line box."
"3rd markup line -- TODO: Should be input-table. (HOW?) "
"4th markup line -- TODO: Should be input-table. (HOW?) "
"TODO: WIDGETS NEED TO BE ARTICULATED BY TYPE."
"Inspect -- paste result into HTML tool/file."
"html inspect."
***51 lines of code ***
test641renderRadioButtonAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a View Frame."
"Test that labels are present in the rendering."
"Title lines"
"Are radio widgets rendered?"
"Expect radio button"
"Inspect -- paste result into HTML tool/file."
"html inspect."
***34 lines of code ***
test642renderCheckBoxAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a View Frame."
"Test that labels are present in the rendering."
"Title lines"
"Are widgets rendered?"
"Expect radio button"
"Watch for bug"
"Inspect -- paste result into HTML tool/file."
"html inspect."
***38 lines of code ***
test643renderTextAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a View Frame."
"Test that labels are present in the rendering."
"Title lines"
"Are widgets rendered?"
"Check textarea tag attributes."
"Inspect -- paste result into HTML tool/file."
"html inspect."
***36 lines of code ***
test650renderFrame4DictionaryAsHTML
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a Dictionary Frame."
"Note: String>>match: is not case sensitive.
"html inspect."
***34 lines of code ***
test680renderOntologyAsHTML
"Render an ontology object in HTML and store on given filename."
"Create a Plan Frame."
"Create an Action Frame."
"Create a Dictionary Frame."
"Create a View Frame."
"Frames must be compiled if nouns are to be marked."
"Frames should be have horizontal lines between."
"Should see some nouns flagged."
***66 lines of code ***
test690renderOntologyAsHTMLonFile
"Render an ontology object in HTML and store on given filename."
"Create an Action Frame."
"Create a Dictionary Frame."
"Create a View Frame."
"Frames must be compiled if nouns are to be marked."
"Write on a file."
***70 lines of code ***
test900checkUsability
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
"Generate some code"
"Check usability -- What if we wanted to generate Smalltalk?"
"Check usability -- What if we wanted to generate Java?
"Check usability -- What if we wanted to generate JavaScript?"
"Check usability -- What if we wanted to generate Erlang?
"
"Check usability -- What if we wanted to generate Python?
"Generate arbitrary code"
***46 lines of code ***
test910lineMatchesPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
test911lineDoesNotMatchPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should not match"
test912lineMatchesFloatingPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
test913lineMatchesFloatingPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
test914lineMatchesFloatingPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
test915lineFailsFloatingPattern
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
test920lineMatchesPatternParameters
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
"Get parameters"
test922lineMatchesFloatingPatternParameters
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
"Get parameters"
test923lineMatchesFloatingPatternParameters
"Test the pattern matching.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
"Get parameters"
test930generateCode
"Generate some code that does not require that we find a singular noun.
"
"Test using a dictionary statement pattern."
"Create a frame line that will match the pattern."
"Should match"
"Generate some code"
"Check usability -- What if we wanted to generate JavaScript?"
"Generate arbitrary code"
***25 lines of code ***
Hum-Tests -- HumOntologyTranslatorTests
assertExpectedTokensIn: expected matchesTokensIn: actual
"Compare the two strings as a stream of tokens.
"
"Note failing this assert will halt the loop."
^ self
***28 lines of code ***
bakeThePanInTheOvenForTheTimeGivenInTheRecipeQpan: aPan oven: aOven time: aTime recipe: aRecipe
"Open the oven door. "
"Place the pan in the oven. "
"Close the oven door. "
"Oven: Heat for the time given in the recipe.We have a smart oven."
fulfillOrderQorder: aOrder
"For each order-item in the order: "
"Pull order-item from stock and place on cart. "
"Ship the order to the order-address. "
test010AssertExpectedTokensInAMatchesTokensInB
"Test the utility with the cases that matter to me."
"Two cases that differ only in white space will match"
"Two cases that differ in substance will fail"
test110AttachMethodToClass
"Attach a method to a class."
"Example in Java syntax with Hum accounting"
"TODO: Need some asserts."
test111GetMethodsForClass
"Attach a method and get it back."
"Example in Java syntax with Hum accounting"
"Now get it back."
***24 lines of code ***
test120AttachClassPrologue
"Attach prologue source lines to an actor class.
"
"Example in Java syntax with Hum accounting.
"An Actor`s implementation in Java or Erlang must reside in a file of the same name.
"
***33 lines of code ***
test370forStatementAsSmalltalk
"Translate for . . . to Smalltalk"
"---
"
"Add entity-attribute relation."
"Translate the Hum 'For . . . ' statement into Smalltalk."
"smalltalkCode := forStatement asSmalltalkWithOntology: ontology."
"Expect:
"
"
"
***31 lines of code ***
test380ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test381ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test382ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test383ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test384ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test385ifStatementAsSmalltalk
"Translate if . . . to Smalltalk"
test390elseStatementAsSmalltalk
"Translate if . . . else . . . to Smalltalk"
"TODO: Figure out how to translate 'Else:' from Hum to Smalltalk."
test710translateFrame4ActionToSmalltalk
"Given: a Hum action frame.
"
"Initialize for an Action Frame."
"Test: Title line is rendered."
"First instruction is rendered."
"2nd instruction is rendered."
"3rd instruction is rendered."
"4th (delegated) inststruction is rendered"
"Comment is rendered"
"Role is rendered."
"Transcript cr; show: 'Generated Smalltalk:'; cr; show: code; cr."
"TODO: Review the translation methods to assure consistency in how nouns are handled.
"
"code inspect."
***47 lines of code ***
test720translateFrame4ActionToSmalltalk
"Given: a Hum action frame.
"
"Initialize for an Action Frame."
"Transcript cr; show: 'Generated Smalltalk:'; cr; show: code; cr."
"Test: Title line is rendered."
"First instruction is rendered."
"2nd instruction is rendered."
"3rd instruction is rendered."
"4th (delegated) inststruction is rendered"
"Comment is rendered"
"Role is rendered."
***43 lines of code ***
test730translateFrame4ActionToSmalltalkExdentToBlockEnd
"Given: a Hum action frame.
"
"Initialize for an Action Frame."
"Enter an iteration statement."
"Enter some inside the loop. (It should be indented when rendered.)"
"THINK: Should we require indentation here."
"Next statement has no indent. That signals end of the iteration block."
"
"
"Test: Title line is rendered."
"For is implemented by do:"
"Look for opening and closing ']' on the block."
"Watch for proper close on the do: []. "
"Watch for proper position for closing ']'"
"code inspect."
***60 lines of code ***
testE210translateActionHeaderToErlang
"Translate Hum action header to Erlang do pattern.
"
"Our strategy involves a generic do( ... ) pattern that receives the message."
"Given: ontology knows which words are nouns"
"When: Action header is translated to Erlang do header"
"Then: The do header looks like 'do( { action-statement, noun-values } )' "
"TODO: The Erlang boiler plate must assure that the do() will be invoked
***27 lines of code ***
testE220translateActionCallToErlang
"Translate a Hum action call to an Erlang call."
"Our strategy involves a generic calling pattern that sends the message."
"Given: The ontology knows which words are nouns"
"When: Action call is translated to Erlang call"
"Then: The message passed to the Dispatcher looks like { roleAtom, ActionStatement, NounValues }."
"Note: The role is translated to an Erlang atom."
"self assert: (( '*', expectedMessage, '*' ) match: erlangSource )."
"Then: The call looks like '?CALL({Role,Action,NounValues}).'"
"?CALL is an Erlang macro that will probably become 'gen_supervisor:call( dispatcher, '
"Transcript cr; show: 'in test220translateActionCallToErlang';
***25 lines of code ***
testE230translateInstructionToErlang
"Translate Hum instruction (invoke) to Erlang do()."
"Our strategy involves a generic calling pattern that sends the message."
"Given: ontology knows which words are nouns."
"TODO: In the actual instruction the nouns may be replaced by subtypes.
"
"When: Action call is translated to Erlang call"
testE310translatePlanFramesToErlang
"TODO: Decide how to do this.
"
"*** TODO: Write the HumCoordinator agent in Erlang. *** (Confirm that Alternative-C is workable.)"
"*** See: HumCoordinator>>runPlanFrameForCondition: aGoalString ***"
***39 lines of code ***
testE311translatePreconditionsToErlangList
"Translate a plan-frame`s preconditions to an Erlang list.
"
"A plan frame should have a goal and at least two preconditions."
"erlangCode inspect."
***30 lines of code ***
testE400ReadMe
"Thinking Out Loud:
"
***27 lines of code ***
testE410translateEntityToErlang
"An entity is translated into an Erlang record structure.
"I will keep this code around for a little while."
"Note: This implies that we have records nested in records.
"TODO: Decide if we nest records or refer to the inner attribute entity via an identifier."
"TODO: . . . If so, it means that every entity has a hidden attribute . . . <entity name>-identifier."
"TODO: Decide how to pass attribute values. -- That will partially resolve the question above."
"TODO: Current implementation does not order the attributes."
"erlangCode inspect."
***33 lines of code ***
testE500RoleReadMe
"Strategy: Each each role becomes an Erlang module."
testE510RoleModuleHeader
"A role becomes a module. Here we check the module declaration."
"Create a role-action frame in an ontology."
"Instruction for self."
"Delegated instruction."
"Define subtype supertype relation."
***21 lines of code ***
testE520RoleModuleHeaderExport
"A role becomes a module. Here we check the module header export declarations."
"Create a role-action frame in an ontology."
"Instruction for self."
"Delegated instruction."
"Define subtype supertype relation."
"Erlang action calls invoke do( { statementString, NounValues } )."
"TODO: Confirm OTP exports if OTP is used."
***24 lines of code ***
testE525RoleModuleHeaderMacros
"When a role delegates an action, a ?CALL macro is invoked. "
"Create a role-action frame in an ontology."
"Instruction for self."
"Delegated instruction."
"Define subtype supertype relation."
"Erlang action calls invoke do( { statementString, NounValues } )."
"TODO: Confirm OTP exports if OTP is used."
"Check for CALL macro define."
"-define( CALL( Role, Statement, NounValues ), ?TBD( Role, Statement, NounValues )."
"Call is routed to a role-qualified actor via Hum Dispatcher and Hum Messenger."
***28 lines of code ***
testE530RoleModuleActionFrames
"A role becomes a module. Here we check the module header export declarations."
"Create a role-action frame in an ontology."
"Instruction for self."
"Delegated instruction."
"Define subtype supertype relation."
"TODO: Noun bake-time is attribute of recipe."
"Erlang action calls invoke do( { statementStringAtom, NounValues } )."
"Expect to see function definition corresponding to action statement."
"NounValues become: [ {'cake', Cake}, {'recipe', Recipe} ] -- Note: single-quotes are doubled here."
"Expect to see self-call corresponding to instruction."
"NounValues become: [ {'cake-pan', CakePan} ]"
"Expect to see delegated call via macro."
"NounValues becomes: [ {'recipe bake-time', BakeTime} ] -- NOTE: Noun bake-time is attribute of recipe."
"Entity attribute needs a slightly different noun-value key."
***43 lines of code ***
testH110tranlateEmphasis
"*text* becomes bold, ~text~ becomes italic, _text_ becomes underline, ^text^ becomes superscript"
testH115tranlateEmphasisAtEnd
"*text* becomes bold, ~text~ becomes italic, _text_ becomes underline, ^text^ becomes superscript"
testH120tranlatePageWidget
"Translate [page:text] into HTML anchor element"
testH125tranlatePageWidgetAtEnd
"Translate [page:text] into HTML anchor element - test for bug when widget is at line end."
testH130tranlateLinkWidget
"Translate [link: text | URL ] into HTML anchor element"
testH140tranlateImageWidget
"Translate [link: text | URL ] into HTML anchor element"
testH210tranlateButtonWidget
"Translate [[label]] into HTML button element"
testH215tranlateButtonWidgetAtLineEnd
"Translate [[label]] into HTML button element -- Test for bug when widget is at end of line."
testH216tranlateButtonWidgetAtLineEnd
"Translate [[label]] into HTML button element -- Test for bug when widget is at end of line."
testH220tranlateCheckBox
"Translate [z] into HTML checkbox element."
testH230tranlateRadioButtons
"Translate (a) into HTML radio-button element."
"TODO: FIGURE OUT HOW TO GROUP RADIO BUTTONS."
testH310tranlateTableRow
"Translate | ... | ... | into table elements."
testH320tranlateTableRowWithEmphasis
"Translate | ... | ... | into table elements."
testH330tranlateHeading
"Translate !!! into HTML heading"
testH340tranlateHeadingWithEmphasis
"Translate !!! into HTML heading"
testH350tranlateListItem
"Translate !!! into HTML heading"
testH360tranlateListItemWithEmphasis
"Translate !!! into HTML heading"
testH410tranlateAttributeWidget
"Translate [attribute] into input tag."
testH420tranlateTextAreaWidget
"Translate [attribute 9] into textarea tag."
***24 lines of code ***
testH430tranlateEntityAttributeWidget
"Translate [entity`s attribute] into input tag."
testJ805translateStatementToCamelcase
"A statement is translated directly to CamelCase."
testJ806translateStatementToCamelcase
"A statement is translated directly to CamelCase, but articles are dropped."
testJ810translateFrame4ActionToJava
"Given: a Hum action frame.
"
"Initialize for an Action Frame."
"Transcript cr; show: 'test810translateFrame4ActionToJava Generated Java'; cr; show: code; cr."
"Test: Title line is rendered."
"TODO: The generated Java code (see below) will not compile because 'aDoor' is not defined."
"QUESTION: Is 'aDoor' a noise-word in this context? Do we really need it?"
"QUESTION: Should we/Could we fix the problem by adding a local variable declaration where needed?"
"First instruction is rendered."
"2nd instruction is rendered."
"3rd instruction is rendered."
"4th (delegated) inststruction is rendered"
"Comment is rendered"
"Code ends with a bracket"
"Code should not contain doubled semi-colon. (Test for bug)"
"code inspect."
***52 lines of code ***
testJ811translateFrame4ActionToJava
"Given: a Hum action frame with a hyphenated noun.
"
"Initialize for an Action Frame."
"Transcript cr; show: 'testJ811translateFrame4ActionToJava Generated Java'; cr; show: code; cr."
"Test: Title line is rendered."
"TODO: The generated Java code (see below) will not compile because 'aDoor' is not defined."
"First instruction is rendered."
"2nd instruction is rendered."
"3rd instruction is rendered."
"4th (delegated) inststruction is rendered"
"Comment is rendered"
"Code ends with a bracket"
"Code should not contain doubled semi-colon. (Test for bug)"
"TODO: Test for case where noun is a hyphenated term."
"code inspect."
***50 lines of code ***
testJ820translateDictionaryToJava
"Entity becomes class. Attribute becomes String, Category, ..."
"Define a few relations."
"Transcript cr; show: 'test820translateDictionaryToJava'; cr; show: code; cr; show: '%%%%%%%%%%'; cr."
"Expect each entity to become a class declaration."
"Entities extend their Hum supertype."
"Attributes with no supertype are Strings by default"
"Attributes with supertypes declare accordingly"
"Classes have closing brace."
"Expect 'extends' clauses for subtypes."
"Expect 'category' to be detected."
"Check for bug:"
"code inspect."
***74 lines of code ***
testJ825translateCollectionNounToJava
"Test a more complicated dictionary with a collection and recursive structure."
"Define a few relations."
"Translate to Java"
"Expect each entity to become a class declaration."
"Entities extend their Hum supertype."
"Attributes with no supertype are Strings by default"
"Attributes with supertypes declare accordingly"
"Classes have closing brace."
"TODO: By default a collection is a Bag<Entity>.
"code inspect."
***45 lines of code ***
testJ830translateFrame4ActionToJavaExdentToBlockEnd
"Given: a Hum action frame.
"
"Initialize for an Action Frame."
"Enter an iteration statement."
"Enter some inside the loop. (It should be indented when rendered.)"
"THINK: Should we require indentation here."
"Next statement has no indent. That signals end of the iteration block."
" Transcript cr;
"
"Test: Title line is rendered."
"Test: 'For each order-item in the order:' "
"Look for opening and closing '} // for' on the block."
"code inspect."
***60 lines of code ***
testJ840translatePlanFrameToJava
"The plan is data, so translation involves translating each goal frame into a series of Java setters.
"
"javaCode inspect."
***36 lines of code ***
Hum-Tests -- HumProgrammersAssistantTests
aReadMe
"See the class description for the intended (future) tests."
^'See the class description for the intended (future) tests.'
storeInOntology: aHumOntology fromFrameUpdater: frameUpdater1
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
"Check the content."
***36 lines of code ***
test110newOntology
"PA initializes (re-initializes) to an empty ontology."
test120saveOntology
"PA saves (writes) the ontology to a file."
test130loadOntology
"PA loads (reads) the ontology fram a file where it was saved previously."
test200createFrame
"There are seven types of frame: (See HumFrame hierarchy)
"
test220createFrame4Plan
"Test a plan frame (goal frame).
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
***28 lines of code ***
test230createFrame4Action
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
***25 lines of code ***
test231formatFrame4Action
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
***68 lines of code ***
test240createFrame4View
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a View Frame."
"Add markup lines."
test250createFrame4Dictionary
"The frame editor instance knows what kind of frame it is editing.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
***25 lines of code ***
test260createFrame4Vignette
"Create a dialog vignette..
"
"Initialize for a Dictionary Frame."
test261updateFrame4Vignette
"Create a dialog vignette.
"
"Initialize for a Dialog Frame."
"Add response lines."
"There are two kinds of resonse, verbal responses and actions."
***33 lines of code ***
test270createFrame4Comment
"Create with a comment frame..
"
"Initialize for a Comment Frame."
test300codeCriticFeatures
"The code critic generates errors and warnings for each type of frame."
"General syntax in most frames:
"
"For statements in any frame:
"
"For plan frames:
"
"For dictionary frames:
"
"For vignette frames:
"
"For widgets:
"
"For text markup in view and vignette:
"
***52 lines of code ***
test320critiqueFrame4Plan
"Check plan frame - no known nouns - no plans
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Expect complaints about no nouns."
"Expect complaints about preconditions with no plans."
"Transcript cr; show: 'test320critiqueFrame4Plan Errors: ', errors asString; cr."
***29 lines of code ***
test321critiqueFrame4Plan
"Detect: Every precondition has a noun that traces back to the goal statement.
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Every line has recipe as a noun."
"Expect no complaints about no nouns. "
***26 lines of code ***
test322critiqueFrame4PlanMissingAntecedant
"Detect: One or more preconditions have a noun with no antecedant in the goal statement.
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Every line has recipe as a noun."
"Expect 'no antecedant' complaints "
***26 lines of code ***
test330critiqueFrame4Action
"Detect: No known nouns.
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"Expect complaints about no nouns on every line because the ontology has not been informed."
"Check the simple instructions."
"Check the last one - It is delegated."
"The action line should have nouns too."
***41 lines of code ***
test331critiqueFrame4Action
"Detect: Some nouns, but still not enough.
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"Still expect one complaints about no nouns on the last line."
***26 lines of code ***
test332critiqueFrame4ActionForAntecedants
"Detect: 'No known noun' and/or 'no antecedant'
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"Still expect one complaints about no nouns on the last line."
"Check for antecedants - Happy path: 'door' is not a noun and needs no antecedant."
"But if we make door a noun, it will now lack an antecedant."
***38 lines of code ***
test345critiqueFrame4View
"Detect: No nouns in a view frame.
"
"Turn this on/off for now."
"Initialize for a View Frame."
"Add markup lines.
"
"Expect complaints about no nouns."
"Transcript show: errors; cr."
***36 lines of code ***
test346critiqueFrame4View
"When the nouns are defined, there are no complaints. s
"
"Initialize for a View Frame."
"Add markup lines."
"Expect no complaints about no nouns."
"Transcript show: 'test346critiqueFrame4View errors:'; cr; show: errors; cr."
***34 lines of code ***
test350critiqueFrame4Dictionary
"Critique a dictionary frame.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"Until the frame is compiled, the nouns are not recognized.
"
"Transcript cr; show: 'test350critiqueFrame4Dictionary'; cr; show: errors; cr."
***39 lines of code ***
test351critiqueFrame4Dictionary
"Critique a dictionary frame.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"ontology addNouns: #( 'recipe' 'name' 'description' 'ingredient' 'step' )."
"Expect no complaints about no nouns."
"Transcript cr; show: 'test351critiqueFrame4Dictionary'; cr; show: errors; cr."
***37 lines of code ***
test361critiqueFrame4Vignette
"Critique a dialog vignette.
"
"Initialize for a Dialog Frame."
"{Ask menu.} is not defined in this ontology."
***60 lines of code ***
test421compileFrame4Plan
"In this context, 'compile' means that the plan frame is inserted into the ontology,
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Every line has recipe as a noun."
"Expect no complaints about no nouns. "
"Now we should see frame in the ontology."
***37 lines of code ***
test431compileFrame4Action
"In this case, 'compile' means adding the frame to the ontology,
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"Now we can get the action from the ontology"
"Now we can also get the instruction sequence "
"And the role`s actions includes "
***47 lines of code ***
test446compileFrame4View
"Compile a view frame.
"
"Initialize for a View Frame."
"Add markup lines."
"Expect no complaints about no nouns."
***32 lines of code ***
test450compileFrame4Dictionary
"In this context,
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"supertype"
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"There are no syntax errors."
"Check that ontology has all that stuff."
"Check that the supertypes are recorded also."
***45 lines of code ***
test461compileFrame4Vignette
"Compile a dialog vignette.
"
"Initialize a Vignette Frame."
"The ontology should have these frames."
""
***47 lines of code ***
test510storeFrame
"Store the frame in the given ontology.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"supertype"
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"The frame editor receives the command to store the frame from the user interface (Scribe)."
***30 lines of code ***
test520fetchFrameByID
"Store a dictionary frame and then get it back using its uniqueIdentifier.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"supertype"
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***45 lines of code ***
test531fetchFrame4PlanByID
"Create a plan frame in editor; store it; get it back via its ID.
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Every line has recipe as a noun."
"Expect no complaints about no nouns. "
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***50 lines of code ***
test532fetchFrame4PlanByTitle
"Create a plan frame in editor; store it; get it back via its title.
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Every line has recipe as a noun."
"Expect no complaints about no nouns. "
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
"Make sure it still works when there is more than one plan frame."
"Check the content."
***60 lines of code ***
test540fetchFrame4DictionaryByID
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater1."
"Check the content."
***43 lines of code ***
test541fetchFrame4DictionaryByTitle
"Ontology will fetch a dictionary frame given its title."
"Given: Ontology has several dictionary frames."
"When: Caller (PA) requests a dictionary frame by its title."
"Then: Ontology returns the matching frame."
"--- Otherwise ---"
"The caller may request a ranked list of nearest matches. (test542 ?)"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"list collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"The frame editor receives the command to store the frame from the user interface (Scribe)."
"The frame will now have a uniqueIdentifier."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***50 lines of code ***
test551fetchFrame4ActionByTitle
"The title of an action includes the role and the statement."
"Given: Ontology contains several action frames."
"When: Caller (PA) requests the action frame with role and statement-string."
"Then: Ontology returns the matching action frame.
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***46 lines of code ***
test561fetchFrame4ViewByTitle
"This should be easy."
"Given: PA or run-time has ontology open with several view frames."
"When: PA or run-time correctly requests a view by name."
"Then: Ontology returns the frame containing that view."
"--- Following can go into another test: ---"
"When: The name does not match any view,"
"Then: The PA can ask the ontology for a ranked list of view names. (best match)"
"Initialize for a View Frame."
"Add markup lines."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***41 lines of code ***
test571fetchFrame4VignetteByTitle
"TODO: Think about how vignettes would be identified to users.
"
"Given: A context is active."
"When: Scribe delivers a pattern and run-time looks it up."
"Then: If the pattern matches one of the vignette`s in the active context,
"Create a dialog vignette.
"
"Initialize for a Dialog Frame."
"Add response lines."
"There are two kinds of resonse, verbal responses and actions."
"We can use the identifier to fetch the frame into another frameUpdater."
"Check the content."
***69 lines of code ***
test620storeFrame4Plan
"Store plan frame.
"
"Initialize for a Plan Frame."
"Append precondition lines."
"Finish with action statement."
"Run store and fetch test routine"
***22 lines of code ***
test630storeFrame4Action
"Store an action frame.
"
"Initialize for an Action Frame."
"Append instruction lines."
"Append an instruction that is delegated"
"Run store and fetch test routine"
***27 lines of code ***
test640storeFrame4View
"Store a view frame.
"
"Initialize for a View Frame."
"Add markup lines."
"Run store and fetch test routine"
***23 lines of code ***
test650storeFrame4Dictionary
"Store a dictionary frame.
"
"Initialize for a Dictionary Frame."
"Add dictionary lines."
"attributes"
"set collection"
"Attribute used in set above is an entity with its own attributes. Entities are members of set."
"categories"
"list collection"
"Attribute used in list above is an entity. Entity instances are in a list. (OrderedCollection)"
"Run store and fetch test routine"
***30 lines of code ***
test660storeFrame4Vignette
"Store a dictionary frame.
"
"Initialize for a Dialog Frame."
"Add response lines."
"There are two kinds of resonse, verbal responses and actions."
"Run store and fetch test routine"
***24 lines of code ***
test700parseSourceLineReadMe
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
test701parseInstructionLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***23 lines of code ***
test702parseInstructionLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***24 lines of code ***
test703parseInstructionLineWithString
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
test704parseInstructionLineWithTwoComments
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***25 lines of code ***
test705parseActionLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***23 lines of code ***
test706parseActionLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***24 lines of code ***
test707parseActionLineWithAnnotation
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***22 lines of code ***
test708parseActionLineWithCommentAndAnnotation
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***23 lines of code ***
test710getLabel
"Some framelines have labels. Some don't."
test711parseDictionaryLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***25 lines of code ***
test712parseDictionaryLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***26 lines of code ***
test713parseDictionaryCategoriesLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
"The role prefix is optional - It only appears when one role is delegating to another."
"Comments and annotation are optional."
***26 lines of code ***
test720getComment
"Some framelines have comments. Some don't."
"Note: Following assumes there is just one comment in the source.
test725noComment
"Some framelines have comments. Some don't."
test730getAnnotation
"Some framelines have annotations. Some don't."
test735noAnnotation
"Some framelines have annotations. Some don't."
test741getOneWidget
"Markup-line class includes own parser.
test742getTwoWidgets
"Markup-line includes a parser."
test743getTwoWidgetsAndButton
"Markup-line includes a parser."
test751parseOneWidget
"Parse a markup-line containing a widget."
***37 lines of code ***
test752parseMultipleWidgets
"Parse a markup line containing multiple widgets."
***26 lines of code ***
test753parseRadioButtons
"Parse a line containing radio button widgets."
***27 lines of code ***
test754parseActionButton
"Parse a line containing an action button."
test755parseLinkWidget
"Parse a mark-up line with a link widget."
***24 lines of code ***
test760parseEmphasisMarkup
"Parse a mark-up line with emphasis markup."
***37 lines of code ***
test770parseHeadingMarkup
"Parse a mark-up line with emphasis markup."
***32 lines of code ***
test772parseBulletListMarkup
"Parse a mark-up line with bullet list markup."
***34 lines of code ***
test773parseNumberListMarkup
"Parse a mark-up line with emphasis markup."
***36 lines of code ***
test800LoadFileReadMe
"The Programmers Assistant may load and parse a text file.
"
"Frames are separated by lines beginning with ===.
"
test810FramesAreSeparatedByFrameDelimiter
"Frames are separated by lines beginning with ===.
"
***21 lines of code ***
test811StreamStartsWithFrameDelimiter
"Test where file starts with a frame-delimiter."
"Test where file starts with a frame-delimiter."
test812StreamEndsWithEndOfFile
"Test where frame ends on end-of-file"
"Test where frame ends on end-of-file"
test813StreamStartsWithFrameDelimiterEndsWithEOF
"Test where file starts with a frame-delimiter and ends on end-of-file."
"Test where file starts with a frame-delimiter and ends on end-of-file."
test814StreamHasViewAndDictionaryFrames
"Load two frames: a view frame and a dictionary frame."
"Load two frames."
***22 lines of code ***
test815StreamHasViewDictionaryAndPlanFrame
"Load three frames: a view, a dictionary, and a plan frame."
"Load three frames."
"Test for correct number of plan lines. (Remove defect where block labels are of wrong type.)"
***40 lines of code ***
test816StreamHasViewDictionaryPlanAndCommentFrames
"Load four frames: a view, a dictionary, a plan, and a comment frame."
"Load four frames."
***35 lines of code ***
test817StreamHasViewDictionaryPlanAndActionFrames
"Load four frames: a view, a dictionary, a plan, and an action frame."
"Load four frames."
***45 lines of code ***
test820StreamHasVignettes
"Test that vignettes are properly parsed, loaded, and indexed."
"Load these frames."
***55 lines of code ***
test830LoadActionFrame
"Load, parse, and render a slightly tricky action frame."
"actionFrame := frames at: 1."
"
"
***40 lines of code ***
test910LoadFromTextFile
"Load from pizza-ontology.txt"
test912LoadDonutShop
"Load from pizza-ontology.txt"
test913LoadBarista
"Load from pizza-ontology.txt"
"We want at least one of each type of frame."
test914LoadClubMech
"Load from pizza-ontology.txt"
"Transcript cr; show: 'test914LoadClubMech begins'."
"Transcript cr; show: 'test914LoadClubMech ends'."
test920LoadFromTextFileAndRenderAsHTML
"Load from pizza-ontology.txt"
test922LoadDonutShopAndRenderAsHTML
"Load from some-ontology.txt"
test923LoadBaristaAndRenderAsHTML
"Load from some-ontology.txt"
test924LoadClubMechAndRenderAsHTML
"Load from some-ontology.txt"
test925LoadClubMechAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test926LoadDonutShopAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test927LoadBaseOntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test928LoadVROntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test929LoadMarkupViewAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
"TODO: RESULTING RENDERING HAS ERRORS. THIS TEST NEEDS MORE ASSERTIONS."
test930LoadToDoListAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test931LoadBootStrapOntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test944LoadClubMechSaveReload
"Load from some-ontology.txt, save it, reload it."
"Transcript cr; show: 'test914LoadClubMech begins'."
"Save it to another file and reload it from the saved file."
"Load it back - should get same result as before."
***25 lines of code ***
test945LoadDonutShopSaveReload
"Load from some-ontology.txt, save it, reload it."
"Save it to another file and reload it from the saved file."
"Load it back - should get same result as before."
"Counts should be same as above."
"TODO: We lost the origin of the frames when we wrote them out."
***33 lines of code ***
test954LoadClubMechSaveReload
"Load from some-ontology.txt, save it, reload it."
"Transcript cr; show: 'test914LoadClubMech begins'."
"Save it to another file and reload it from the saved file."
"Load it back - should get same result as before."
***25 lines of code ***
test971CreateNounTreeGraph
"Create a graph of the base ontology noun tree."
"Assign creation of the noun tree to Ontology (HumOntology).
testU000UserInitiatedEvents
"Plan for user-initiated events."
"KeyboardEvents:
"
"OntologyUpdateEvents:
"
"RenameEvents:
"
***33 lines of code ***
testU100KeyBoardEvents
"KeyboardEvents:
"
"
"
***41 lines of code ***
testU200NewRelationEvents
"NewRelationEvents:
"
testU300RenameEvents
"RenameEvents:
"
text930expected
^'<html>
***127 lines of code ***
Hum-Tests -- HumRunTimeTests
aReadMe
"See the class description for the intended (future) tests."
^'See the class description for the intended (future) tests.'
expect: actualValue is: expectedValue
""
^ self
expected: expectedValue actual: actualValue
""
^ self
setUp
"This setup is used by many run-time tests.
"Set the ID"
"Define a Hum configuration."
"Attach local messenger (Mock)".
"Create worldbase instance and check-in."
"A resource Dispatcher must know a messenger and a bookkeeper."
"A bookkeeper must know a messenger and a world base."
"A worker must know a messenger and a Dispatcher and some roles"
"Messenger needs to know bookkeeper and Dispatcher"
"Check in."
***35 lines of code ***
setUpKnockKnockOnOntology: anOntology
"Provide a view frame."
"Provide a dictionary frame."
tearDown
"Transcript cr; show: 'completed: ', (testSelector asString)."
test000ApplicationConfigurationReadMe
"An application has a run-time configuration."
"
"
***22 lines of code ***
test005ApplicationConfigurationSetup
"This setup is used by several tests. "
"Define a Hum configuration."
"#setUp creates a shared configuration."
***26 lines of code ***
test100ActorReadMe
"
"
***45 lines of code ***
test100ReadMe
"Network is a wrapper on whatever technology is used to communicate between Actors."
"Features:"
"The Network sends/receives messages (wrapping the communication technology)."
"The Network component provides serialization and de-serialization of Message instances (see HumMessage)."
"Design Note: The serialization strategy assumes 'payload' is not sensitive to communication stack."
"TBD: Consider Erlang strategy and interface. Assume most tests will be on the Erlang side."
test105actorConfiguration
"A Hum Actor is configured with the address of a messenger node.
"
"Create the (mock) messenger service"
"A resource dispatcher must know a messenger and a bookkeeper."
"A bookkeeper must know a messenger and a world base."
"A worker must know a messenger and a dispatcher and some roles"
***30 lines of code ***
test110workerChecksIn
"Worker checks-in, announcing roles."
"The check-in protocol has the worker-side and the resource dispatcher side."
"Worker says:
"Get the worker from the setup."
"Get the resource dispatcher from the setup."
"Execute the check-in directly."
"dispatcher now includes worker in set of those who know that role."
***25 lines of code ***
test120workerCheckInMessage
"Worker checks-in, announcing roles."
"The check-in protocol has the worker-side and the resource dispatcher side."
"Worker says:
"Get the worker from the setup."
"Get the resource dispatcher from the setup."
"Use a Smalltalk coded message to tell dispatcher."
"To: Execute the check-in directly, we would say:"
"dispatcher checkInActor: worker name at: 'worker uri' withRoles: worker roles."
"dispatcher now includes worker in set of those who know that role."
***27 lines of code ***
test130workerChecksInViaMessenger
"Worker checks-in, announcing roles."
"The check-in protocol has the worker-side and the resource dispatcher side."
"Worker says:
"Get the worker from the setup."
"Get the resource dispatcher from the setup."
"Tell the worker to check-in."
"dispatcher now includes worker in set of those who know that role."
***21 lines of code ***
test135workerChecksOutViaMessenger
"Worker checks-in, announcing roles."
"The check-in protocol has the worker-side and the resource dispatcher side."
"Worker says:
"Get the worker from the setup."
"Get the resource dispatcher from the setup."
"Tell the worker to check-in."
"dispatcher now includes worker in set of those who know that role."
"Tell the worker to check-out."
***25 lines of code ***
test200DispatcherReadMe
"The Dispatcher (RM) - assigns tasks to actors.
"
***47 lines of code ***
test210DispatcherAssignsAction
"Some actor delegates a task to a role.
"
"Get the Dispatcher from the setup."
"Create a baker worker"
"Create another actor to be oven. "
"Tell the actors to check-in."
"======= Set up the action frame =========="
"Initialize for an Action Frame."
"Append an instruction that is delegated"
"We need at least one noun."
"============== ================="
"We will pretend to be Coordinator running a plan.
"
"After the task is done, a resource usage entry will be sent to the bookkeeper."
"See also: Bookkeeper tests."
***63 lines of code ***
test300CoordinatorReadMe
"Coordinator - controls execution of plans and dialogs.
"
test310coordinatorRunsPlan
"Dialog:
"
"Create an ontology."
"Define a few nouns."
"Compile it"
"Define a simple plan."
"Create the corresponding action frame."
"Store it in the ontology."
"Compile it."
""
"Create a running instance of the plan and a coordinator to run it."
"Run the plan."
"After that plan has run. The goal will be fulfilled."
"Now there should be at least one change on the job ticket."
***61 lines of code ***
test320coordinatorInvokesAction
"Goal: Plan has one frame with no preconditions.
"
"Define a few nouns."
"Compile it"
"Define a simple plan."
"Create the corresponding action frame."
"Store it in the ontology."
"Compile it."
""
"Create a running instance of the plan and a coordinator to run it."
"Run the plan."
"After that plan has run. The goal will be fulfilled."
"Now there should be at least one change on the job ticket."
***64 lines of code ***
test330twoPlanFrames
"Test with two plan frames.
"
"Root frame has one prereq and one action"
"Create the corresponding action frame."
"Second level frame with no prereq and one action"
"Create the corresponding action frame."
"We need at least one noun."
***49 lines of code ***
test340planTreeBranches
"Test a plan tree with several levels and significant branching.
"
"The root frame of this plan tree has several preconditions."
"Corresponding action frame:"
"Second level frame -- This frame has a precondition, therefore a third level will be needed."
"Corresponding action frame:"
"Another second level frame - has no precondtions at this time."
"Corresponding action frame:"
"Still another second level frame - has no preconditions at this time."
"Corresponding action frame:"
"Third level frame - has no preconditions at this time."
"Corresponding action frame:"
"We need at least one noun."
"
"
***96 lines of code ***
test400BookkeeperReadMe
"A Bookkeeper tracks resource utilization.
"
test410BookkeeperRecordsJobTickets
"If we ask the bookkeeper to 'run' a jobTicket, it stores it in its jobTickets collection.'"
test420BookkeeperSums
"The bookkeeper tracks utilization of an actor by action, actor, role, job.
"
"Measures are tracked by action, role, actor, and job."
"Send to bookkeeper."
"Bookkeeper tracks utilization by Action."
"Bookkeeper tracks utilization by Actor."
"Bookkeeper tracks utilization by Role."
"Bookkeeper tracks utilization by Job."
"Sum by metric (calls, steps, gross counts)"
***45 lines of code ***
test600WorldBaseReadMe
"
"
test610CreateWorldBaseInstance
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
test615CreateUniqueIdentifier
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
test616CreateUniqueIdentifierDoesNotBreak
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
"Make sure it can handle high rate."
test620setAndGet
"set entity-attribute value"
test630setGetReplace
"set entity-attribute value"
test640FindWhere
"set entity-attribute value"
"Insert two entity instances with attribute vlaues."
"Return a set of entity identifiers satisfying my criteria."
"entitySet sorted asArray inspect."
"TODO: Decide: EntityType is innate. EntityType is an attribute."
***25 lines of code ***
test700BlackBoardReadMe
"
"
"
"
test710setAndGet
"set entity-attribute value"
"Set entity-attribute value."
test720setGetReplace
"Update entity-attribute value"
test730clearEntity
"Update entity-attribute value"
***30 lines of code ***
test800DialogAgentReadMe
"
"
test810createSimpleVignette
"Create a vignette frame."
test820createDialogAgent
"Create a dialog agent."
test825DialogAgentHasScribe
"When a dialog agent is activated, a Scribe is already present."
"How is the scribe`s presence evidenced?
"
test830dialogAgentMatchesInputToVignette
"Pattern 'Hello *.' matches 'Hello.'.
"
"Simulate call from Scribe."
***29 lines of code ***
test832dialogAgentMatchesInputToVignette2
"Pattern 'Hello *.' matches 'Hello Ms. Robot.'
"
"Simulate call from Scribe."
***30 lines of code ***
test833dialogAgentMatchesInputToVignette3
"Pattern ('Hello *.' 'Hi *.') matches 'Hi there.'.
"
"Simulate call from Scribe."
***30 lines of code ***
test834dialogAgentMatchesInputWithAlternatePunctuations
"Pattern ('Hello *.' 'Hi *.' 'Hi *!' 'Hello * ?') matches 'Hi there.'.
"
"Simulate call from Scribe."
***33 lines of code ***
test840dialogAgentSorry
"Stimulus 'Help' returns 'Sorry ...'
"
"Simulate call from Scribe."
***34 lines of code ***
test850dialogAgentMatchesInputWithAlternatePunctuations
"Pattern ('Hello *.' 'Hi *.') matches 'Hi!'.
"
"Simulate call from Scribe."
***32 lines of code ***
test860dialogAgentMatchesInputWithNounSlot
"Pattern ('My name is [full-name].') matches 'My name is Tessie Tester.'.
"
"Simulate call from Scribe."
"Was slot filled-in?"
***36 lines of code ***
testM110MessengerRemembersActors
"Create an actor -- The actor automatically registers itself with the messenger in its configuration."
"One more should make no problem."
testM120MessageAttributes
"The components of a message include sender, receiver, when sent, statement, and noun-values. "
testS100ScribeReadMe
"These Scribe tests generally involve a Scribe that is independent of Seaside.
"
"
"A Scribe is a HumActor that interprets user gestures seen by some set of sensors."
"In this set of tests, the Scribe interprets HTTP requests."
"General dataflow / workflow:
"
"TODO: How does the Dispatcher know what kind of Scribe to delegate 'Ask viewName.' ???"
"Thinking Out Loud:
"
"Summary - Restatement:
"
***75 lines of code ***
testS110SetupScribe
"A scribe is attached to a dialogAgent Agent.
"
"Scribe is attached to a Dialog Agent."
"The Dialog Agent has a Blackboard."
testS131ScribeHandlesHttpPostRequest
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
"Setup the Dialog actor and the Scribe actor."
"Set Http Request form to include this input - name:value pair."
"Ask Scribe to handle the request."
"We should see data in Scribe`s Blackboard and a change in scribe state."
"We should also see data in the Dialog Agent`s blackboard"
***22 lines of code ***
testS132ScribeHandlesViewReturn
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
"Scenario:
"Dialog delegates 'Ask' to Scribe"
"htmlSent := scribe log at: 2.
***42 lines of code ***
testS134ScribeMocksViewDataEntry
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
"Dialog delegates 'Ask' to Scribe"
"The blackboard should now match data entered."
"And the worldbase has also been updated"
***23 lines of code ***
testV100ReadMe
"Test HumVector - which is a subclass of FloatArray"
"Test vector arithmetic v + v, v - v, v dot: v, v cross: v. v * scalar. v / scalar."

testV110TestVplusV
"Test HumVector - which is a subclass of . . ."

testV120TestVminusV
"Test HumVector - which is a subclass of . . ."

testV130TestVdotV
"Test HumVector - which is a subclass of . . ."

testV140TestVcrossV
"Test HumVector - which is a subclass of . . ."

"Test with unit vectors."
"Text with some numbers."
***21 lines of code ***
testV150TestVtimesScalar
"Test HumVector - which is a subclass of . . ."

testV160TestVdividedByScalar
"Test HumVector - which is a subclass of . . ."

Hum-Tests -- HumSeasideProgrammersAssistantTests
aReadMe
"
"
^'See the class description for the intended (future) tests.'
test110newOntology
"Browser initializes (re-initializes) to an empty ontology."
test121loadOntologyInstance
"Browser saves (writes) the ontology to a file."
test130saveOntology
"Browser saves (writes) the ontology to a file."
test222OpenOntologyInstance
"Test the dialog that asks the user for the file name."
"
"
Hum-Tests -- HumSeasideUserInterfaceTests
checkGeneratedCode
"This is a place to see if generated code will compile."
setUpViewFrameInOntology: aHumOntology
"Generate a view frame and dictionary entries for several tests.
"
"Create a view frame."
"Add markup lines."
"TODO: Make this smarter.
"
"Create a dictionary frame."
"TODO: Should render description as a text area."
"TODO: Should render ingredients as an unordered list."
"TODO: Should render steps as an ordered list."
***50 lines of code ***
test310ViewBecomesForm
"A Hum view frame is rendered as a Seaside Form.
"
"Initialize the View Frame for this test."
"There is only one frame in this ontology."
"Generate Seaside code for the view frame."
test311ViewHasMultipleLines
"A Hum view frame is rendered as a Seaside Form.
"
"Initialize the View Frame for this test."
"There is only one frame in this ontology."
"Generate Seaside code for the view frame."
test312ViewHeader
"A Hum view frame is rendered as a Seaside Form.
"
"Initialize the View Frame for this test."
"There is only one frame in this ontology."
"Generate Seaside code for the view frame."
***22 lines of code ***
test313ViewField
"A Hum view frame is rendered as a Seaside Form.
"
"Initialize the View Frame for this test."
"There is only one frame in this ontology."
"Generate Seaside code for the view frame."
"See if the resulting code will compile in the context of a HumDialogAgent."
"Transcript show: '*** test313ViewField frameCode: ***'; cr; show: frameCode; cr."
***34 lines of code ***
test314CheckGeneratedCode
"This is a place to see if generated code will compile and run."
"Following is pasted from test313ViewField Transcript show:
"
"Expect the HTML output to look like this."
"Compare strings ignoring differences in white space."
"
"
***37 lines of code ***
Hum-Tests -- HumSeasideWidgetTests
setUpViewFrameInOntology: aHumOntology
"Generate a view frame and dictionary entries for several tests.
"
"Create a view frame."
"Add markup lines."
"TODO: Make this smarter.
"
"Create a dictionary frame."
"TODO: Should render description as a text area."
"TODO: Should render ingredients as an unordered list."
"TODO: Should render steps as an ordered list."
***50 lines of code ***
test010GivenWhenThen
"Test the test frame"
test011GivenWhenThenFail
"Dry test the test frame"
test100BasicWiring
"A Hum view frame is rendered as a Seaside Form."
"Initialize the View Frame for this test."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
test102BasicWiring2
"A Hum view frame is rendered as a Seaside Form."
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
***23 lines of code ***
test105BindWidgetToBlackboard
"A widget may be bound to blackboard"
"wire it up -- No worldbase for this test."
"Test flow: widget ==> blackboard ==> world base"
***21 lines of code ***
test107BindWidgetToCategory
"A widget may be bound to blackboard"
"wire it up"
"Test flow: widget ==> blackboard ==> world base"
***22 lines of code ***
test110ViewHasViewTag
"A Hum view frame is rendered as a Seaside Form. "
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
***23 lines of code ***
test120ViewHasFormTag
"A Hum view frame is rendered as a Seaside Form. "
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
***23 lines of code ***
test130ViewHasMarkupLines
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"
"
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect break within the form."
***33 lines of code ***
test132ViewHasHeadingLine
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect heading within the form."
***27 lines of code ***
test134ViewHasStringWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"frameEditor addMarkUp: '!! Recipe'."
"
"
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect input within the form."
***33 lines of code ***
test135ViewUptoWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"frameEditor addMarkUp: '!! Recipe'."
"
"
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect input within the form."
***33 lines of code ***
test136ViewHasTextWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"frameEditor addMarkUp: '!! Recipe'.
"
"
"
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect test area within the form."
***35 lines of code ***
test138ViewHasDateWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect date input within the form."
***27 lines of code ***
test139ViewHasCategoryWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect date input within the form."
***27 lines of code ***
test140ViewHasMeasureWidget
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect date input within the form."
***27 lines of code ***
test150ViewLineHasSeveralWidgets
"A Hum view frame is rendered as a Seaside Form ...
"
"Initialize the View Frame for this test."
"Add markup lines."
"Create HumView as interface between Ontology and Seaside"
"Generate Seaside code for the view frame."
"Expect date input within the form."
***28 lines of code ***
Hum-Tests -- HumSimulatorTests
aDesignNoteEventQueue
"The Simulator provides the means for 'regression testing'.
"
"Design Analysis:
"
"When events are sparse, or the actual system response time is highly variable, method 'a' is preferred.
"
"Method 'b' is typically more convenient for animations where the concept of frame-rate applies.
"
"On the whole, method 'a' appears to be more flexible. So that is what we will implement.
"
***40 lines of code ***
setUpBasicConfigurationOn: aHumSimulator
^setup. "Return dictionary of actors to simplify test and debug."
setUpDogAndPonyConfigurationOn: aHumSimulator
"Attach the configuration to the Simulator. "
"Instantiate the infrastructure agents."
"Instantiate the worker agents."
"Return a dictionary of actors for test convenience."
^myActors.
***34 lines of code ***
setUpDogAndPonyOntology
"When this ontology runs,
""
"Root of plan"
""
""
"planFrame3 addPrecondition: 'Pony is in the ring.' annotation: 'assumed'."
""
""
""
"testOntology inspect.
^testOntology.
***52 lines of code ***
setUpHotelOntology
"Provide a set of vignettes."
^testOntology.
***30 lines of code ***
setUpKnockKnockOnOntology: anOntology
"Provide a view frame."
"Provide a dictionary frame."
testX100SimulatorReadMe
"The Simulator provides the means for 'regression testing'.
"
"Simulations 'load' the system under test by starting dialog sequences
"
"The simulator (Scribe?) emulates a human response rate
"
"A simulation loads 'events' into a time-sorted queue and sends the events asynchronously.
"
***25 lines of code ***
testX101RepresentDialogSequence
"Simulations 'load' the system under test by starting dialog sequences
"Represent a dialog sequence as an sequencable collection or array."
testX102RepresentRandomIntervals
"Simulations 'load' the system under test by starting dialog sequences
"
"Express the distribution as an S-curve in seconds."
"TODO: This random execution concept has not been implemented yet."
testX103RepresentNumberOfDialogs
"Simulations 'load' the system under test by starting dialog sequences
"
"TODO: This parallel execution concept has not been implemented yet."
testX110AddEventToQueue
"A simulation loads client speech-acts into a queue with a specified delay.
"
"Speech acts are interpreted by dialog vignettes in an ontology."
testX112AddTwoEventsToQueue
"A simulation loads client speech-acts into a queue with a specified delay.
"
"Speech acts are interpreted by dialog vignettes in an ontology."
testX120Step
"A simulation loads client speech-acts into a queue with a specified delay.
"
"set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Examine log for expected event and values."
***28 lines of code ***
testX122StepStep
"A simulation loads client speech-acts into a queue with a specified delay.
"
"set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Examine logs for expected event and values."
***40 lines of code ***
testX124StepUntilDone
"A simulation loads client speech-acts into a queue with a specified delay.
"
"Given: set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"simulator log4Dialog inspect."
"Examine logs for expected event and values."
***34 lines of code ***
testX130DialogUsesScribe
"There should be a Scribe in the chain.
"
"setup"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Examine log for expected event and values."
"Verify that a Scribe is involved."
***32 lines of code ***
testX140VignetteTriggersGoal
"A vignette may trigger a goal."
"setup"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Verify that expected messages were sent."
"Expect logs for coordinator dispatcher bookkeeper worldbase dog pony band."
***26 lines of code ***
testX142RunClubMech
"A vignette may trigger a goal."
"set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Verify that expected messages were sent."
"WHEN: Client enters data (speaker, title, description) and presses [Go!] button ... "
"THEN: WorldBase should have a topic entity with attribute values for speaker, title, description. "
"WorldBase should contain user`s name, topic`s speaker, title, description"
"Enter a second topic. Result should be a second topic instance, not an updated version of first topic."
"At this point, 'Clear topic' instruction should have cleared topic entries from blackboard."
***76 lines of code ***
testX143RunBarista
"A vignette may trigger a goal."
"set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"2015-01-22: Data is not being passed from order to worker. "
"TODO: Simulate form fill-in."
"2015-01-22: Fails because polymorphism is not implemented."
"TODO: Implement polymorphism."
"Verify that expected messages were sent."
***41 lines of code ***
testX144RunDonutShop
"A vignette may trigger a goal."
"set up"
"Speech acts are interpreted by dialog vignettes in an ontology."
"Verify that expected messages were sent."
***31 lines of code ***
testX150RunParallel
"A vignette may trigger a goal."
"Speech acts are interpreted by dialog vignettes in an ontology."
"Verify that expected messages were sent."
"Verify that expected messages were sent."
"Expect logs for coordinator dispatcher bookkeeper worldbase dog pony band."
***35 lines of code ***
Hum-Tests -- HumTestCase
assert: stringA sameAs: stringB
assertPattern: stringPattern matches: string
ensure
"I think this belongs under HClientServerTests"
ensureBlock: aBlock
"I think this belongs under HClientServerTests"
eventSeen
^ eventSeen ifNil: [ eventSeen := 'No value was preset.' ]
eventSeen: anObject
"Set my one-shot memory of the last event seen."
expect: expectedValue actual: actualValue
^self assert: (( expected compare: actual caseSensitive: true ) = 2)
^self assert: (expectedValue asSet) = (actualValue asSet)
^self assert: ( ( (expectedValue x) closeTo: (actualValue x) ) and: [ ( (expectedValue y) closeTo: (actualValue y) )] )
***24 lines of code ***
expect: expectedValue actual: actualValue description: aDescription
pattern: stringPattern matches: string
signal
"I think method this belongs under HClientServerTests"
update: anObject
"This is called by event handler."
Hum-Tests -- HumTextEditorTests
test110ArrowKeys
***23 lines of code ***
test120NormalKeys
***30 lines of code ***
test130BreakLine
test140DeleteKey
"If cursor column > 1, delete character to the left of cursor and decrement column position."
"Set up"
"Delete one character"
test150DeleteLine
"If cursor column = 1, append current line to prior line and move remaining lines up."
"Set up three lines"
"Move cursor to start of second line."
"Delete one character"
***22 lines of code ***
test208CharacterizeStringDraw
"Tinker until we learn what we need to know about canvas, form, font integration."
"Option to display the form"
"This canvas has no background, so it will be tranparent when displayed."
test209CharacterizeStringDraw
"Tinker until we learn what we need to know about canvas, form, font integration."
"Paint background and border."
"Option to display the form"
***25 lines of code ***
test226DrawSeveralTextLinesOnPane
"TextEditor draws its lines on a HumPane -- ???"
"TODO: To be internally consistent,
"
"Option to display the pane"
***30 lines of code ***
Hum-Tests -- HumUserInterfaceTests
aReadMe
"See the class description for the intended (future) tests."
^'See the class description for the intended (future) tests.'
aReadMe2
"
"
***32 lines of code ***
aReadMe3
^'
"*** Learn how GL connects to viewports. ***"
***25 lines of code ***
aReadMe4
^'Test Driven Design (Decide if the following cascade makes sense.)
***54 lines of code ***
assert: x equals: a or: b
buildAvatar
"Create example to indicate development idea/s."
"Color"
"Assemble."
^avatar.
***30 lines of code ***
buildTrailerAssembly
"Build trailer - to be used in other tests."
"deck"
"walls"
"Assembly deck and walls"
"======= bed room ========"
"closets"
"======= bath room ==========="
"Postion hand sink above toilet but below topSpace - top will be ~ 1 meter ~ 40 inches above floor"
"Position shower by East wall (east of center aisle in bath roos)"
"======== galley =========="
"Assure shoulder room at table"
"Reset interior length"
"Transcript cr; show: 'buildTrailer'; cr; show: 'corrected interior length = ', interiorLength asString; cr."
"Correct south wall position"
^trailer.
***117 lines of code ***
buildTrailerNoseCurve
"Return curve of #(x y) where x = 0 is front-most point, y is offset from centerline"
"Transcript cr; show: '========='."
"Transcript cr; show: (x printShowingDecimalPlaces:2),'==>',(y printShowingDecimalPlaces:2)."
^curve
buildTrailerScene
"Build trailer scene - to be used in other tests."
"deck"
"walls"
"Assembly deck and walls"
"======= bed room ========"
"closets"
"======= bath room ==========="
"Postion hand sink above toilet but below topSpace - top will be ~ 1 meter ~ 40 inches above floor"
"Position shower by East wall (east of center aisle in bath roos)"
"======== galley =========="
"Assure shoulder room at table"
"Reset interior length"
"Transcript cr; show: 'buildTrailer'; cr; show: 'corrected interior length = ', interiorLength asString; cr."
"Correct south wall position"
***119 lines of code ***
checkViewPortMorph
^ checkViewPortMorph ifNil: [ checkViewPortMorph := false ].
checkViewPortMorph: aBoolean
expect: actualValue is: expectedValue
"syntax sugar"
^ self expect: expectedValue actual: actualValue.
for: someExpression expect: someResult
^self expect: someResult actual: someExpression
lastChange
^ lastChange
showViewPort: aHumViewPort
test110surfaceHasOrigin
"A surface is initialized with a origin object which is zerosized and at 0,0."
test120surfaceSizeIsDurable
"A surface is initialized with a origin object which is zero-sized and at 0,0."
"Note: Dimensions used here are not typical - They are just for testing convenience."
"Bump surface over the the right."
"Bump surface up."
"Bump surface from bottom."
"Pull surface via the right edge."
test130surfaceLayers
"An Surface Assembly has multiple shapes in one or more layers ."
"Note: Dimensions used here are not typical - They are just for testing convenience."
"Put rectangle A on the surface."
"Overlay rectangle B on top of rectangle A"
"By convention, the top and left edges will align."
"And other edges should be:"
"By convention, the layer is greater for the thing on top."
***35 lines of code ***
test135surfaceBoundingBox
"An pane has a bounding box determined by the min/max of its collection of shapes."
"Note: Dimensions used here are meaningless - They are just for testing convenience."
"Put rectangle A on the pane."
"Put rectange B on top of rectangle A"
"By convention, the top and left edges will align."
"By convention, the layer is greater for the thing on top."
"Expect bounding box metrics to be . . ."
***36 lines of code ***
test140surfaceLayout
"A surface is initialized with a origin shape which is zero-sized and at 0,0."
"Note: Dimensions used here are arbitrary - They are just for testing convenience."
"Put rectangle A on the surface."
"Put B below A."
"By convention B is in same layer as A. (They are side by side in the same layer. )"
"Now put B above A. "
"Now put B left of A."
"Now put B right of A."
***41 lines of code ***
test150surfaceLayoutForPA
"Test for API usability -- Consider a layout like the PA."
"NOTE: Dimensions used here are percents !!!"
"TODO: Percent notation may be leaking rendering engine layout API."
"TODO: Would 'em' be a more appropriate unit of measure?"
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
***48 lines of code ***
test210boxHasOrigin
"A box is initialized with a origin object which is zero-sized and at 0,0."
test210surfaceAsSVG
"Test for usability -- Consider a layout like the PA."
"Get the SVG string for this assembly."
test220boxSizeIsDurable
"When we move an edge, the width, height, and length are not affected."
"Bump box over to the the East by pushing on the West edge."
"Bump box up."
"Bump box from bottom."
"Pull box via the East edge."
"Bump box to the South by pushing on the North edge."
"Pull box to the South by pulling on the South edge."
***24 lines of code ***
test220surfaceAsSvgViewBox
"Test for usability -- Consider a layout like the PA."
"Get the SVG string for this assembly."
***22 lines of code ***
test230boxIsAContainer
"HumAssembly (subtype of HumBox) may contain other boxes/spaces. "
""
test240boxLayout
"We can position boxes using absolute position values and relative positions."
""
"Set absolute position (centroid)"
"Position boxes relative to each other."
"Place B on top of A."
"Place B under A."
"Place B on East side of A."
"Place B on West side of A."
"Place B on North side of A."
"Place B on South side of A."
***46 lines of code ***
test250boxCentering
"Center one box on top of another."
"Default unit of measure is meter."
"Center B on top of A."
test255surfaceAssemblyAsSVG
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
"Create the main divisions. NOTE: Dimensions will default to inches"
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
"Transcript cr; show: 'test255surfaceAssemblyAsSVG'; cr; show: svgString; cr."
***48 lines of code ***
test260surfaceAssemblyAsSvgPercent
"Test for usability -- Consider a layout like the PA."
"NOTE: Dimensions used here are percentages of the container !!!"
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
"Transcript cr; show: 'from test260surfaceAssemblyAsSvgPercent: ; cr; show: svgString; cr."
***53 lines of code ***
test270surfaceAssemblyAsSvgInch
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
"Transcript cr; show: svgString; cr."
***54 lines of code ***
test310spaceHasOrigin
"A space is initialized with a origin object which is zero-sized and at 0,0."
test310surfaceAsXML
"First principle: Express a hum surface as XML.
"
"Get the SVG string for this assembly."
"Transcript cr; show: 'from test310surfaceAsXML : '; cr; show: xmlString; cr."
***22 lines of code ***
test320spaceSizeIsDurable
"When an edge is moved, the opposite edge is also moved."
"Bump space over to the the East by pushing on the West edge."
"Bump space up."
"Bump space from bottom."
"Pull space via the East edge."
"Bump space to the South by pushing on the North edge."
"Pull space to the South by pulling on the South edge."
***24 lines of code ***
test320surfaceAssemblyAsXML
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
"NOTE: Dimensions used here are percentages of the container !!!"
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
"Transcript cr; show: 'from test320surfaceAssemblyAsXML'; cr; show: xmlString; cr."
***56 lines of code ***
test330spaceContainer
"We can specify a box position in terms of its centroid."
""
"Note: These box positions are relative to the container`s edges."
test340spaceLayout
"HumAssembly may position its parts relative to itself and each other."
""
"Place B on top of A."
"Place B under A."
"Place B on East side of A."
"Place B on West side of A."
"Place B on North side of A."
"Place B on South side of A."
***44 lines of code ***
test350assemblyDimensions
"A HumAssembly dimensions enclose whatever is inside the assembly"
""
"Note: These positions are relative to the container`s origin."
"Place B on top of A."
"Place B under A."
"Place B on East side of A."
"Place B on West side of A."
"Place B on North side of A."
"Place B on South side of A."
"Test bounding box of the assembly."
"Test bounding box edges of the assembly."
***61 lines of code ***
test410surfaceAsHTML
"Test for usability -- Consider a layout like the PA."
"This #asHTML feature is deferred until javascript code is written to enable it."
"Get the SVG string for this assembly."
***21 lines of code ***
test470surfaceAssemblyAsHTML
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
"This feature is deferred until javascript code is written to enable it."
^self skip ].
"NOTE: Dimensions used here are percentages of the container !!!"
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
***58 lines of code ***
test510surfaceAsHumScript
"Test first principle: Produce a Hum action call.
"
"This #asHTML feature is deferred until javascript code is written to enable it."
"Get the SVG string for this assembly."
"Expect something like '. Painter: Paint surface with id 'window' width '800 px' height '450 px'. "
"Transcript cr; show: 'from test510surfaceAsHumScript '; cr; show: script; cr."
***27 lines of code ***
test570surfaceAssemblyAsHumScript
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
"This feature is deferred until javascript code is written to enable it."
"NOTE: Dimensions used here are percentages of the container !!!"
"Create the main divisions."
"Assemble them."
"Create editStack divisions and assemble them."
"Create diagramStack divisions."
"Get the SVG string for this assembly."
"
"
***56 lines of code ***
testA110addPart
"Add a part to an assembly. Check content and event handling"
"At this point part1 and part2 should be in assembly`s parts."
"The assembly should be in the dependents of each part."
"Whan part is changed, the assembly should be informed and activate its #changed actions."
"First check my test bed."
"Now check for part to assembly notification."
***38 lines of code ***
testA210assembleAvatar
"Create example to indicate development idea/s."
"Assemble."
"Assert some expectations"
"Head is centered. So edges are inboard from torso."
"But some things were not constrained. So set those also."
"TODO: Check that constraints are effective."
***39 lines of code ***
testA220colorAvatar
"Create example to indicate development idea/s."
"Assemble."
"Color"
"This is a usability test. Does it pass?"
***28 lines of code ***
testA410x3dAssembly
"render the objects in HumAssembly"
"TODO: Most parts of this assembly are omitted to temporarily simplify this test. ***"
"upperArmLeft := HumSolid id: #upperArmLeft type: #elipsoid height: 0.5 width: 0.1 depth: 0.1.
"Assemble."
"Assume avatar is facing us."
"avatar position: upperArmLeft eastOf: torso.
"Color"
" upperArmLeft color: ( Color paleGreen ).
"render"
"Transcript cr; show: 'testS410x3dAssembly'; cr; show: x3d; cr."
"Write code out to a file for easier inspection and possible compilation."
***37 lines of code ***
testA420trailerExample
"Test DSL usability - No code is generated by this test."
"deck"
"walls"
"Assembly deck and walls"
"======= bed room ========"
"closets"
"======= bath room ==========="
"Postion hand sink above toilet but below topSpace - top will be ~ 1 meter ~ 40 inches above floor"
"Position shower by East wall (east of center aisle in bath roos)"
"======== galley =========="
"Assure shoulder room at table"
"Reset interior length"
"Transcript cr; show: 'testS420trailerExample'; cr; show: 'corrected interior length = ', interiorLength asString; cr."
"Correct south wall position"
***112 lines of code ***
testA425trailerExample2
"Test DSL usability -- change #depth to #length -- No code is generated."
"deck"
"walls"
"Assembly deck and walls"
"======= bed room ========"
"closets"
"======= bath room ==========="
"Postion hand sink above toilet but below topSpace - top will be ~ 1 meter ~ 40 inches above floor"
"Position shower by East wall (east of center aisle in bath roos)"
"======== galley =========="
"Assure shoulder room at table"
"Reset interior length"
"Transcript cr; show: 'testS425trailerExample'; cr; show: 'corrected interior length = ', interiorLength asString; cr."
"Correct south wall position"
***112 lines of code ***
testA430showTrailerLayoutTable
"Display a table of the trailer parts edges.
"
"table heading"
"table rows"
testA530assemblyAsThreeJS
"Render a box as a ThreeJS cube"
"Expect this prolog."
"Expect this code fragment -- one of many like this."
testA540sceneAsThreeJS
"Render a box as a ThreeJS cube"
"Expect this scene prolog"
"Expect this layer prolog. One of several like this."
"Expect this code fragment -- one of many like this."
***23 lines of code ***
testA550sceneAsThreeJSinHTML
"Render a box as a ThreeJS cube"
"write it to a file as see if it compiles and renders"
testA600VPythonReadMe
"I started this when my VPython environment started working again.
"
"2016-11-01:
"
"If I want to use a web browser platform as my client,
"
testA625VPythonTrailer
"Generated code should contain BoxThing() instances."
"TODO: Generated code should contain positioning statements."
"Write code out to a file for easier inspection and possible compilation."
testC210CreateHumCanvas
"HumCanvas provides a wrapper on actual implementation."
"HumCanvas provides a wrapper on the physical implentation. (So we can move to another one if needed)"
"For time being, use the Squeak Canvase API -- May change my mind later."
testC211CreateHumCanvas
"HumCanvas provides a wrapper on actual implementation."
"HumCanvas provides a wrapper on the physical implentation. (So we can move to another one if needed)"
"For time being, use the Squeak Canvase API -- May change my mind later."
testC220DrawRawPolygon
"HumCanvas provides a wrapper on actual implementation."
"Triangle"
"Draw it on canvas"
testC222DrawHumPolygon
"HumCanvas provides a wrapper on actual implementation."
"Triangle"
"Draw it on canvas -- Note: HumCanvas delegates to FormCanvas."
testD110CreateDiagram
"Create a diagram with three nodes and two connections."
***22 lines of code ***
testD210LayoutDiagram
"Create a diagram with three nodes and two connections."
"Layout the diagram."
***29 lines of code ***
testD220LayoutDiagram
"Create a diagram with four nodes and three connections."
"Layout the diagram."
***32 lines of code ***
testD230LayoutDiagram
"Create a diagram with five nodes and four connections."
"Layout the diagram."
"Note nodeC and nodeD will be assigned 12@0 or 12@8. But the choice may be random."
"Note nodeC and nodeD will be assigned -12@0 or -12@8. But the choice may be random."
"diagram inspect."
***49 lines of code ***
testD310DistanceBetweenNodes
"Calculate the (layout) distance between two nodes."
"Force the layout 3-4-5 triangle to make this test easier"
"The distance from nodeA to nodeC should be 50."
***34 lines of code ***
testD321EnergyBetweenNodes
"Calculate the (layout) force between two nodes."
";
"
"Force the layout to make this test easier"
***41 lines of code ***
testE110EditorPosition
"The editor owns a (cursor) position."
"Initial position is at front of first line."
testE120EditorInsertCharacterAtEndOfLine
"When we insert a character, the cursor advances and the character is in the text string."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Editor is a controller. Text is a model. When text is changed, it issues a change notice."
***26 lines of code ***
testE121EditorInsertCharacterAtFrontOfLine
"When we insert a character, the cursor advances and the character is in the text string."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character, but at the front of the line."
***22 lines of code ***
testE130EditorInsertLine
"When we insert a line, the cursor advances to the beginning of the new line."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Insert an empty line."
"We should see event"
***33 lines of code ***
testE131EditorInsertTwoLines
"When we insert a line, the cursor advances to the beginning of the new line."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Insert an empty line."
***29 lines of code ***
testE140EditorDeleteCharacterAtEndOfLine
"When we delete a character, the cursor decrements
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Delete the character at end of line."
***30 lines of code ***
testE141EditorDeleteCharacterAtStartOfLine
"When we delete a character, the cursor decrements
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Delete the character at end of line."
"Delete the character at start of line."
***33 lines of code ***
testE142EditorIgnoresDeleteWhenCursorAtStartOfLine
"When we delete a character, the cursor decrements
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Move cursor to start of line"
"Attempt delete -- should be ignored"
"Delete the character at start of line."
***32 lines of code ***
testE143EditorDeleteCharactersWillNotBackOverBeginningOfLine
"When we delete a character, the cursor decrements
"
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"And, of course, the text has the new character."
"Insert another character . . ."
"Delete the character at end of line."
"Delete the character at start of line."
"Attempt one more delete."
***42 lines of code ***
testE210InterpretArrowKeys
"The arrow keys move the cursor and forget the selection.
"
"When we try to push beyond the current text. The cursor does not move."
***47 lines of code ***
testE220InterpretAltArrowKeys
"The arrow keys move the cursor and forget the selection.
"
"When we try to push beyond the current text. The cursor does not move."
***50 lines of code ***
testE230InterpretShiftArrowKeys
"The shift arrow keys move the cursor and update the selection.
"
"Go the other way."
***58 lines of code ***
testE310EditorSupportsUnDo
"Editor supports multiple levels of undo."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"Insert another character . . ."
"Insert an empty line."
"Test undo"
"Multiple levels of undo"
***44 lines of code ***
testE315EditorSupportsUnDoAtBottom
"Editor supports multiple levels of undo - tolerates too many pops."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"Insert another character . . ."
"Insert an empty line."
"Test undo"
"Multiple levels of undo"
"Too many undo should not raise exception or produce unexpected side effect."
***48 lines of code ***
testE320EditorSupportsReDo
"Editor supports multiple levels of undo and redo."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"Insert another character . . ."
"Insert an empty line."
"Test undo"
"Multiple levels of undo"
"Multiple levels of redo"
***53 lines of code ***
testE325EditorSupportsReDoToBottom
"Editor supports multiple levels of undo and redo."
"Initial position of the cursor is line 1, column 1"
"When a character is inserted at the cursor position, the cursor advances."
"Insert another character . . ."
"Insert an empty line."
"Test undo"
"Multiple levels of undo"
"Multiple levels of redo"
"Tolerate one too many."
***57 lines of code ***
testS110boxFacesAsPolygons
"Expect South face"
testS120boxVolumeMassWeight
testS200x3dReadMe
" TODO: X3D is my preferred target language for 3D visualization.
"
testS210x3dColor
"HumSolid x3dColor should produce a X3D color string"
testS220x3dExtent
"Produce a x3d box extent from my length width height"
testS230x3dCenter
"Produce a x3d box position from my length width height (and default position)"
testS310x3dMaterial
"HumSolid x3dMaterial should produce a X3D xml string"
testS320x3dShape
"Produce a x3d box extent from my length width height"
testS330changed
"#changed is propagated to parent, dependents."
testS500ThreeJSReadMe
"The advantage of ThreeJS is that it runs WebGL in a relatively straight-forward manner.
"
testS505ThreeJSColor
"HumSolid three.js needs HTML color string"
testS520ThreeJSBox
"Produce a Three.js cube with my length width height and position"
testS610VPythonThing
"Produce a VPython Thing.py box with my length width height and position"
testS615VPythonSpace
"Produce a VPython Thing.py box with my length width height and position, but not visible"
testS620VPythonPreamble
"Produce a general purpose VPython scene preamble "
***24 lines of code ***
testT110initialTextHasOneEmptyLine
"When it is initialized, there is one empty line.
"
"Initial position of the cursor is line 1, column 1"
testT115initialTextCopyHasOneEmptyLine
"When it is initialized, there is one empty line.
"
"Initial position of the cursor is line 1, column 1"
testT210TurtleCreation
"Create a new turtle and check initial state."
testT220TurtleHeading
"Test methods that change the heading."
***25 lines of code ***
testT230TurtleStepping
"Test methods that change the heading."
***40 lines of code ***
testT240TurtleSpeeding
"Test methods that change the heading."
***41 lines of code ***
testV100ReadMe
"The current viewport uses low-level graphics functions rather than Morph.
"
testV105CreateCamera
"The camera is modeled by a pin-hole box camera."
"Camera should be positioned at adult eye-height."
"Default camera has westEdge at zero."
testV110PositionCameraFacingBillboard
"The default/initial viewport frustrum is laid directly onto the surface.
"
"Create a simple billboard with three surfaces."
"Create a billboard and put it into a scene."
***44 lines of code ***
testV115PanCameraUpDownLeftRight
"Move the camera in the scene to effect pan motion."
"Create a camera and put it into a scene."
***22 lines of code ***
testV116CameraRotateSlideForward
"Move the camera in the scene to effect pan motion."
"Create a camera - with default positioning."
***37 lines of code ***
testV117CameraRotateSlideSideways
"Move the camera in the scene to effect pan motion."
"Create a camera with default positioning."
***37 lines of code ***
testV118CameraRotateSlideUpDown
"Move the camera in the scene to effect pan motion."
"Create camera with default positioning"
***37 lines of code ***
testV120MapPointsFromSceneToViewport
"In an orthographic projection,
"
""
"Note: These positions are relative to the container`s origin."
"Place B on top of A."
"Place B on East side of A."
"Place B on North side of A."
"Put camera in the scene. Attach a viewport to the camera."
"Position camera"
"Project the 3D points onto the 2D surface."
"viewportPolygons inspect."
***49 lines of code ***
testV200ReadMe
"This group characterizes the low level drawing infrastructure
testV300checkViewPortMorph
"This group characterizes the low level drawing infrastructure
testV310ConnectViewPortToHumCanvas
"HumCanvas provides a wrapper on actual implementation."
"Connect the viewport to the canvas."
"The viewport will paint itself onto the canvas at the given canvas coordinates."
testV320DrawPolygonOnBillboard
"Draw a 2D polygon on the viewport canvas."
"Connect the viewport to the canvas."
"The viewport will paint itself onto the canvas at the given canvas coordinates."
"Polygon -- Triangle in canvas pixel coordinates."
"Paint the polygon onto a Surface."
"Reset height and width to fit content."
"Tranlate the surface into a Billboard."
"Put the Billboard into a Scene."
"Put a Camera in the Scene and attach it to a ViewPort."
"Project the scene into the ViewPort."
"Render the ViewPort onto the assigned Canvas."
"Display the Canvas to see what we got."
***37 lines of code ***
testV330DrawABox
"Draw a 3D box on the viewport - use perspective projection."
testV331PaintABox
"Draw a 3D box on the viewport - use perspective projection."
testV332PaintAPyramid
"Draw a 3D box on the viewport - use perspective projection."
testV333PaintARotation
"Draw a 3D box on the viewport - use perspective projection."
testV334PaintACylinder
"Draw a 3D box on the viewport - use perspective projection."
testV334PaintAnElipsoid
"Draw a 3D box on the viewport - use perspective projection."
" xy := OrderedCollection new.
"
"camera rotationDegrees: (45 degrees).
"
***22 lines of code ***
testV335PaintAThing
"Draw a 3D thing on the viewport - use perspective projection."
testV335PaintATorus
"Draw a 3D thing on the viewport - use perspective projection."
"scene center: camera at: { 40. -40. 30. }.
testV335PaintExtrusion
"Draw a 3D thing on the viewport - use perspective projection."
"scene center: camera at: { 40. -40. 30. }.
***28 lines of code ***
testV336DrawAThing
"Draw a 3D thing on the viewport - use perspective projection."
testV336WireframeATorus
"Draw a 3D thing on the viewport - use perspective projection."
testV337DrawAThingWireFrame
"Draw a 3D box on the viewport - use perspective projection."
testV338DrawABoxAsTriangles
"Draw a 3D box on the viewport - use perspective projection."
testV345DrawASolidRotated
"Draw a 3D box on the viewport - use perspective projection."
testV346DrawASolidTilted
"Draw a 3D box on the viewport - use perspective projection."
testV347DrawASolidRotatedAndTilted
"Draw a 3D box on the viewport - use perspective projection."
testV350paintAvatar
"camera rotateRight: (90 degrees)."
testW100ReadMe
"Hum Widgets are wrappers on various presentation layer technologies.
"
"Hum Widgets are typically bound to a BlackBoard and an Ontology.
"
testW110LayoutContainsOtherWidgets
"A layout widget contains one or more other widgets."
"Widgets are orderd as added."
testW120RowLayout
"A row layout arranges child widgets in a row."
testW130ColumnLayout
"A column layout arranges child widgets in a column."
testW220RowLayoutHTML
"A row layout arranges child widgets in a row."
testW230ColumnLayoutHTML
"A row layout arranges child widgets in a row."
testW320RowLayoutAsMorph
"A row layout arranges child widgets in a row."
***22 lines of code ***
testW330ColumnLayoutAsMorph
"A row layout arranges child widgets in a row."
***21 lines of code ***
update: someObject
"Record fact that someObject was updated by a test.
"
Hum-Tests -- HumVRTests
test100CreateVRwith2scenes
"A virtual reality has one or more scenes."
"Create a VR world"
"Create two scenes"
"Add scenes to world."
"Start the world - stepping."
"Stop the world - stop stepping."
Hum-UI
Hum-UI -- HumAssembly
addPart: aHumBox
"Add the component to my parts list"
"When the part is changed, the assembly (me myself) (e.g. scene) will be notified."
addParts: aCollection
"Add the component to my parts list"
advance: aBox by: anArray
"Move the box by the given increments.
"
"Assure that aBox is in my collection. "
"Compute edge positions to center aBox at those coordinates."
***23 lines of code ***
asPolygons
"Return polygons for my parts."
^assemblyPolygons.
asPolygonsColorCoded
"Return polygons for my parts."
^assemblyPolygons.
asThreeJS
"render the parts contained in this assembly"
"TODO: Add method to generate Three.js boiler plate."
"Initialize geometry for this assembly."
"Create the part"
"Merge it into the assembly."
"The template drives this, producing one line of code."
^js.
***25 lines of code ***
asVPython
"Render my parts via Visual Python Things"
"Note: Put the assembly in a scene.
^pythonCode.
asX3D
"Return a string representing this assembly as a X3D element and scene.
"
^x3d.
bbBottomEdge
"Find my bounding box edge."
^bottomEdge := myEdge.
bbDepth
"Depth is another name for length."
^self bbLength.
bbEastEdge
"Find my bounding box edge."
^eastEdge := myEdge.
bbHeight
"height of my bounding box"
^height.
bbLength
"length of my bounding box"
^height.
bbNorthEdge
"Find my bounding box edge."
^northEdge := myEdge.
bbSouthEdge
"Find my bounding box edge."
^southEdge := myEdge.
bbTopEdge
"Find my bounding box edge."
^topEdge := myEdge.
bbWestEdge
"Find my bounding box edge."
^westEdge := myEdge.
bbWidth
"width of my bounding box"
^height.
center: aHumBox above: aHumBox2
"synonym"
center: aBox at: a3Vector
"Center the part (aBox) at the given coordinates. { east. north. up. }
"Make sure I have that box in my parts list."
center: boxB below: boxA
"Center boxB over boxA"
center: boxB eastOf: boxA
"Center boxB over boxA"
center: boxB northOf: boxA
"Center boxB over boxA"
center: boxB onTopOf: boxA
"Center boxB over boxA"
center: aHumBox over: aHumBox2
"synonym"
center: boxB southOf: boxA
"Center boxB over boxA"
center: boxB westOf: boxA
"Center boxB over boxA"
changed
"Transcript cr; show: 'Assembly ',self id,' changed.'."
exploded
"Explode assemblies so that all the parts of parts become visible."
^allParts.
parts
^ parts ifNil: [ parts := Set new ].
position: boxA above: boxB
"synonym"
position: boxA below: boxB
"synonym"
position: boxA eastOf: boxB
"Position A on East edge of B."
"Assure both are in my collection."
"By convention, A`s West edge will now equal B`s East edge. (zero clearance)"
"Note that up-down and north-south edges are not affected.
"
position: boxA northOf: boxB
"Position A on North edge of B."
"Assure both are in my collection."
"By convention, A`s South edget will now equal B`s North."
position: boxA onBottomOf: boxB
"Position A on bottom of B."
"Assure both are in my collection."
"By convention, A`s top will now equal B`s bottom."
position: boxA onTopOf: boxB
"Position A on top of B."
"Assure both are in my collection."
"By convention, A`s bottom will now equal B`s top."
position: boxA over: boxB
"synonym"
position: boxA southOf: boxB
"Position A on South edge of B."
"Assure both are in my collection."
"By convention, A`s North edge will now equal B`s South. (zero clearance)"
position: boxA under: boxB
"synonym"
position: boxA westOf: boxB
"Position A on West edge of B."
"Assure both are in my collection."
"By convention, A`s bottom will now equal B`s top."
update: anObject
"TBD"
"Transcript cr; show: 'Assembly: ', self id, ' sees update of: ', anObject asString."
update: anAspect with: anObject
"TBD"
x3DOM
"TODO: Generate HTML to enable X3DOM viewing in Browser."
^html.
***130 lines of code ***
x3dBackground
"Provide (default) X3D background element (skybox)"
^x3d.
x3dBoilerPlate
"Provide boilerplate attributes for X3D element"
"profile='Interchange' version='3.2'
^attributes.
x3dObjects
"Render each of the objects in my collection"
^x3d.
x3dScene
"Return a string representing this assembly as a X3D scene.
"
^x3d.
zcenter: aBox at: anArray
"Center the part (aBox) at the given coordinates. { east. north. up. }
"Assure that aBox is in my collection. "
"Compute edge positions to center aBox at those coordinates relative to my origin."
zcenter: boxB onTopOf: boxA
"Center boxB over boxA"
"Adjust the x,y coordinates to match the bottom box`s center"
"Keep the new Z."
Hum-UI -- HumBox
aboutEdges
^'WARNING: The set/get methods for edges assume a default orientation.'.
addPolygon: aHumPolygon
asCamelCase
"Return identifier as a camelcase string."
^ (self id asCamelCase uncapitalized ).
asMeasure: aQuantity
"Convert string/number/measure to a measure. (default unit is meter)"
^measure
asThreeJS
"Render this as a box in Three.js"
"Note: Caller must merge this into a scene or group geometry"
^js.
***22 lines of code ***
asX3D
"Return a string in X3D notation representing this box / thing.
"
"TODO: Subtypes may add appearance and/or material elements"
^x3d.
bottomEdge
^ bottomEdge
bottomEdge: aQuantity
"WARNING: Assumes the box has default orientation."
"Reset the bottom edge"
"Force the top "
center
"Center of box (and/or center of bounding box) -- { x y z } = { east north up }"
"Compute my center coordinates - { east. north. up }"
^position.
centerAt: a3Vector
"Center myself at the given coordinates. { east. north. up. }
"Compute new edge positions to center aBox at those coordinates relative to my origin."
"TODO: This does not provide pitch, yaw, roll."
centerX
"X axis points East"
^(self westEdge + ( (self width ) * 0.5 )).
centerY
"Y dimension points North"
^( self southEdge + ( (self length ) * 0.5 ) ).
centerZ
"Z dimension points up."
^( self bottomEdge + ( (self height ) * 0.5 ) ).
changed
"Notify my rendering engine that I am changed."
"Notify my dependents."
"x,y,z are HumMeasure"
"Transcript cr;
depth
"synonym"
^ length.
depth: aHumMeasure
"synonym"
eastEdge
^ eastEdge
eastEdge: aQuantity
"Reset the East edge."
"Force the West edge."
equationOfMotion
"The equation-of-motion should be a block with args: box and time"
^equationOfMotion.
equationOfMotion: fcSelfAndTime
"The equation-of-motion should be a block with args: box and time"
exploded
^{ self }.
height
"Get the height. By convention, height runs up and down."
^ height
height: aQuantity
"Reset the up-down dimension."
"Hold botton steady and force the top."
id
"Identifier used in rendering context"
^ id ifNil: [ id := self identityHash printString ].
id: aString
"Identifier used in rendering contexts"
id: aString height: aHeight width: aWidth depth: aDepth
"synonym"
^ self id: aString height: aHeight width: aWidth length: aDepth.
id: aString height: aHeight width: aWidth length: aLength
initialize
"Set dimensions to zero."
"By convention length is North-South, width is East-West, and height is top-bottom."
"X: East is +. West is -."
"Y: North is +. South is -."
"Z: Up is +. Down is -."
"Default system of metrics is MKS (Meters, Kilograms, Seconds)"
"Velocity vector = (northward, eastward, upward)"
"Position edges at zero."
***21 lines of code ***
jump: aTime
"Evaluate my equationOfMotion"
"TODO: Can we make this compatible with HumSimulator?"
length
"Get the length. By convention, length runs North and South."
^ length
length: aQuantity
"set North-South dimension"
"Reset the length. By convention, length runs North and South."
"Hold South steady and force the North."
mm: aMeasure
"Format this measure to 3 digits accuracy - i.e. millimeter accuracy"
^ measure quantity printShowingDecimalPlaces: 3. ].
mmShave: aMeasure
"Format this measure to 3 digits accuracy - i.e. millimeter accuracy.
^ (aMeasure - (2 millimeter)) quantity printShowingDecimalPlaces: 3.
nextColor
"Select from a sequence of colors. Enables reproducable result."
^nextColor.
northEdge
^ northEdge
northEdge: aQuantity
"Reset North edge."
"Hold North steady and force South."
origin
"Origin is always a zero-sized object at (0 0 0)."
^ origin ifNil: [ origin := HumBox new. ].
polygons
"TODO: DANGER -- asPolygons is not defined in this supertype."
^ polygons ifNil: [ polygons := self asPolygonsColoredBy: [ self color ] ].
polygons: aCollection
"Computed polygons *may* be stored here."
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
rSquared
"How far am I from the origin? Use R-squared of my centroid as metric."
^rSquared.
resetColoring
rotateLeft: angleInDegrees
"Set rotation (yaw) in scene coordinates - Note: This is not additive."
rotatePolygons: inputPolygons
"Correct the polygons for my rotation (yaw)."
^resultPolygons.
***25 lines of code ***
rotateRight: angleInDegrees
"Set rotation (yaw) in scene coordinates - Note: This is not additive."
rotation
"Get my rotation (yaw) in scene coordinates as a value expressed in radians "
^rotation ifNil: [ rotation := 0.0 ].
rotation: angle
"Set my rotation (yaw) in scene coordinates as a value expressed in radians "
rotationDegrees: angle
"Set my rotation (yaw) angle in scene coordinates. "
slideBackward: aHumMeasure
"Slide in the South direction - TODO: adjust for camera rotation."
slideDown: aHumMeasure
"Move box (e.g. camera) up or down in the scene coordinates."
"TODO: Refactor to make this work in camera coordinates - corrected for rotation and tilt."
slideForward: aHumMeasure
"Slide in the North direction - TODO: adjust for camera rotation."
slideLeft: aHumMeasure
^self slideRight: (aHumMeasure negated).
slideRight: aHumMeasure